Model reference · open weights

llama2-embedding-8k

Embeddings mesolitica Embeddings 1 build Licence not stated 220k dl/mo

llama2-embedding-8k is an open-weight embedding model from mesolitica. llama2-embedding-1b-8k (FP32) weighs 1.9 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • llama2-embedding-8k is a feature-extraction model developed by mesolitica for generating text embeddings.
  • It contains 947M parameters and is designed for the Malay language.
  • The model was trained on an 8k context length but supports inference up to 32,768 tokens.

Summary of the mesolitica/llama2-embedding-1b-8k model card, 2026-10-01

What it is

Released bymesolitica
Released2023-10-05
Parameters947M
VRAM1.9 GB for the weights

What it runs on

Memory and cards for llama2-embedding-1b-8k (FP32)

1.9 GBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What mesolitica says about llama2-embedding-8k

Read the model card

Trained on truncated 8k context length, but infer able to scale up to 32k context length.

README at https://github.com/mesolitica/llama2-embedding#finetune

WandB, https://wandb.ai/mesolitica/llama2-embedding-1b?workspace=user-husein-mesolitica

how-to

from transformers import AutoModel, AutoTokenizer
from sklearn.metrics.pairwise import cosine_similarity

model = AutoModel.from_pretrained('mesolitica/llama2-embedding-1b-8k', trust_remote_code = True)
tokenizer = AutoTokenizer.from_pretrained('mesolitica/llama2-embedding-1b-8k')

input_ids = tokenizer(
    [
        'tak suka ayam',
        'Isu perkauman: Kerajaan didakwa terdesak kaitkan pemimpin PN',
        'nasi ayam tu sedap',
        'suka ikan goreng?',
        'Kerajaan tidak akan berkompromi dengan isu perkauman dan agama yang dimanipulasi pihak tertentu untuk mengganggu-gugat kestabilan negara serta ketenteraman rakyat.',
        'rasis bodo mamat tu',
        'kerajaan sekarang xde otak',
        'aku nak sukan olimpik ni',
        'malaysia dapat x pingat kt sukan asia?',
        'pingat gangsa menerusi terjun dan olahraga pada hari ke-10',
        'Kerajaan negeri kini dibenarkan melaksanakan penerokaan awal unsur nadir bumi (REE) berdasarkan prosedur operasi standard (SOP) sedia ada untuk perlombongan nadir bumi dan mineral.',
        'KONTINJEN Malaysia mendekati sasaran 27 pingat di Sukan Asia kali ini esok, selepas menuai dua lagi pingat gangsa menerusi terjun dan olahraga pada hari ke-10 pertandingan, pada Selasa.'
    ],
    return_tensors = 'pt',
    padding = True
)
v = model.encode(input_ids).detach().numpy()
v.shape
(12, 1536)

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms