RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
Glossary / Training & optimization / Q4_K_M Quantization
Training & optimization

Q4_K_M Quantization

Q4_K_M is the most-downloaded GGUF quantization on Hugging Face — the default tradeoff for local inference. It mixes 6-bit precision on the most sensitive layers (attention output, FFN gate) with 4-bit elsewhere, plus a per-row importance matrix learned during conversion.

Per-parameter cost averages ~4.83 bits (not 4 — naive sizing under-predicts file size by ~20%). A 7B model is ~4.4 GB, a 13B is ~7.9 GB, a 70B is ~42 GB. Perplexity vs FP16 is typically 0.1–0.2 points — invisible in chat, slightly visible on coding/math benchmarks.

Use Q4_K_M as the default. Step up to Q5_K_M only with VRAM headroom; step down to Q3_K_M only when desperate.

Practical example

An operator wants to run Llama 3.1 8B on a 12 GB RTX 3060 with room left for KV cache at an 8K context window. FP16 would need ~16 GB — a nonstarter. Q4_K_M brings the weights to roughly 4.9 GB, leaving ~7 GB for context and OS overhead, comfortably inside the 12 GB budget. They pull the Q4_K_M.gguf from a Hugging Face repo, load it in llama.cpp or Ollama, and run a few prompts against the FP16 outputs side by side — the answers are indistinguishable for chat and summarization, with only minor wobble on multi-step arithmetic. That's the expected tradeoff: for anything short of a benchmark run or agentic coding pipeline, Q4_K_M is the format to reach for first, and only after confirming it fits do they consider Q5_K_M if VRAM allows.

Related terms

QuantizationGGUFQ5_K_M QuantizationQ3_K_M Quantization

See also

tool: llama-cpptool: ollamatool: lm-studio

Reviewed by Eruo Fredoline. See our editorial policy.

Buyer guides
  • Best GPU for local AI →
When it doesn't work
  • Quantization quality loss →
  • GGUF tokenizer mismatch →