Downloads · 30 days
75
16% of all-time downloads
xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw
SmolLM3-3B-trellis-3inst-3bpw is a text generation model from xv0y5ncu. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
GLQ (3.0 bits/weight) quantization of HuggingFaceTB/SmolLM3-3B using a trellis-coded codebook (QTIP TCQ) + randomized Hadamard transform (RHT) + LDLQ. Weights stay compressed in memory and are decoded on the fly by a…
Downloads · 30 days
75
16% of all-time downloads
All-time downloads
464
Public
Parameters
792M
1.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.6 GB · 99%
How the weights are stored.
I16527M · 67%
From the Hugging Face model README
GLQ (3.0 bits/weight) quantization of HuggingFaceTB/SmolLM3-3B using a trellis-coded codebook (QTIP TCQ) + randomized Hadamard transform (RHT) + LDLQ. Weights stay compressed in memory and are decoded on the fly by a fused CUDA kernel.
Where GLQ shines: the size-vs-accuracy win is strongest at 2–4 bits/weight. For even more headroom, combine it with the E8 KV cache (≈4× smaller KV cache → longer context in the same VRAM).
HuggingFaceTB/SmolLM3-3B3inst variant) + RHT + LDLQ — 3.0 bpw uniform (native trellis rate — one decode pass, no residual stacking)python -m venv .venv
source .venv/bin/activate
pip install 'glq[vllm]'
Requires
glq >= 0.7.0— this checkpoint stores the trellis in the kernel (MMA-fragment) layout that the lookup-free 3INST CUDA kernels consume.
from vllm import LLM, SamplingParams
def main():
llm = LLM(
model="xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw",
quantization="glq",
dtype="bfloat16",
max_model_len=4096,
)
out = llm.generate(["The capital city of New Zealand is"],
SamplingParams(max_tokens=64, temperature=0))
print(out[0].outputs[0].text)
# The __main__ guard is REQUIRED when running this as a script. vLLM switches to the
# "spawn" multiprocessing start method once CUDA is initialised, so its worker processes
# re-import this file; without the guard the script spawns itself recursively and dies
# with "An attempt has been made to start a new process before the current process has
# finished its bootstrapping phase" — before the model ever loads.
if __name__ == "__main__":
main()
glq registers with vLLM automatically via its plugin entry point — no extra import needed.
import glq.hf_integration # registers the GLQ quantization method
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw", device_map="cuda", dtype=torch.bfloat16)
tok = AutoTokenizer.from_pretrained("xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw")
msgs = [{"role": "user", "content": "What is the capital city of New Zealand?"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to("cuda")
print(tok.decode(model.generate(ids, max_new_tokens=64)[0][ids.shape[1]:], skip_special_tokens=True))
Serve an OpenAI-compatible endpoint, then point your agent at it:
vllm serve xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw --port 8000
pi-code — ~/.pi/agent/models.json:
{
"providers": {
"glq": {
"baseUrl": "http://localhost:8000/v1",
"api": "openai-completions",
"apiKey": "glq",
"models": [
{
"id": "xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw"
}
]
}
}
}
opencode — ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"glq": {
"npm": "@ai-sdk/openai-compatible",
"name": "GLQ (local vLLM)",
"options": {
"baseURL": "http://localhost:8000/v1",
"apiKey": "glq"
},
"models": {
"xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw": {
"name": "SmolLM3-3B-trellis-3inst-3bpw"
}
}
}
}
}
GLQ also ships an E8-quantized KV cache (~4× smaller than fp16, ~bit-identical at 4-bit). Enable it at serve time:
GLQ_KV_QUANT=e8_relaxed:2 \
GLQ_KV_E8_SIDECAR=1 GLQ_KV_E8_SIDECAR_READ=1 GLQ_KV_E8_COMPRESSED_ALLOC=1 \
GLQ_KV_E8_FUSED_GATHER=1 GLQ_KV_E8_FUSED_WRITE=1 \
vllm serve xv0y5ncu/SmolLM3-3B-trellis-3inst-3bpw
e8_relaxed:2 ≈ 4-bit KV, :1 ≈ 2-bit, :3 ≈ 6-bit. This is the part of GLQ that keeps paying off above 4-bit weights.
| Benchmark | Metric | GLQ 3bpw |
|---|---|---|
| wikitext2_ppl | perplexity (n=128) | 9.5901 (bf16 9.1071) |
Single-run measurements; small-n results are noisy estimates. Setup details per row.
A randomized Hadamard transform (a fixed random sign-flip + Hadamard rotation on each side) makes the weights and the calibration Hessian incoherent — spreading outliers so they quantize well. LDLQ then rounds the weights with error feedback across the remaining input dimensions via the Hessian's LDL factorization. Instead of a per-group lattice codebook, GLQ here uses trellis-coded quantization (TCQ, from QTIP): each 16×16 weight tile is encoded as a tail-biting Viterbi sequence over a dimension-256 trellis code, reaching a higher effective quantization dimension than an 8-D lattice at the same bit-rate. Decoding is a small look-up plus a few arithmetic ops per weight; a fused CUDA kernel keeps the weights compressed in VRAM and decodes them inline.
The "Golay/Leech" in the project name refers to the lattice codebooks GLQ also ships (E8 and its higher-dimensional cousins). Code, kernels and quantizer: GLQ on GitHub.

SmolLM3 is a 3B parameter language model designed to push the boundaries of small models. It supports dual mode reasoning, 6 languages and long context. SmolLM3 is a fully open model that offers strong performance at the 3B–4B scale.

The model is a decoder-only transformer using GQA and NoPE (with 3:1 ratio), it was pretrained on 11.2T tokens with a staged curriculum of web, code, math and reasoning data. Post-training included midtraining on 140B reasoning tokens followed by supervised fine-tuning and alignment via Anchored Preference Optimization (APO).
For more details refer to our blog post: https://hf.co/blog/smollm3
The modeling code for SmolLM3 is available in transformers v4.53.0, so make sure to upgrade your transformers version. You can also load the model with the latest vllm which uses transformers as a backend.
pip install -U transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "HuggingFaceTB/SmolLM3-3B"
device = "cuda" # for GPU usage or "cpu" for CPU usage
# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
).to(device)
# prepare the model input
prompt = "Give me a brief explanation of gravity in simple terms."
messages_think = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages_think,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# Generate the output
generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
# Get and decode the output
output_ids = generated_ids[0][len(model_inputs.input_ids[0]) :]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
[!TIP] We recommend setting
temperature=0.6andtop_p=0.95in the sampling parameters.
The current config.json is set for context length up to 65,536 tokens. To handle longer inputs (128k or 256k), we utilize YaRN you can change the max_position_embeddings and rope_scaling` to:
{
...,
"rope_scaling": {
"factor": 2.0, #2x65536=131 072
"original_max_position_embeddings": 65536,
"type": "yarn"
}
}
We enable extended thinking by default, so the example above generates the output with a reasoning trace. For choosing between enabling, you can provide the /think and /no_think flags through the system prompt as shown in the snippet below for extended thinking disabled. The code for generating the response with extended thinking would be the same except that the system prompt should have /think instead of /no_think.
prompt = "Give me a brief explanation of gravity in simple terms."
messages = [
{"role": "system", "content": "/no_think"},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
We also provide the option of specifying the whether to use extended thinking through the enable_thinking kwarg as in the example below. You do not need to set the /no_think or /think flags through the system prompt if using the kwarg, but keep in mind that the flag in the system prompt overwrites the setting in the kwarg.
prompt = "Give me a brief explanation of gravity in simple terms."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=False
)
SmolLM3 supports tool calling! Just pass your list of tools:
xml_tools for standard tool-calling: these tools will be called as JSON blobs within XML tags, like <tool_call>{"name": "get_weather", "arguments": {"city": "Copenhagen"}}</tool_call>python_tools: then the model will call tools like python functions in a <code> snippet, like <code>get_weather(city="Copenhagen")</code>from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "HuggingFaceTB/SmolLM3-3B"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(checkpoint)
tools = [
{
"name": "get_weather",
"description": "Get the weather in a city",
"parameters": {"type": "object", "properties": {"city": {"type": "string", "description": "The city to get the weather for"}}}}
]
messages = [
{
"role": "user",
"content": "Hello! How is the weather today in Copenhagen?"
}
]
inputs = tokenizer.apply_chat_template(
messages,
enable_thinking=False, # True works as well, your choice!
xml_tools=tools,
add_generation_prompt=True,
tokenize=True,
return_tensors="pt"
)
outputs = model.generate(inputs)
print(tokenizer.decode(outputs[0]))
You can specify custom instruction through the system prompt while controlling whether to use extended thinking. For example, the snippet below shows how to make the model speak like a pirate while enabling extended thinking.
prompt = "Give me a brief explanation of gravity in simple terms."
messages = [
{"role": "system", "content": "Speak like a pirate./think"},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
For local inference, you can use llama.cpp, ONNX, MLX, MLC and ExecuTorch. You can find quantized checkpoints in this collection (https://huggingface.co/collections/HuggingFaceTB/smollm3-686d33c1fdffe8e635317e23)
You can use vLLM and SGLang to deploy the model in an API compatible with OpenAI format.
python -m sglang.launch_server --model-path HuggingFaceTB/SmolLM3-3B
vllm serve HuggingFaceTB/SmolLM3-3B --enable-auto-tool-choice --tool-call-parser=hermes
chat_template_kwargsYou can specify chat_template_kwargs such as enable_thinking to a deployed model by passing the chat_template_kwargs parameter in the API request.
curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "HuggingFaceTB/SmolLM3-3B",
"messages": [
{"role": "user", "content": "Give me a brief explanation of gravity in simple terms."}
],
"temperature": 0.6,
"top_p": 0.95,
"max_tokens": 16384,
"chat_template_kwargs": {"enable_thinking": false}
}'
In this section, we report the evaluation results of SmolLM3 model. All evaluations are zero-shot unless stated otherwise, and we use lighteval to run them.
We highlight the best score in bold and underline the second-best score.
Evaluation results of non reasoning models and reasoning models in no thinking mode. We highlight the best and second-best scores in bold.
| Category | Metric | SmoLLM3-3B | Qwen2.5-3B | Llama3.1-3B | Qwen3-1.7B | Qwen3-4B |
|---|---|---|---|---|---|---|
| High school math competition | AIME 2025 | <u>9.3</u> | 2.9 | 0.3 | 8.0 | 17.1 |
| Math problem-solving | GSM-Plus | 72.8 | <u>74.1</u> | 59.2 | 68.3 | 82.1 |
| Competitive programming | LiveCodeBench v4 | <u>15.2</u> | 10.5 | 3.4 | 15.0 | 24.9 |
| Graduate-level reasoning | GPQA Diamond | <u>35.7</u> | 32.2 | 29.4 | 31.8 | 44.4 |
| Instruction following | IFEval | 76.7 | 65.6 | 71.6 | <u>74.0</u> | 68.9 |
| Alignment | MixEval Hard | 26.9 | <u>27.6</u> | 24.9 | 24.3 | 31.6 |
| Tool Calling | BFCL | <u>92.3</u> | - | <u>92.3</u> * | 89.5 | 95.0 |
| Multilingual Q&A | Global MMLU | <u>53.5</u> | 50.54 | 46.8 | 49.5 | 65.1 |
(*): this is a tool calling finetune
Evaluation results in reasoning mode for SmolLM3 and Qwen3 models:
| Category | Metric | SmoLLM3-3B | Qwen3-1.7B | Qwen3-4B |
|---|---|---|---|---|
| High school math competition | AIME 2025 | <u>36.7</u> | 30.7 | 58.8 |
| Math problem-solving | GSM-Plus | <u>83.4</u> | 79.4 | 88.2 |
| Competitive programming | LiveCodeBench v4 | 30.0 | <u>34.4</u> | 52.9 |
| Graduate-level reasoning | GPQA Diamond | <u>41.7</u> | 39.9 | 55.3 |
| Instruction following | IFEval | 71.2 | <u>74.2</u> | 85.4 |
| Alignment | MixEval Hard | 30.8 | <u>33.9</u> | 38.0 |
| Tool Calling | BFCL | <u>88.8</u> | <u>88.8</u> | 95.5 |
| Multilingual Q&A | Global MMLU | <u>64.1</u> | 62.3 | 73.3 |
Note: All evaluations are zero-shot unless stated otherwise. For Ruler 64k evaluation, we apply YaRN to the Qwen models with 32k context to extrapolate the context length.
| Category | Metric | SmolLM3-3B | Qwen2.5-3B | Llama3-3.2B | Qwen3-1.7B-Base | Qwen3-4B-Base |
|---|---|---|---|---|---|---|
| Reasoning & Commonsense | HellaSwag | 76.15 | 74.19 | <u>75.52</u> | 60.52 | 74.37 |
| ARC-CF (Average) | 65.61 | 59.81 | 58.58 | 55.88 | <u>62.11</u> | |
| Winogrande | 58.88 | 61.41 | 58.72 | 57.06 | <u>59.59</u> | |
| CommonsenseQA | <u>55.28</u> | 49.14 | 60.60 | 48.98 | 52.99 | |
| Knowledge & Understanding | MMLU-CF (Average) | <u>44.13</u> | 42.93 | 41.32 | 39.11 | 47.65 |
| MMLU Pro CF | <u>19.61</u> | 16.66 | 16.42 | 18.04 | 24.92 | |
| MMLU Pro MCF | <u>32.70</u> | 31.32 | 25.07 | 30.39 | 41.07 | |
| PIQA | 78.89 | 78.35 | <u>78.51</u> | 75.35 | 77.58 | |
| OpenBookQA | 40.60 | 40.20 | <u>42.00</u> | 36.40 | 42.40 | |
| BoolQ | 78.99 | 73.61 | <u>75.33</u> | 74.46 | 74.28 | |
| Math & Code | ||||||
| Coding & math | HumanEval+ | 30.48 | 34.14 | 25.00 | <u>43.29</u> | 54.87 |
| MBPP+ | 52.91 | 52.11 | 38.88 | <u>59.25</u> | 63.75 | |
| MATH (4-shot) | <u>46.10</u> | 40.10 | 7.44 | 41.64 | 51.20 | |
| GSM8k (5-shot) | 67.63 | <u>70.13</u> | 25.92 | 65.88 | 74.14 | |
| Long context | ||||||
| Ruler 32k | 76.35 | 75.93 | <u>77.58</u> | 70.63 | 83.98 | |
| Ruler 64k | <u>67.85</u> | 64.90 | 72.93 | 57.18 | 60.29 | |
| Ruler 128k | 61.03 | <u>62.23</u> | 71.30 | 43.03 | 47.23 |
| Category | Metric | SmolLM3 3B Base | Qwen2.5-3B | Llama3.2 3B | Qwen3 1.7B Base | Qwen3 4B Base |
|---|---|---|---|---|---|---|
| Main supported languages | ||||||
| French | MLMM Hellaswag | 63.94 | 57.47 | 57.66 | 51.26 | <u>61.00</u> |
| Belebele | 51.00 | <u>51.55</u> | 49.22 | 49.44 | 55.00 | |
| Global MMLU (CF) | <u>38.37</u> | 34.22 | 33.71 | 34.94 | 41.80 | |
| Flores-200 (5-shot) | 62.85 | 61.38 | <u>62.89</u> | 58.68 | 65.76 | |
| Spanish | MLMM Hellaswag | 65.85 | 58.25 | 59.39 | 52.40 | <u>61.85</u> |
| Belebele | 47.00 | <u>48.88</u> | 47.00 | 47.56 | 50.33 | |
| Global MMLU (CF) | <u>38.51</u> | 35.84 | 35.60 | 34.79 | 41.22 | |
| Flores-200 (5-shot) | <u>48.25</u> | 50.00 | 44.45 | 46.93 | 50.16 | |
| German | MLMM Hellaswag | 59.56 | 49.99 | 53.19 | 46.10 | <u>56.43</u> |
| Belebele | <u>48.44</u> | 47.88 | 46.22 | 48.00 | 53.44 | |
| Global MMLU (CF) | <u>35.10</u> | 33.19 | 32.60 | 32.73 | 38.70 | |
| Flores-200 (5-shot) | 56.60 | 50.63 | <u>54.95</u> | 52.58 | 50.48 | |
| Italian | MLMM Hellaswag | 62.49 | 53.21 | 54.96 | 48.72 | <u>58.76</u> |
| Belebele | <u>46.44</u> | 44.77 | 43.88 | 44.00 | 48.78 | |
| Global MMLU (CF) | <u>36.99</u> | 33.91 | 32.79 | 35.37 | 39.26 | |
| Flores-200 (5-shot) | <u>52.65<u/> | 54.87 | 48.83 | 48.37 | 49.11 | |
| Portuguese | MLMM Hellaswag | 63.22 | 57.38 | 56.84 | 50.73 | <u>59.89</u> |
| Belebele | 47.67 | 49.22 | 45.00 | 44.00 | 50.00 | |
| Global MMLU (CF) | <u>36.88</u> | 34.72 | 33.05 | 35.26 | 40.66 | |
| Flores-200 (5-shot) | <u>60.93</u> | 57.68 | 54.28 | 56.58 | 63.43 |
The model has also been trained on Arabic (standard), Chinese and Russian data, but has seen fewer tokens in these languages compared to the 6 above. We report the performance on these langages for information.
| Category | Metric | SmolLM3 3B Base | Qwen2.5-3B | Llama3.2 3B | Qwen3 1.7B Base | Qwen3 4B Base |
|---|---|---|---|---|---|---|
| Other supported languages | ||||||
| Arabic | Belebele | 40.22 | 44.22 | <u>45.33</u> | 42.33 | 51.78 |
| Global MMLU (CF) | 28.57 | 28.81 | 27.67 | <u>29.37</u> | 31.85 | |
| Flores-200 (5-shot) | <u>40.22</u> | 39.44 | 44.43 | 35.82 | 39.76 | |
| Chinese | Belebele | 43.78 | 44.56 | <u>49.56</u> | 48.78 | 53.22 |
| Global MMLU (CF) | 36.16 | 33.79 | <u>39.57</u> | 38.56 | 44.55 | |
| Flores-200 (5-shot) | 29.17 | 33.21 | 31.89 | 25.70 | <u>32.50</u> | |
| Russian | Belebele | <u>47.44</u> | 45.89 | <u>47.44</u> | 45.22 | 51.44 |
| Global MMLU (CF) | <u>36.51</u> | 32.47 | 34.52 | 34.83 | 38.80 | |
| Flores-200 (5-shot) | 47.13 | 48.74 | 50.74 | <u>54.70</u> | 60.53 |
Here is an infographic with all the training details

The EU AI Act requires all GPAI models to provide a Public Summary of Training Content according to a given template. You can find the summary for this model below, as well as in its development Space.
<iframe src="https://hfmlsoc-smollm3-eu-data-transparency.hf.space" frameborder="0" width="850" height="350" ></iframe>SmolLM3 can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.
@misc{bakouch2025smollm3,
title={{SmolLM3: smol, multilingual, long-context reasoner}},
author={Bakouch, Elie and Ben Allal, Loubna and Lozhkov, Anton and Tazi, Nouamane and Tunstall, Lewis and Patiño, Carlos Miguel and Beeching, Edward and Roucher, Aymeric and Reedi, Aksel Joonas and Gallouédec, Quentin and Rasul, Kashif and Habib, Nathan and Fourrier, Clémentine and Kydlicek, Hynek and Penedo, Guilherme and Larcher, Hugo and Morlon, Mathieu and Srivastav, Vaibhav and Lochner, Joshua and Nguyen, Xuan-Son and Raffel, Colin and von Werra, Leandro and Wolf, Thomas},
year={2025},
howpublished={\url{https://huggingface.co/blog/smollm3}}
}
</details>
Derivative work of HuggingFaceTB/SmolLM3-3B, quantized with GLQ. It inherits the base model's license (apache-2.0) — please respect the base model's terms.