Instructions to use HuggingFaceTB/SmolLM3-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolLM3-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM3-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM3-3B") model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM3-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceTB/SmolLM3-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolLM3-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HuggingFaceTB/SmolLM3-3B
- SGLang
How to use HuggingFaceTB/SmolLM3-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HuggingFaceTB/SmolLM3-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HuggingFaceTB/SmolLM3-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HuggingFaceTB/SmolLM3-3B with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolLM3-3B
test1
#21
by bsin - opened
- README.md +5 -29
- config.json +0 -1
README.md
CHANGED
|
@@ -10,8 +10,6 @@ language:
|
|
| 10 |
- zh
|
| 11 |
- ar
|
| 12 |
- ru
|
| 13 |
-
base_model:
|
| 14 |
-
- HuggingFaceTB/SmolLM3-3B-Base
|
| 15 |
---
|
| 16 |
|
| 17 |
|
|
@@ -41,7 +39,7 @@ The model is a decoder-only transformer using GQA and NoPE (with 3:1 ratio), it
|
|
| 41 |
### Key features
|
| 42 |
- Instruct model optimized for **hybrid reasoning**
|
| 43 |
- **Fully open model**: open weights + full training details including public data mixture and training configs
|
| 44 |
-
- **Long context:** Trained on 64k context and
|
| 45 |
- **Multilingual**: 6 natively supported (English, French, Spanish, German, Italian, and Portuguese)
|
| 46 |
|
| 47 |
For more details refer to our blog post: https://hf.co/blog/smollm3
|
|
@@ -198,7 +196,7 @@ text = tokenizer.apply_chat_template(
|
|
| 198 |
)
|
| 199 |
```
|
| 200 |
|
| 201 |
-
For local inference, you can use `llama.cpp`, `ONNX`, `MLX`
|
| 202 |
|
| 203 |
### vLLM and SGLang
|
| 204 |
|
|
@@ -358,35 +356,13 @@ The model has also been trained on Arabic (standard), Chinese and Russian data,
|
|
| 358 |
Here is an infographic with all the training details
|
| 359 |
- The datasets used for pretraining can be found in this [collection](https://huggingface.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9) and those used in mid-training and post-training will be uploaded later
|
| 360 |
- The training and evaluation configs and code can be found in the [huggingface/smollm](https://github.com/huggingface/smollm) repository.
|
| 361 |
-
- The training intermediate checkpoints (including the mid-training and SFT checkpoints) are available at [HuggingFaceTB/SmolLM3-3B-checkpoints](https://huggingface.co/HuggingFaceTB/SmolLM3-3B-checkpoints)
|
| 362 |
-

|
| 363 |
-
|
| 364 |
-
### EU Summary of Public Content
|
| 365 |
-
|
| 366 |
-
The EU AI Act requires all GPAI models to provide a Public Summary of Training Content according to a [given template](https://digital-strategy.ec.europa.eu/en/library/explanatory-notice-and-template-public-summary-training-content-general-purpose-ai-models).
|
| 367 |
-
You can find the summary for this model below, as well as in its [development Space](https://huggingface.co/spaces/hfmlsoc/smollm3-eu-data-transparency).
|
| 368 |
-
|
| 369 |
-
<iframe
|
| 370 |
-
src="https://hfmlsoc-smollm3-eu-data-transparency.hf.space"
|
| 371 |
-
frameborder="0"
|
| 372 |
-
width="850"
|
| 373 |
-
height="350"
|
| 374 |
-
></iframe>
|
| 375 |
|
|
|
|
| 376 |
|
| 377 |
## Limitations
|
| 378 |
|
| 379 |
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.
|
| 380 |
|
| 381 |
-
## License
|
| 382 |
-
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
| 383 |
|
| 384 |
-
##
|
| 385 |
-
|
| 386 |
-
@misc{bakouch2025smollm3,
|
| 387 |
-
title={{SmolLM3: smol, multilingual, long-context reasoner}},
|
| 388 |
-
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},
|
| 389 |
-
year={2025},
|
| 390 |
-
howpublished={\url{https://huggingface.co/blog/smollm3}}
|
| 391 |
-
}
|
| 392 |
-
```
|
|
|
|
| 10 |
- zh
|
| 11 |
- ar
|
| 12 |
- ru
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
|
|
|
|
| 39 |
### Key features
|
| 40 |
- Instruct model optimized for **hybrid reasoning**
|
| 41 |
- **Fully open model**: open weights + full training details including public data mixture and training configs
|
| 42 |
+
- **Long context:** Trained on 64k context and suppots up to **128k tokens** using YARN extrapolation
|
| 43 |
- **Multilingual**: 6 natively supported (English, French, Spanish, German, Italian, and Portuguese)
|
| 44 |
|
| 45 |
For more details refer to our blog post: https://hf.co/blog/smollm3
|
|
|
|
| 196 |
)
|
| 197 |
```
|
| 198 |
|
| 199 |
+
For local inference, you can use `llama.cpp`, `ONNX`, `MLX` and `MLC`. You can find quantized checkpoints in this collection (https://huggingface.co/collections/HuggingFaceTB/smollm3-686d33c1fdffe8e635317e23)
|
| 200 |
|
| 201 |
### vLLM and SGLang
|
| 202 |
|
|
|
|
| 356 |
Here is an infographic with all the training details
|
| 357 |
- The datasets used for pretraining can be found in this [collection](https://huggingface.co/collections/HuggingFaceTB/smollm3-pretraining-datasets-685a7353fdc01aecde51b1d9) and those used in mid-training and post-training will be uploaded later
|
| 358 |
- The training and evaluation configs and code can be found in the [huggingface/smollm](https://github.com/huggingface/smollm) repository.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
|
| 360 |
+

|
| 361 |
|
| 362 |
## Limitations
|
| 363 |
|
| 364 |
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.
|
| 365 |
|
|
|
|
|
|
|
| 366 |
|
| 367 |
+
## License
|
| 368 |
+
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
CHANGED
|
@@ -100,7 +100,6 @@
|
|
| 100 |
"rope_scaling": null,
|
| 101 |
"rope_theta": 5000000.0,
|
| 102 |
"sliding_window": null,
|
| 103 |
-
"tie_word_embeddings": true,
|
| 104 |
"torch_dtype": "bfloat16",
|
| 105 |
"transformers_version": "4.54.0.dev0",
|
| 106 |
"use_cache": false,
|
|
|
|
| 100 |
"rope_scaling": null,
|
| 101 |
"rope_theta": 5000000.0,
|
| 102 |
"sliding_window": null,
|
|
|
|
| 103 |
"torch_dtype": "bfloat16",
|
| 104 |
"transformers_version": "4.54.0.dev0",
|
| 105 |
"use_cache": false,
|