alt.freeweights.embed / F2LLM-v2-330M
From: codefuse-ai <huggingface.co/codefuse-ai>Newsgroups: alt.freeweights.embedSubject:

F2LLM-v2-330M

Date: 2026-11-15Commit: de3ccdfSigned: 2DC28CC7B26A283B ✓

Feature extraction model with 334M parameters. Safetensors weights, 683 MB in all. Published by codefuse-ai under Apache-2.0.

334M params683MBF2LLM-v2-330Msafetensorspermissive
FactsParams334MSize683 MBFormatssafetensorsTaskfeature extractionLicenseApache-2.0From sourcepermissive
$ fw get codefuse-ai/F2LLM-v2-330M
# manifest sha256 3a3dbcd06b58… · 683 MB · 15 files
$ fw verify ./F2LLM-v2-330M codefuse-ai/F2LLM-v2-330M
From sourceHosted (signed)codefuse-ai/F2LLM-v2-330MLast check: 2026-11-15 03:22 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Evaluate with

Overview

Size
683 MB
Weights
669 MB (safetensors)
Parameters
334M
Formats
safetensors
Task
feature extraction
License
Apache-2.0 (permissive)
Files
15, each with a sha256
Publisher
codefuse-ai
Added
2026-11-15
Section
alt.freeweights.embed
Lineage

Original release from the publisher.

Base model: codefuse-ai/F2LLM-v2-0.6B-Preview-Pruned-330M

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 03:22 UTCpassed

Model card

From the publisher at commit de3ccdf. Shown as plain text with links; images open at the publisher.

F2LLM-v2-330M#

F2LLM-v2 is a family of general-purpose, multilingual embedding models in 8 distinct sizes ranging from 80M to 14B. Trained on a curated composite of 60 million publicly available high-quality data, F2LLM-v2 supports more than 200 languages, with a particular emphasis on previously underserved mid- and low-resource languages.

F2LLM-v2 is fully open. We release base models in 5 sizes, instruct models in 8 sizes, the training data, the training code, and intermediate checkpoints. The three smallest instruct models are pruned and trained from the 0.6B base model.

Performance#

The F2LLM-v2 family set a new state-of-the-art on a wide range of MTEB benchmarks, including Code, European, Scandinavian, German, French, Spanish, Polish, Dutch, Japanese, Vietnamese, Thai, Indic, Persian, among others.

Image: Performance

For details, refer to the MTEB leaderboard.

Usage#

With Sentence Transformers#

To encode text with the Sentence Transformers library:

from sentence_transformers import SentenceTransformer
model = SentenceTransformer("codefuse-ai/F2LLM-v2-330M", device="cuda:0", model_kwargs={"torch_dtype": "bfloat16"})
# Some sample query and documents
query = "What is F2LLM used for?"
documents = [
    'We present F2LLM, a family of fully open embedding LLMs that achieve a strong balance between model size, training data, and embedding performance.',
    'F2LLM is a model for computing text embeddings that can be used for various NLP tasks such as information retrieval, semantic search, and text classification.',
    'F2LLM 是 CodeFuse 开源的系列嵌入模型。',
    'F2LLM — это модель вычисления встраивания текста, которую можно использовать для различных задач НЛП, таких как поиск информации, семантический поиск и классификация текста.'
]
# Encode the query and documents separately. The encode_query method uses the query prompt
query_embedding = model.encode_query(query)
document_embeddings = model.encode_document(documents)
print(query_embedding.shape, document_embeddings.shape)
# (896,) (4, 896)
# Compute cosine similarity between the query and documents
similarity = model.similarity(query_embedding, document_embeddings)
print(similarity)
# tensor([[0.6242, 0.7883, 0.7561, 0.8022]])
With Transformers#

Or directly with the Transformers library:

from transformers import AutoModel, AutoTokenizer
import torch
import torch.nn.functional as F
model_path = "codefuse-ai/F2LLM-v2-330M"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path, torch_dtype=torch.bfloat16, device_map={'': 0})
query = "What is F2LLM used for?"
query_prompt = "Instruct: Given a question, retrieve passages that can help answer the question.\nQuery: "
documents = [
    'We present F2LLM, a family of fully open embedding LLMs that achieve a strong balance between model size, training data, and embedding performance.',
    'F2LLM is a model for computing text embeddings that can be used for various NLP tasks such as information retrieval, semantic search, and text classification.',
    'F2LLM 是 CodeFuse 开源的系列嵌入模型。',
    'F2LLM — это модель вычисления встраивания текста, которую можно использовать для различных задач НЛП, таких как поиск информации, семантический поиск и классификация текста.'
]
def encode(sentences):
    batch_size = len(sentences)
    # the tokenizer will automatically add eos token
    tokenized_inputs = tokenizer(sentences, padding=True, return_tensors='pt').to(model.device)
    last_hidden_state = model(**tokenized_inputs).last_hidden_state
    eos_positions = tokenized_inputs.attention_mask.sum(dim=1) - 1
    embeddings = last_hidden_state[torch.arange(batch_size, device=model.device), eos_positions]
    embeddings = F.normalize(embeddings, p=2, dim=1)
    return embeddings
# Encode the query and documents
query_embedding = encode([query_prompt + query])
document_embeddings = encode(documents)
print(query_embedding.shape, document_embeddings.shape)
# torch.Size([1, 896]) torch.Size([4, 896])
# Compute cosine similarity between the query and documents
similarity = query_embedding @ document_embeddings.T
print(similarity)
# tensor([[0.6250, 0.7891, 0.7539, 0.8047]], device='cuda:0',
#        dtype=torch.bfloat16, grad_fn=<MmBackward0>)
Prompts#

The model supports custom instructions in the following format:

Instruct: your_instruction
Query:

In general, for retrieval and reranking tasks:

  • use the prompt for queries
  • do not prepend the prompt to documents/passages

For symmetric tasks such as STS, clustering, and bitext mining, you can encode the documents either with or without prompts. The model is trained to support both scenarios.

MRL Support#

This model is trained with Matryoshka Representation Learning (MRL), allowing for a superior tradeoff between performance and embedding size. You can truncate the embeddings to keep only the first d dimensions to reduce storage and speed up vector search in downstream systems. The model is trained with a smallest Matryoshka dimension of 8.

Image: MRL results

Example:

embedding = embedding[..., :128]
embedding = torch.nn.functional.normalize(embedding, p=2, dim=-1)

Note: you need to apply normalization after trucation, not the other way around.

If you are using sentence transformer, you can also simply pass truncate_dim=128 to the encode interface.

Intermediate Checkpoints#

To facilitate future research, we release intermediate checkpoints in the intermediate_checkpoints branch.

Citation#

@misc{f2llm-v2,
      title={F2LLM-v2: Inclusive, Performant, and Efficient Embeddings for a Multilingual World}, 
      author={Ziyin Zhang and Zihan Liao and Hang Yu and Peng Di and Rui Wang},
      year={2026},
      eprint={2603.19223},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2603.19223}, 
}

Files

15 files · 683 MBWeights 669 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 15 files with their sha256
FileSizesha256
.gitattributes1.62 KBfa0726b1c69bd8c0d2bf717742be6df15ad063bf2a8a64dc9ee9f91a21dc1919
1_Pooling/config.json297 Bb1421741751435ec9ffad43749777ef1d329478c2a2b0683e0d345ae027aa1f2
README.md8.80 KB1e0e9b32426a5535faa6483b511ba2a5d74b2c5602cc6be23244d4bb2b57cd81
added_tokens.json707 Bc0284b582e14987fbd3d5a2cb2bd139084371ed9acbae488829a1c900833c680
config.json1.12 KBa5413b0656397cbc7d29311e853adc79bc6af28aa714107fe1d475ef01a64650
config_sentence_transformers.json224 B0d68b69297f1e04931794d6a0240334fc5fd3d6f0560b5bd904231864cd0aa7d
img/mrl.png217 KB300000f5166a2014ded58156e56aa4c323b3d8e5ffd3d6633096459e1c4679d3
img/performance.png1.26 MB8cd812ac2ec9e3ecf68b5ab6cf6594aecada48744072119c14d3b1b3f5f08ef4
merges.txt1.67 MB8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
model.safetensors669 MB459a6b5b335b90a9e7d9e58687c7b6bf1b55d9d83f799ab34ff51c2121a56318
modules.json385 B73348a3d8f8ae4cc5f851dc6b98be3ea819390b814e83656d5eebbadf75fe43e
special_tokens_map.json613 B76862e765266b85aa9459767e33cbaf13970f327a0e88d1c65846c2ddd3a1ecd
tokenizer.json8.40 MB7e295e5bb91a3d35335f92fa4294a6e4e0ab4aa586db853e14312a62135bfddc
tokenizer_config.json9.76 KB3c0884a30471f4f542dc89630f62a380bb70a341fafda826136a7be921fec7ea
vocab.json2.78 MBca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
de3ccdfa5c pinned now2026-11-15 03:22 UTC15 files · 683 MB

Use it

$ fw get codefuse-ai/F2LLM-v2-330M
# manifest sha256 3a3dbcd06b58… · 683 MB · 15 files
$ fw verify ./F2LLM-v2-330M codefuse-ai/F2LLM-v2-330M
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/codefuse-ai/F2LLM-v2-330M.json --dir ./F2LLM-v2-330M $ python3 fw.py verify ./F2LLM-v2-330M ./codefuse-ai__F2LLM-v2-330M.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download codefuse-ai/F2LLM-v2-330M --revision de3ccdfa5c7cd698e70f3161b8c211323ed41c15 --local-dir ./F2LLM-v2-330M
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("codefuse-ai/F2LLM-v2-330M", revision="de3ccdfa5c7cd698e70f3161b8c211323ed41c15") model = AutoModel.from_pretrained("codefuse-ai/F2LLM-v2-330M", revision="de3ccdfa5c7cd698e70f3161b8c211323ed41c15", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("codefuse-ai/F2LLM-v2-330M", revision="de3ccdfa5c7cd698e70f3161b8c211323ed41c15") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
1e0e9b32426a5535faa6483b511ba2a5d74b2c5602cc6be23244d4bb2b57cd81
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: codefuse-ai <huggingface.co/codefuse-ai>Newsgroups: alt.freeweights.embedSubject: F2LLM-v2-330MDate: 2026-11-15Commit: de3ccdfSigned: 2DC28CC7B26A283B ✓
Upstream
codefuse-ai/F2LLM-v2-330M
Pinned commit
de3ccdfa5c7cd698e70f3161b8c211323ed41c15
Manifest
F2LLM-v2-330M.json · .minisig
Manifest sha256
3a3dbcd06b5827d6c2b062583624e5614c6e5778b512e126f9b8ae7d5a154ffc
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:22 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/codefuse-ai/F2LLM-v2-330M.json $ curl -O https://freeweights.allternit.com/manifests/codefuse-ai/F2LLM-v2-330M.json.minisig $ minisign -Vm F2LLM-v2-330M.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

codefuse-ai/F2LLM-v2-0.6B-Preview-Pruned-330M (not in this catalog) · this model is a finetune of it

1 model in the catalog name this one as their parent.

Quantizations
1
Quantizations 1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download codefuse-ai/F2LLM-v2-330M
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. F2LLM-v2-330M.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of F2LLM-v2-330M. Each has its own license check and page.

From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-MiniLM-L6-v1
From: unsloth <huggingface.co/unsloth>Subject: all-MiniLM-L6-v2
From: mlx-community <huggingface.co/mlx-community>Subject: all-MiniLM-L6-v2-4bit
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: all-mpnet-base-v1
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: allenai-specter
From: sentence-transformers <huggingface.co/sentence-transformers>Subject: bert-base-nli-max-tokens