Text Generation
PyTorch
ExecuTorch
Transformers
optimum-executorch
smollm3
smollm
conversational
torchao
Instructions to use pytorch/SmolLM3-3B-INT8-INT4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pytorch/SmolLM3-3B-INT8-INT4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pytorch/SmolLM3-3B-INT8-INT4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("pytorch/SmolLM3-3B-INT8-INT4") model = AutoModelForCausalLM.from_pretrained("pytorch/SmolLM3-3B-INT8-INT4", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pytorch/SmolLM3-3B-INT8-INT4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pytorch/SmolLM3-3B-INT8-INT4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pytorch/SmolLM3-3B-INT8-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/pytorch/SmolLM3-3B-INT8-INT4
- SGLang
How to use pytorch/SmolLM3-3B-INT8-INT4 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 "pytorch/SmolLM3-3B-INT8-INT4" \ --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": "pytorch/SmolLM3-3B-INT8-INT4", "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 "pytorch/SmolLM3-3B-INT8-INT4" \ --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": "pytorch/SmolLM3-3B-INT8-INT4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use pytorch/SmolLM3-3B-INT8-INT4 with Docker Model Runner:
docker model run hf.co/pytorch/SmolLM3-3B-INT8-INT4
Commit History
-
Update README.md
Verified signature6ac5a61 -
Upload pytorch_model.bin with huggingface_hub
Verified signature467664a -
Upload config.json with huggingface_hub
Verified signatured83ed77 -
Rename smollm3-3b-INT8-INT4.pte to model.pte
Verified signature1c25305 -
Delete pytorch_model.bin
Verified signature3351cc3 -
Delete config.json
Verified signature69f1da8
-
Rename smollm3-3b-8da4w.pte to smollm3-3b-INT8-INT4.pte
Verified signaturec343cac -
Update README.md
Verified signatured74ab45
-
Update README.md (#1)
Verified signature- Update README.md (96711fffe9f06b7fae38105f992f9d7a4d5effce) Co-authored-by: Scott Roy <metascroy@users.noreply.huggingface.co>b096517
-
Update README.md
Verified signature3f61c4f -
Updated metrics
Verified signatureb95dc25 -
Update README.md
Verified signature70cb0a9
-
Update README.md
Verified signature29330a6 -
Updated model card
Verified signatureeefecce -
Update README.md
Verified signature270fc88 -
Update README.md
Verified signature7a22694
-
Update README.md
Verified signature2c5f2ad -
More metrics update
Verified signatured50e425 -
More quality results
Verified signature3b45b2f -
Updated with model quality (partial)
Verified signatureadde4e0
-
Add quant recipe
Verified signature125d167 -
Upload tokenizer
Verified signaturee9c5df5 -
Upload SmolLM3ForCausalLM
Verified signature21f1f24
-
Update README.md
Verified signaturee2ab3a1 -
Fix links
Verified signatureb65f2aa -
Updated model card
Verified signature008afd2 -
Update README.md
Verified signature7095ff6 -
Update README.md
Verified signaturede19084 -
Attach ExecuTorch model file and tokenizer to run on-device
Verified signature3b8fdc4 -
initial commit
Verified signaturee656a58