Instructions to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF 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 jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
Use Docker
docker model run hf.co/jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
- Ollama
How to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF with Ollama:
ollama run hf.co/jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF with Docker Model Runner:
docker model run hf.co/jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
- Lemonade
How to use jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
SmolLM2-1.7B β Scheduled QAT (Linear Schedule) β GGUF
GGUF quantized versions of SmolLM2-1.7B, trained with Scheduled Quantization-Aware Training (linear bit-width reduction schedule) before quantization.
Key insight: Unlike naive Post-Training Quantization (PTQ), these weights were specifically trained to survive quantization. During training, precision was gradually reduced from FP32 β FP16 β INT8 β INT4 following a linear schedule, allowing the model to adapt its weights to quantization noise at each stage.
Files
| Filename | Quant | Size | BPW | Description |
|---|---|---|---|---|
smollm2-1.7b-sched-qat-linear-Q4_K_M.gguf |
Q4_K_M | ~1.0 GB | 4.93 | Recommended β best quality/size ratio for edge deployment |
smollm2-1.7b-sched-qat-linear-Q8_0.gguf |
Q8_0 | ~1.7 GB | 8.50 | Higher quality, larger size |
Training Details
| Parameter | Value |
|---|---|
| Base model | HuggingFaceTB/SmolLM2-1.7B |
| Method | Scheduled QAT (Linear bit-width reduction) |
| Training data | WikiText-103 (4000 sequences Γ 512 tokens) |
| Hardware | Kaggle TPU v5e-8 (8 cores) |
| Epochs | 1 |
| Effective batch size | 64 (4 per-core Γ 2 grad accum Γ 8 cores) |
| Learning rate | 2e-5 (cosine decay) |
| Optimizer | AdamW (weight_decay=0.01) |
| Training time | ~1150 seconds |
Bit-Width Schedule
Epoch: 0.0 ββββ 0.1 ββββββββββββ 0.9 ββββ 1.0
Bits: FP32 β Linear β INT4
(warmup) β 32β16β8β4 β (stabilize)
| Phase | Epoch Range | Bit-width |
|---|---|---|
| Warmup | 0.0 β 0.1 | FP32 (no quantization noise) |
| Linear reduction | 0.1 β 0.9 | 32 β 16 β 8 β 4 (gradual) |
| Stabilization | 0.9 β 1.0 | INT4 (final fine-tuning) |
QAT Training Results (WikiText-103 Test)
| Metric | Value |
|---|---|
| Test loss | 3.0392 |
| Test perplexity | 20.89 |
How It Works
- Training (QAT): Model weights are trained with fake quantization nodes that simulate INT4 rounding noise in every forward pass. The gradients learn to place weights near quantization grid points.
- Export (this repo): The QAT-hardened bf16 weights are converted to GGUF format and quantized to actual INT4/INT8 using
llama.cpp'sllama-quantize. - Deployment: The GGUF files run directly on edge devices via
llama.cppβ Android, iOS, Raspberry Pi.
Because QAT pre-adapted the weights for quantization, these GGUF files should retain more quality than naively quantized (PTQ) versions of the same model.
Usage
With llama.cpp CLI
# Download
wget https://huggingface.co/jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF/resolve/main/smollm2-1.7b-sched-qat-linear-Q4_K_M.gguf
# Run
./llama-cli -m smollm2-1.7b-sched-qat-linear-Q4_K_M.gguf \
-p "The future of artificial intelligence is" -n 100
With llama-cpp-python
from llama_cpp import Llama
llm = Llama(model_path="smollm2-1.7b-sched-qat-linear-Q4_K_M.gguf")
output = llm("The future of AI is", max_tokens=100)
print(output["choices"][0]["text"])
Related
- bf16 weights (pre-quantization): jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-INT4
- Base model: HuggingFaceTB/SmolLM2-1.7B
Citation
This model is part of a thesis on Scheduled Quantization-Aware Training for Small Language Models targeting edge deployment.
License
Apache 2.0 (same as base model)
- Downloads last month
- 14
4-bit
8-bit
Model tree for jpcurada/SmolLM2-1.7B-Scheduled-QAT-Linear-GGUF
Base model
HuggingFaceTB/SmolLM2-1.7B