Model reference · open weights

SmolLM3-ONNX

Available as managed deployment LLMs HuggingFaceTB Text gen 1 variants 214 dl/mo

SmolLM3-ONNX is an open-weight language model from HuggingFaceTB. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

MakerHuggingFaceTB
TypeLanguage models
TaskText gen
Context64k tokens
Runs withtransformers.js
Based onHuggingFaceTB/SmolLM3-3B
Released2025-07-08
Popularity214 downloads / month
LicenceOpen weights

About

What SmolLM3-ONNX is

Table of Contents

  1. Model Summary
  2. How to use
  3. Evaluation
  4. Training
  5. Limitations
  6. License

Model Summary

SmolLM3 is a 3B parameter language model designed to push the boundaries of small models. It supports 6 languages, advanced reasoning 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).

Key features

  • Instruct model optimized for hybrid reasoning
  • Fully open model: open weights + full training details including public data mixture and training configs
  • Long context: Trained on 64k context and suppots up to 128k tokens using YARN extrapolation
  • Multilingual: 6 natively supported (English, French, Spanish, German, Italian, and Portuguese)

For more details refer to our blog post: https://hf.co/blog/smollm3

How to use

Transformers.js

import { pipeline, TextStreamer } from "@huggingface/transformers";

// Create a text generation pipeline
const generator = await pipeline(
  "text-generation",
  "HuggingFaceTB/SmolLM3-3B-ONNX",
  { dtype: "q4f16", device: "webgpu" },
);

// Define the model inputs
const thinking = true; // Whether the model should think before answering
const messages = [
  {
    role: "system",
    content: "You are SmolLM, a language model created by Hugging Face."
      + (thinking ? "/think" : "/no_think")
  },
  { role: "user", content: "Solve the equation x^2 - 3x + 2 = 0" },
];

// Generate a response
const output = await generator(messages, {
  max_new_tokens: 1024,
  streamer: new TextStreamer(generator.tokenizer, { skip_prompt: true, skip_special_tokens: true }),
});
console.log(output[0].generated_text.at(-1).content);

ONNXRuntime

from transformers import AutoConfig, AutoTokenizer
import onnxruntime
import numpy as np
from huggingface_hub import hf_hub_download

# 1. Load config, processor, and model
model_id = "HuggingFaceTB/SmolLM3-3B-ONNX"
config = AutoConfig.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model_path = hf_hub_download(repo_id=model_id, filename="onnx/model_q4.onnx") # Download the graph
hf_hub_download(repo_id=model_id, filename="onnx/model_q4.onnx_data") # Download the model weights
decoder_session = onnxruntime.InferenceSession(model_path)

## Set config values
num_key_value_heads = config.num_key_value_heads
head_dim = config.hidden_size // config.num_attention_heads
num_hidden_layers = config.num_hidden_layers
eos_token_id = config.eos_token_id

# 2. Prepare inputs
messages = [
  { "role": "system", "content": "/no_think" },
  { "role": "user", "content": "What is the capital of France?" },
]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="np")
input_ids = inputs['input_ids']
attention_mask = inputs['attention_mask']
batch_size = input_ids.shape[0]
past_key_values = {
    f'past_key_values.{layer}.{kv}': np.zeros([batch_size, num_key_value_heads, 0, head_dim], dtype=np.float32)
    for layer in range(num_hidden_layers)
    for kv in ('key', 'value')
}
position_ids = np.tile(np.arange(0, input_ids.shape[-1]), (batch_size, 1))

# 3. Generation loop
max_new_tokens = 1024
generated_tokens = np.array([[]], dtype=np.int64)
for i in range(max_new_tokens):
  logits, *present_key_values = decoder_session.run(None, dict(
      input_ids=input_ids,
      attention_mask=attention_mask,
      position_ids=position_ids,
      **past_key_values,
  ))

  ## Update values for next generation loop
  input_ids = logits[:, -1].argmax(-1, keepdims=True)
  attention_mask = np.concatenate([attention_mask, np.ones_like(input_ids, dtype=np.int64)], axis=-1)
  position_ids = position_ids[:, -1:] + 1
  for j, key in enumerate(past_key_values):
    past_key_values[key] = present_key_values[j]

  generated_tokens = np.concatenate([generated_tokens, input_ids], axis=-1)
  if (input_ids == eos_token_id).all():
    break

  ## (Optional) Streaming
  print(tokenizer.decode(input_ids[0]), end='', flush=True)
print()

# 4. Output result
print(tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)[0])

Evaluation

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.

Instruction Model

No Extended Thinking

Evaluation results of non reasoning models and reasoning models in no thinking mode. We highlight the best and second-best scores in bold.

CategoryMetricSmoLLM3-3BQwen2.5-3BLlama3.1-3BQwen3-1.7BQwen3-4B
High school math competitionAIME 20259.32.90.38.017.1
Math problem-solvingGSM-Plus72.874.159.268.382.1
Competitive programmingLiveCodeBench v415.210.53.415.024.9
Graduate-level reasoningGPQA Diamond35.732.229.431.844.4
Instruction followingIFEval76.765.671.674.068.9
AlignmentMixEval Hard26.927.624.924.331.6
Tool CallingBFCL92.3-92.3 *89.595.0
Multilingual Q&AGlobal MMLU53.550.5446.849.565.1

(*): this is a tool calling finetune

Extended Thinking

Evaluation results in reasoning mode for SmolLM3 and Qwen3 models: | Category | Metric | SmoLLM3-3B | Qwen3-1.7B | Qwen3-4B | |--

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys smollm3-onnx for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (smollm3-onnx below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/chat/completions \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"smollm3-onnx","messages":[{"role":"user","content":"Hello"}]}'

Create an account — your API key is available in the console. 5M tokens/month currently included with every new account at launch.

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