CoolFace
Modelpublic

cstr/F2LLM-v2-0.6B-ONNX-INT8-FULL

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes9downloads
Model Card

F2LLM-v2-0.6B — INT8-Full ONNX (MatMul + Gather quantized)

Full INT8-quantized ONNX of codefuse-ai/F2LLM-v2-0.6B. Smallest total file size (~600 MB) — both attention weights and the embedding table are quantized.

Quantization details

PropertyValue
Methodonnxruntime.quantization.quantize_dynamic
GranularityPer-tensor
Ops quantizedMatMul + Gather (embedding table also quantized)
OpStandard QLinearMatMul + QLinearGather
InputFP32 dynamo export (cstr/F2LLM-v2-0.6B-ONNX)
Dynamic batch✓ batch = 1, 2, 4, 8, …

Quantizing the Gather (embedding table) reduces the ~600 MB FP32 table to ~150 MB. This trades slight multilingual token quality for the smallest possible model footprint.

Model details

PropertyValue
Base modelcodefuse-ai/F2LLM-v2-0.6B
ArchitectureQwen3 decoder
Embedding dim1024
Max context32 768 tokens
PoolingLast-token pooling + L2 normalisation
File size~0.6 GB (model.int8_full.onnx + model.int8_full.onnx.data)

Inference

python
import onnxruntime as ort
import numpy as np
from tokenizers import Tokenizer

tokenizer = Tokenizer.from_file("tokenizer.json")
tokenizer.enable_padding(pad_id=0, direction="right")
tokenizer.enable_truncation(max_length=512)

session = ort.InferenceSession("model.int8_full.onnx", providers=["CPUExecutionProvider"])

texts = ["semantic search example", "another sentence"]
enc  = tokenizer.encode_batch(texts)
ids  = np.array([e.ids            for e in enc], dtype=np.int64)
mask = np.array([e.attention_mask for e in enc], dtype=np.int64)

lhs        = session.run(None, {"input_ids": ids, "attention_mask": mask})[0]
seq_lens   = mask.sum(axis=1) - 1
embeddings = lhs[np.arange(len(texts)), seq_lens]
norms      = np.linalg.norm(embeddings, axis=1, keepdims=True)
embeddings = embeddings / np.maximum(norms, 1e-8)
print(embeddings.shape)  # (2, 1024)

Variants

RepoPrecisionSizeNotes
cstr/F2LLM-v2-0.6B-ONNXFP322.4 GBReference
cstr/F2LLM-v2-0.6B-ONNX-INT8INT8 per-channel1.1 GBRecommended
cstr/F2LLM-v2-0.6B-ONNX-INT4INT4 MatMulNBits0.9 GBMinimum RAM
cstr/F2LLM-v2-0.6B-ONNX-INT8-FULLINT8 incl. embeddings0.6 GBThis repo — smallest file

Citation

bibtex
@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},
}

License

Apache 2.0 — same as codefuse-ai/F2LLM-v2-0.6B.

Provenance and EU AI Act Art. 53 note

  • Upstream model: codefuse-ai/F2LLM-v2-0.6B — published by codefuse-ai.
  • Upstream licence: apache-2.0. This repository redistributes under the same terms; it grants no rights the upstream licence does not.
  • What was done here: format conversion and/or quantisation only (ONNX, INT8 precision). No training, no fine-tuning, no merging, no distillation, no change to architecture, vocabulary or capability. Only the numeric representation of the upstream weights differs.
  • Training data: documented — where it is documented at all — by the upstream provider; see the upstream model card. No training data was used, added or selected by this repository.
  • Provider status: under Regulation (EU) 2024/1689 the upstream authors remain the provider of this model. Converting the serialisation format does not make this repository the provider of a new general-purpose AI model, and no such claim is made. Questions about training content, copyright policy or model capability belong upstream.