Direct answer: Start with Q4_K_M for almost every local LLM setup on laptops, consumer GPUs, and Apple Silicon — it cuts model weights nearly 4× compared to FP16 (~4.9 GB for 8B, ~42 GB for 70B) with only a ~1–2% perplexity cost and the fastest decode speed. Step up to Q5_K_M when you have extra RAM headroom and care about coding, math, or strict JSON accuracy. Use Q8_0 only when you have abundant memory (e.g., 128 GB Mac Studio) or need a near-lossless FP16 baseline for evaluation.
Want to size your exact hardware and context window? Try our free interactive LLM VRAM & Quantization Calculator, or join 13k+ ML engineers getting weekly serving deep dives on Machine Learning at Scale (Substack).
GGUF Q4_K_M vs Q5_K_M vs Q8_0 at a Glance
| Format | Effective Bits / Weight | 8B Model Weights | 70B Model Weights | Perplexity Impact | Relative Decode Speed | Best For |
|---|---|---|---|---|---|---|
| Q4_K_M | ~4.85 bits | ~4.9 GB | ~42 GB | Small (~1–2%) | Fastest (1.0×) | Default for 16–64 GB RAM & 24 GB GPUs |
| Q5_K_M | ~5.70 bits | ~5.7 GB | ~50 GB | Very low (<0.8%) | ~0.85× | Coding, math, structured extraction with headroom |
| Q8_0 | ~8.50 bits | ~8.5 GB | ~75 GB | Near-zero (<0.1%) | ~0.58× | Near-FP16 fidelity on 128 GB unified memory |
| FP16 (baseline) | 16.0 bits | ~16 GB | ~140 GB | 0% | ~0.32× | Cloud training / reference evaluation |
What Does the _K_M Suffix Actually Mean?
In llama.cpp, K-quants (like Q4_K_M and Q5_K_M) use mixed-precision block quantization rather than crushing every tensor to the exact same bit-width:
- Attention output (
wv,wo) and feed-forward down-projection layers are more sensitive to quantization noise, so_K_M("medium") automatically promotes those sensitive tensors to higher precision (6-bit inQ4_K_M, 6-bit/8-bit inQ5_K_M). _K_S("small") keeps almost all tensors at the base bit-width — saving a few percent of RAM at a noticeable accuracy penalty.Q8_0uses uniform 8-bit quantization in blocks of 32 weights with one FP16 scale per block. Because 8 bits already preserve nearly all dynamic range, mixed-precision promotion is unnecessary.
Why Bigger Model at Q4 Beats Smaller Model at Q8
One rule holds consistently across local LLM benchmarks: at the same memory budget, a larger model at Q4_K_M almost always beats a smaller model at Q8_0 or FP16.
For example, a 14B or 24B model at Q4_K_M (9–15 GB) dramatically outperforms an 8B model at 8.5 GB) on reasoning, code generation, and instruction following — even though both occupy a similar memory footprint. Only drop below Q8_0 (Q4_K_M (into Q3_K_M or Q2_K) as a last resort: below 4 bits, hallucination rates and instruction-following drift rise sharply.
Don't Forget the KV Cache
Weight size is only half the budget. Long contexts (32K–128K tokens) can easily consume 5–20+ GB of extra RAM/VRAM for the KV cache alone. In llama.cpp and Ollama, you can quantize the KV cache separately (-ctk q8_0 -ctv q8_0) to halve context memory without touching weights. Plug your exact model and context length into the LLM VRAM & Quantization Calculator to verify before downloading a 50 GB file.
When NOT to Use GGUF
GGUF shines for single-user local inference, CPU/Apple Silicon, and hybrid CPU+GPU offloading. If you are serving concurrent production users on cloud NVIDIA GPUs (L40S, A100, H100), skip GGUF and use FP8, AWQ, or GPTQ under vLLM or SGLang for continuous batching and Marlin CUDA kernels. See our head-to-head comparison: AWQ vs GPTQ and LLM Quantization: GPTQ vs AWQ vs GGUF.
Want weekly production ML & LLM serving breakdowns in your inbox? Subscribe free to Machine Learning at Scale on Substack.