Q4_K_M vs Q5_K_M (q4km vs q5km): Which to Download? (2026)
Stuck between q4km and q5km? Verdict: start with Q4_K_M on 8–24GB cards; move to Q5_K_M only if it still fits with KV-cache headroom. The 5-minute VRAM check inside.
TL;DR
- q4km and q5km are informal spellings of GGUF quants Q4_K_M and Q5_K_M. For most local LLM loads on a single consumer GPU, start with Q4_K_M.
- Move to Q5_K_M only when you still have VRAM after weights plus KV cache. If Q5 forces layers back to CPU, you often lose more quality and speed than you gain.
- Q4_K_M is the default local quant for a reason: it is usually the best balance of file size and usable quality on 8-24 GB cards.
- Prefer the smaller quant that stays fully on GPU. Check weight size for Q4_K_M and Q5_K_M against free VRAM after OS and cache.
Short answer: q4km and q5km are informal spellings of GGUF quants Q4_K_M and Q5_K_M. For most local LLM loads on a single consumer GPU, start with Q4_K_M. Move to Q5_K_M only when you still have VRAM after weights plus KV cache.
What do people mean by q4km vs q5km?
Search and chat often drop the underscores: q4km, q5km, q8. In llama.cpp and Ollama file names the real tags are Q4_K_M, Q5_K_M, and Q8_0 (or close cousins like Q5_K_S). Same decision: size vs quality vs speed under a fixed VRAM budget.
When should you pick Q4_K_M?
Pick Q4_K_M when:
- You want the model to load fully without CPU fallback.
- You still need context headroom for the KV cache.
- You care more about tokens/sec than the last few quality points.
Q4_K_M is the default local quant for a reason: it is usually the best balance of file size and usable quality on 8-24 GB cards.
When should you pick Q5_K_M?
Pick Q5_K_M when:
- Q4_K_M already fits with clear headroom.
- You see quality issues on coding or long-form tasks at Q4.
- You measured that Q5 still keeps full GPU offload at your context length.
If Q5 forces layers back to CPU, you often lose more quality (and speed) than you gain from the higher quant.
How do you decide in five minutes?
- Note GPU VRAM and target context length.
- Open quant compare and VRAM calculator.
- Check weight size for Q4_K_M and Q5_K_M against free VRAM after OS and cache.
- Prefer the smaller quant that stays fully on GPU.
For the full matrix (Q4/Q5/Q6/Q8, K_S vs K_M, and edge cases), read the long guide: GGUF Q4_K_M vs Q5_K_M vs Q8. For offload flags once the file fits, see llama.cpp --n-gpu-layers.
Accompanying prompt
What the prompt does: It turns your GPU VRAM, context length, and two GGUF file sizes into a Q4_K_M vs Q5_K_M pick with a hard pass/fail.
Copy/paste this prompt:
Copy-ready prompt
Paste the exact block into your coding agent.
No article chrome, no footnotes, no formatting drift.
This prompt and every other one we publish live in the free prompt library.
Copy the block above.
Weekly measured local runs: https://bmdpat.com/5090-reports
FAQ
What do people mean by q4km vs q5km?
Search and chat often drop the underscores. In llama.cpp and Ollama file names the real tags are Q4_K_M, Q5_K_M, and Q8_0 or close cousins like Q5_K_S.
When should you pick Q4_K_M?
When you want the model to load fully without CPU fallback, you still need context headroom for the KV cache, and you care more about tokens/sec than the last few quality points.
When should you pick Q5_K_M?
When Q4_K_M already fits with clear headroom, you see quality issues on coding or long-form tasks at Q4, and you measured that Q5 still keeps full GPU offload at your context length.
Get the Local AI Field Kit
Four copy-ready tools now, then one evidence-backed Local AI Lab Note on Friday when there is something worth sharing.
Try the free agent run check firstGet the requested artifact now, then at most one evidence-backed Local AI Lab Note on Friday when there is something worth sharing. One-click unsubscribe. No sponsored placements. Privacy.
Patrick Hughes
I build BMD and publish measured AI runs, failure reports, and reusable checks. Nashville, Tennessee.
More writing
- 6 min
My 8B Model Failed a 400-Word Task
Three Llama 3.1 8B runs missed a 400-word floor. Here is the verifier-driven route that moved long-form synthesis to Gemma 4 26B.
- 5 min
3 Tests Before a GGUF Quant Runs Your Coding Agent
A GGUF file fitting in VRAM does not prove it can run your coding agent. Use this local acceptance test for tools, patches, and repeat runs.
- 5 min
49W Average Hid a 338W Burst on Gemma 26B
Gemma 4 26B Q4_K_M averaged 49 W on a long RTX 5090 run and peaked at 338 W. Keep both watt numbers before you compute energy per token.
- 5 min
A 7 GB 27B Model Lost to My 17 GB Default
A 6.66 GiB ternary 27B model fit my RTX 5090, but it lost the default slot. File size is only the first local model-selection gate.
- 5 min
Will That Local Model Fit? Do the VRAM Math First
A local LLM needs about half a gigabyte of VRAM per billion parameters at Q4, then KV cache and context stack on top. Here is how to know a model fits before you download 40 GB.