← Back to Blog
Model Optimization June 8, 2026 7 min read

Quantization Explained: Finding Pre-Quantized GGUFs vs. Quantizing Yourself

You've downloaded a model from HuggingFace and opened the file browser. There's a checkpoint. Then another. Then six more — same model name, slightly different numbers: Q4_K_M, Q8_0, IQ2_XXS, Q5_K_S. What are all these versions? They're all the same model, compressed to different degrees. This is quantization, and understanding it is the single most important skill for running local AI on hardware that doesn't have a data center's worth of VRAM.

What Is Quantization, Actually?

Neural networks are made of numbers — specifically, 32-bit floating-point numbers (FP32). A 7B-parameter model is 7 billion of these numbers, stored as model weights. At FP32, that's about 28 GB of data. A 70B model? 280 GB. Most consumer GPUs can't hold that much in VRAM.

Quantization reduces the precision of those numbers. Instead of 32 bits per weight, you store them in 4 bits, 3 bits, or even fewer. The result is dramatically smaller file sizes — a Q4 (4-bit) quant of a 7B model is about 4-5 GB instead of 28 GB.

There's a tradeoff: lower precision means slightly reduced quality. But here's the thing that surprised me when I first started — the quality loss between FP16 and Q4 is often barely noticeable for most tasks. The difference becomes significant mainly in complex reasoning tasks. For chat, writing, coding, and general assistance? You'll rarely tell the difference.

The GGUF Quantization Format Family

llama.cpp's GGUF format defines a spectrum of quantization levels. Here's the lineup you'll actually encounter:

Format Approximate Size (7B) Quality When to Use
FP16 ~14 GB Maximum Maximum quality, abundant VRAM, training/fine-tuning
Q8_0 ~7.7 GB Near-maximum When quality matters most and you have enough room
Q6_K ~5.8 GB Very high Sweet spot between quality and size
Q5_K_M ~4.9 GB High Excellent all-rounder, my default choice
Q5_0 ~5.0 GB High Slightly simpler than K-series, still great quality
Q4_K_M ~4.4 GB Good Most popular choice — best quality/size balance
Q4_0 ~4.3 GB Good Older format, simpler but less efficient than K-series
Q3_K_M ~3.4 GB Average When VRAM is tight but you still want decent quality
IQ2_XXS ~2.1 GB Low Extreme compression for constrained hardware

My rule of thumb: If you have the room, use Q5_K_M or Q4_K_M. If you're tight on VRAM, Q3_K_M or Q4_K_M. Avoid anything below Q3 unless you're on truly constrained hardware (under 4GB VRAM).

The Easiest Path: Pre-Quantized GGUFs

Before you even think about quantizing a model yourself, check whether someone has already done it. The HuggingFace GGUF ecosystem is massive, and the most popular models have pre-quantized versions from multiple contributors.

Trusted Quantization Repositories

  • TheBloke — The OG. If a model exists, TheBloke probably quantized it. His repos are the gold standard for GGUF availability.
  • Baskier — Specializes in high-quality quantizations, especially for newer models. Often the first to publish Q4_K_M and Q5_K_M versions.
  • Unsloth — A team focused on efficient fine-tuning, but their pre-quantized GGUFs are excellent. They also provide tools for custom quantization.
  • Martynov — Focuses on newer architectures and less common models.

To find a quantized model, go to HuggingFace and search for the model name plus "GGUF". For example, search "Qwen2.5 7B GGUF" and you'll find dozens of results from the repositories above.

My advice: Always download from a trusted source. The pre-quantized GGUF files are safe to use — they're just the model weights with reduced precision, no code or scripts involved. But stick with known repositories to avoid anything sketchy.

When Should You Quantize Yourself?

Sometimes the pre-quantized models you want aren't available. Maybe it's a brand-new model released today, or it's a custom fine-tune that nobody has quantized yet. That's when you roll up your sleeves.

Quantizing a model yourself requires:

  • The original model in a compatible format (usually a HuggingFace .bin or .safetensors file)
  • The llama.cpp quantization tools (included in the llama.cpp build)
  • Enough RAM to load the model temporarily during conversion

The command looks like this:

./llama-quantize \
  input-model.gguf \
  output-model-Q4_K_M.gguf \
  Q4_K_M

That's it. One command, one or two minutes, and you've got a quantized GGUF.

But here's the thing — for most models, someone has already done this. The pre-quantized GGUF ecosystem is so active that you'll rarely need to quantize yourself. I'd say only 10-15% of the time do I need to do it myself.

A Separate Topic: Custom Quantizing

Quantizing a model yourself is its own deep-dive topic, and it deserves a full blog post on its own. We'll cover things like:

  • Converting from PyTorch/transformers format to GGUF using llama-convert
  • Understanding the different quantization types (K-series vs. standard vs. IQ methods)
  • Choosing the right quantization level for your specific use case
  • Testing quantized models with perplexity benchmarks
  • Quantizing custom fine-tunes and LoRA adapters

Keep an eye out for that post — it's next on the list.

Performance Notes

Quantization affects two things: file size and inference quality. Speed is usually the same or slightly faster at lower quantization levels because less data needs to move through memory. The real impact is on quality:

  • Q4_K_M vs FP16: For most tasks, the difference is imperceptible. Chat, creative writing, code generation — you won't notice.
  • Q4_K_M vs Q8_0: Small quality difference. Q8_0 is marginally better at complex reasoning and nuanced instruction following.
  • Q3_K_M and below: You'll start noticing artifacts. The model may repeat itself, lose coherence, or ignore instructions more often.
  • IQ2 and below: These are for when you literally have no other choice. Quality suffers noticeably.

Pro tip: Test two quantization levels side by side. Download Q4_K_M and Q5_K_M versions of the same model, run the same prompts through both, and compare. You might find that Q4_K_M is perfectly fine for your use case — and the saved VRAM is worth more than the tiny quality difference.

Bottom Line

Start with pre-quantized GGUFs from trusted HuggingFace repositories. Unsloth, Baskier, TheBloke — these are your go-to sources. Choose Q4_K_M as your default, Q5_K_M if you have the VRAM to spare. Only quantize yourself when the model you want isn't available in the format you need.

Quantization isn't about finding the smallest file. It's about finding the right balance between quality and size for your specific hardware. And that balance is different for everyone. Experiment, test, and find your sweet spot.