Instructions to use tbrrss/SmolLM2-135M-Distilled-Q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="tbrrss/SmolLM2-135M-Distilled-Q4", filename="smollm2-135m-distilled-q4.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tbrrss/SmolLM2-135M-Distilled-Q4 # Run inference directly in the terminal: llama-cli -hf tbrrss/SmolLM2-135M-Distilled-Q4
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf tbrrss/SmolLM2-135M-Distilled-Q4 # Run inference directly in the terminal: llama-cli -hf tbrrss/SmolLM2-135M-Distilled-Q4
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 tbrrss/SmolLM2-135M-Distilled-Q4 # Run inference directly in the terminal: ./llama-cli -hf tbrrss/SmolLM2-135M-Distilled-Q4
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 tbrrss/SmolLM2-135M-Distilled-Q4 # Run inference directly in the terminal: ./build/bin/llama-cli -hf tbrrss/SmolLM2-135M-Distilled-Q4
Use Docker
docker model run hf.co/tbrrss/SmolLM2-135M-Distilled-Q4
- LM Studio
- Jan
- vLLM
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tbrrss/SmolLM2-135M-Distilled-Q4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tbrrss/SmolLM2-135M-Distilled-Q4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tbrrss/SmolLM2-135M-Distilled-Q4
- Ollama
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with Ollama:
ollama run hf.co/tbrrss/SmolLM2-135M-Distilled-Q4
- Unsloth Studio new
How to use tbrrss/SmolLM2-135M-Distilled-Q4 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 tbrrss/SmolLM2-135M-Distilled-Q4 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 tbrrss/SmolLM2-135M-Distilled-Q4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tbrrss/SmolLM2-135M-Distilled-Q4 to start chatting
- Docker Model Runner
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with Docker Model Runner:
docker model run hf.co/tbrrss/SmolLM2-135M-Distilled-Q4
- Lemonade
How to use tbrrss/SmolLM2-135M-Distilled-Q4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tbrrss/SmolLM2-135M-Distilled-Q4
Run and chat with the model
lemonade run user.SmolLM2-135M-Distilled-Q4-{{QUANT_TAG}}List all available models
lemonade list
SmolLM2-135M-Distilled-Q4
An experimental ~85MB quantized language model distilled from SmolLM2-1.7B-Instruct into SmolLM2-135M.
Try a live demo in your browser, uses wllama.
Details
- Teacher:
SmolLM2-1.7B-Instruct - Student:
SmolLM2-135M-Instruct - Training data: ~50K responses from smoltalk (smol-magpie-ultra, apigen-80k, smol-constraints, openhermes-100k, and smol-summarize)
- Method: Response-level knowledge distillation + GGUF Q2_K quantization (fell back to ~Q4_0 because of 576-dim alignment)
- Effective quantization: ~5.14 bits/ weight
Usage
llama-cli -m smollm2-135m-distilled-q4.gguf -p "The weather in London is usually" -n 256 --temp 0
Limitations
- Well below the instruction-following threshold โ generates somewhat coherent text
- Does not reliably follow output format constraints
- Basic math accuracy is unreliable
- Possibly useable for text completion and topic detection, but not structured tasks
Notes
This represents my first attempt at distillation and quantization using RunPod (A40). It is intentionally experimental. Official BitNet materials cautions that models below 3B parameters will be less accurate than full-precision ones. This was a quick proof-of-concept to see how small you could go. Future experiments might yield better results with a higher parameter count and training ternary models from scratch, rather than post-training quantized models.
License
Apache 2.0 (same as SmolLM2)
- Downloads last month
- 11
We're not able to determine the quantization variants.
Model tree for tbrrss/SmolLM2-135M-Distilled-Q4
Base model
HuggingFaceTB/SmolLM2-135M