Instructions to use HuggingFaceTB/SmolLM3-3B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceTB/SmolLM3-3B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceTB/SmolLM3-3B-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM3-3B-Base") model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM3-3B-Base", device_map="auto") - Transformers.js
How to use HuggingFaceTB/SmolLM3-3B-Base with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'HuggingFaceTB/SmolLM3-3B-Base'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceTB/SmolLM3-3B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceTB/SmolLM3-3B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceTB/SmolLM3-3B-Base
- SGLang
How to use HuggingFaceTB/SmolLM3-3B-Base 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-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceTB/SmolLM3-3B-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceTB/SmolLM3-3B-Base with Docker Model Runner:
docker model run hf.co/HuggingFaceTB/SmolLM3-3B-Base
Commit History
-
Update README.md
Verified signatured78a42f -
Update README.md
Verified signaturef164213
-
Update README.md (#6)
Verified signature- Update README.md (41dd628d6902f1e93887ba2b978d0b0a29cf86e1)5ba230f
-
Update README.md
Verified signature5835396
-
Adding notebook.ipynb for showing inference using Colab (#4)
Verified signature- Adding notebook.ipynb for showing inference using Colab (5b2a8d51b8808a2d9b6dfaa3a67317fd3932284e) Co-authored-by: Sergio Paniego <sergiopaniego@users.noreply.huggingface.co>4dafe82
-
Update README.md
Verified signature01580ef -
Update README.md
Verified signaturec07119c -
Update README.md
Verified signature52a727b -
no bos token
Verified signature3cb3cd8 -
Update README.md
Verified signature731db12 -
Update README.md
Verified signature44077b3 -
Update README.md
Verified signature035e4ab -
Update README.md
Verified signaturee627cfb -
Update README.md
Verified signatured86ab9f -
Update README.md
Verified signatured37c9b9 -
Update README.md
Verified signatureb6b408d -
Upload folder using huggingface_hub (#1)
Verified signature- Upload folder using huggingface_hub (8f4f77c0fcba2306b6a8604a778dbdd3cf0107f7) - Add Transformers.js config (a231a73ce1e2762d56c5ad780cd9d9d75badebc4) - Update README.md (a41b3eda419a8ae869d3596ee4e2425da85ce850) Co-authored-by: Joshua <Xenova@users.noreply.huggingface.co>9707749
-
Update README.md
Verified signature6c1f398 -
Update README.md
Verified signature8e09a45 -
Update README.md
Verified signaturef5c1855 -
Update README.md
Verified signatured5bc3db -
Update README.md
Verified signatureea89fd7 -
Update README.md
Verified signature27b5dbe -
Update README.md
Verified signaturedee4608 -
Update README.md
Verified signature0ff8759 -
Update README.md
Verified signature951e73c -
Update README.md
Verified signature107d923 -
Update README.md
Verified signature7804fff
-
Update config.json
Verified signature29f385e
-
Update config.json
Verified signaturee5f8bd2
-
Upload tokenizer
Verified signature5730a3c -
Upload SmolLM3ForCausalLM
Verified signature0547a12 -
initial commit
Verified signature39969b7