Instructions to use sbussiso/SmolThinker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sbussiso/SmolThinker with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sbussiso/SmolThinker") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sbussiso/SmolThinker") model = AutoModelForCausalLM.from_pretrained("sbussiso/SmolThinker", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use sbussiso/SmolThinker with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf sbussiso/SmolThinker:Q4_K_M # Run inference directly in the terminal: llama cli -hf sbussiso/SmolThinker:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf sbussiso/SmolThinker:Q4_K_M # Run inference directly in the terminal: llama cli -hf sbussiso/SmolThinker:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf sbussiso/SmolThinker:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sbussiso/SmolThinker:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf sbussiso/SmolThinker:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sbussiso/SmolThinker:Q4_K_M
Use Docker
docker model run hf.co/sbussiso/SmolThinker:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use sbussiso/SmolThinker with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sbussiso/SmolThinker" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sbussiso/SmolThinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sbussiso/SmolThinker:Q4_K_M
- SGLang
How to use sbussiso/SmolThinker 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 "sbussiso/SmolThinker" \ --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": "sbussiso/SmolThinker", "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 "sbussiso/SmolThinker" \ --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": "sbussiso/SmolThinker", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use sbussiso/SmolThinker with Ollama:
ollama run hf.co/sbussiso/SmolThinker:Q4_K_M
- Unsloth Studio
How to use sbussiso/SmolThinker with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sbussiso/SmolThinker to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for sbussiso/SmolThinker to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sbussiso/SmolThinker to start chatting
- Docker Model Runner
How to use sbussiso/SmolThinker with Docker Model Runner:
docker model run hf.co/sbussiso/SmolThinker:Q4_K_M
- Lemonade
How to use sbussiso/SmolThinker with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sbussiso/SmolThinker:Q4_K_M
Run and chat with the model
lemonade run user.SmolThinker-Q4_K_M
List all available models
lemonade list
- Atomic Chat
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sbussiso/SmolThinker")
model = AutoModelForCausalLM.from_pretrained("sbussiso/SmolThinker", device_map="auto")SmolThinker
SmolLM2-1.7B-Instruct fine-tuned to emit its reasoning inside literal
<think> ... </think> blocks, so chat UIs that render collapsible reasoning
(Open WebUI, Ollama, LM Studio) display it as a proper thinking section rather
than dumping it into the answer.
Reasoning is deliberately brief, around three short lines. The goal is reliable tag emission and visible working, not long deliberation.
Output format
<think>
I need to subtract 305 from 701.
Break 305 into 300 and 5.
701 - 300 = 401.
401 - 5 = 396.
</think>
701 - 305 = 396.
Usage
llama-cli -hf sbussiso/SmolThinker --jinja
The --jinja flag matters. It uses the embedded ChatML template, which is what
the model was trained against.
For Ollama, ChatML turn format with both markers as stops:
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
Prompt format
ChatML, inherited from SmolLM2:
<|im_start|>system
You are a helpful AI assistant.<|im_end|>
<|im_start|>user
What is 47 + 68?<|im_end|>
<|im_start|>assistant
Works with or without a system prompt. Roughly 40% of training rows carried no system turn, so the template's injected default is in distribution; the rest used generic prompts naming no model.
Multi-turn works too. About 11% of training rows are 2 to 3 turn conversations where each follow-up depends on an earlier turn, so the model reads prior context rather than treating every message as fresh.
Training data
sbussiso/SmolThinker-Synthetic-Low-Reasoning, 2,593 rows.
| Source | Rows |
|---|---|
| Templated single-turn, 26 task families | 1,800 |
| Templated multi-turn | 200 |
| Hand-written single-turn | 514 |
| Hand-written multi-turn | 79 |
593 rows are authored individually rather than generated. 100% of assistant turns carry a think block, including greetings, so there is no example anywhere of answering without one.
Training configuration
LoRA adapter on a 16-bit base, trained with Unsloth Studio on a single NVIDIA L4.
method: LoRA (16-bit base)
num_epochs: 2
max_seq_length: 2048
learning_rate: 2e-4
lr_scheduler: linear
warmup_steps: 50
batch_size: 2
grad_accumulation: 4 # effective batch 8
optimizer: adamw_8bit
weight_decay: 0.001
packing: false
train_on_completions: true # loss on assistant turns only
random_seed: 3407
lora_r: 16
lora_alpha: 16
lora_dropout: 0
target_modules: q_proj k_proj v_proj o_proj gate_proj up_proj down_proj
614 steps, 762,325 tokens, 11m45s. Final training loss 0.639, final evaluation loss approximately 0.600, final gradient norm 0.414.
Why two epochs
Three runs were compared. At three epochs the model overfits: evaluation loss bottoms around step 591 and then climbs while training loss keeps falling.
| Run | Config | Final train loss | Final eval loss | Overfit |
|---|---|---|---|---|
| 1 | 3 epochs, rank 32 | 0.452 | ~0.645 | yes, 0.050 |
| 2 | 3 epochs, rank 16 | 0.517 | ~0.621 | yes, 0.030 |
| 3 | 2 epochs, rank 16 | 0.639 | ~0.600 | none |
Both three-epoch runs turned upward at the same step regardless of rank, so the cause was epoch count against a 2,453-row training split rather than adapter capacity. Run 3 is this release: higher training loss with the lowest evaluation loss, and a gradient norm that stays flat instead of climbing, which is what generalisation rather than memorisation looks like.
Design notes
The tags are ordinary text tokens, not special tokens. On the SmolLM2
tokenizer <think> is ['<', 'think', '>'] and </think> is
['</', 'think', '>'], tokenizing identically in every training row. This is
deliberate: registering them via add_special_tokens() would give them
untrained embeddings and, more importantly, skip_special_tokens=True on
decode would strip them from the output, which is the usual reason a reasoning
fine-tune produces correct reasoning with no visible tags. Qwen3 makes the same
choice, adding them to the vocab but marking them special=False.
embedding_learning_rate was left unset for the same reason: the tags are
ordinary tokens and the embedding layer does not need to move.
Evaluation
This release has not been evaluated yet. The numbers below are from the previous version, trained on v1 of the dataset, and are recorded here as the baseline this release is meant to beat rather than as a description of it.
| Suite | Previous version |
|---|---|
| Format compliance, well-formed | 70.0% |
| Format compliance, usable | 90.0% |
| Held-out accuracy | 88.3% |
The previous version emitted a spurious trailing </think> on 20% of
open-ended prompts and no think block at all on a further 5%, traced to every
training answer being a single short clause. The dataset was revised to address
that. Whether it worked is not yet measured.
This section will be replaced with measured results.
Limitations
Training data is largely templated and synthetic, so phrasing diversity in that portion is bounded and the task set is deliberately narrow. This teaches the shape of reasoning and reliable tag emission, not general reasoning ability. Expect arithmetic to degrade outside the ranges seen in training, and expect confident-looking traces on problems the model gets wrong.
The 593 hand-written rows are a finite set, so some memorisation of them is possible.
Not evaluated on GSM8K or any public benchmark, so there is no measurement of whether fine-tuning helped or harmed general math ability relative to the base model.
If you consume the output programmatically, strip any stray </think> after
the first closing tag rather than assuming exactly one.
Built with Unsloth.
- Downloads last month
- -
4-bit
Model tree for sbussiso/SmolThinker
Base model
HuggingFaceTB/SmolLM2-1.7B
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sbussiso/SmolThinker") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)