Small Language Model (SLM) Comparison
Compare small, self-hostable LLMs by parameters, context window, license and modality — then enter your RAM or VRAM to see exactly which ones run on your machine. Every spec is cited to the official model card. No signup, no API keys.
How it works
The comparison data is a static table of hard facts read from each model's official Hugging Face card and config.json — parameter count, transformer layers, hidden size, context window, license and modality. The one thing the tool computes is the minimum memory to run, which is fully deterministic and reproducible by hand:
- Weights memory.
weights_GB = params_billions × bytes_per_param, where bytes-per-param is 2.0 for FP16, 1.0 for Q8_0, and 0.56 for Q4_K_M (the 4-bit k-quant runs at roughly 4.5 bits per weight including metadata). These are cross-checked against the actual file sizes published on each model's-GGUFrepository. - KV-cache memory.
kv_GB = 2 × n_layers × d_model × context_tokens × 2 / 1e9. The leading 2 counts one key and one value tensor; the trailing 2 is an FP16 cache. The layer count and hidden size come from each model's config. This term grows with the context you select — on the smallest models it can exceed the weights. - Runtime overhead. A fixed +1.0 GB for the runtime, activations and OS headroom, matching real-world llama.cpp and Ollama footprints.
- Estimate and fit.
min_memory_GB = ceil(weights_GB + kv_GB + 1.0). A model fits when this is at or below your available memory andthe model's own maximum window is at least the context you asked for.
The weights term is verified two independent ways — from bytes-per-param and from nominal bits-per-weight (÷8) — which agree to within about half a percent, so the estimate is not resting on a single magic number. The KV-cache formula uses the full hidden size with no grouped-query-attention reduction, which makes the figure a deliberate, safe over-estimate. It is meant for the “will it fit?” decision (±~10%), not for provisioning to the megabyte, and it says nothing about speed — throughput depends on your specific CPU or GPU.
Worked examples
Frequently asked questions
Sources & references
- Meta — Llama 3.2 3B model card & Llama 3.2 Community License
- Google — Gemma 3 4B model card (params, 128K context, multimodal)
- Google — Gemma Terms of Use (commercial-use conditions)
- Alibaba — Qwen3 model cards (Apache-2.0)
- Microsoft — Phi-4-mini-instruct model card (MIT)
- Hugging Face — SmolLM2 model cards (Apache-2.0)
- Mistral AI — Ministral 3B/8B & Mistral Research License
- IBM — Granite 3.3 model cards (Apache-2.0)
- TII — Falcon 3 model cards & TII Falcon LLM License 2.0
Every spec (parameters, layers, hidden size, context window, license, modality) was cross-checked against these official model cards and their config.json files on 2026-07-18. Open-weight model line-ups change fast; the table is reviewed as new small models ship. Found a stale figure? Email me and I'll fix it.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, a stale spec, or want another model added?
Email me at [email protected] — most fixes ship within 24 hours.