✨ 🆕 llama.cpp feature changed how you can quantize local AI models.
Instead of choosing Q3, Q4, or Q5, you can now tell it exactly how large you want your model to be.
Got a 24GB GPU? Want a model that occupies 21GB?
🎯llama.cpp can automatically figure out how to squeeze the most quality into that space.
This is a new feature merged into llama.cpp on November 23, available in build b12669.
Benches ...
🔥 93% of comparisons matched or beat standard quantization
🧪 238 tests
🧠 34 different models
How? Normally, when quantizing a model, you choose a quant like ...
🟢 Q3_K_M
🟢 Q4_K_M
🟢 Q5_K_M
🟢 Q6_K
... and each produces a different file size, with different levels of precision.
But what if Q3 wastes available VRAM, while Q4 is just a little too large to fit?
Now you can specify your own target ....
💻 12GB GPU → Target a smaller model file
💻 16GB GPU → Use more of your available memory
💻 24GB GPU → Choose a size like 21 GiB
💻 32GB GPU → Customize the size for your workload
The quantizer analyzes the model's tensors and automatically allocates more bits to those where precision matters most.
Instead of applying a fixed quantization recipe, it optimizes the mix of precisions to meet your specified size budget while minimizing estimated quantization error.
You can even specify an exact bits-per-weight target.
Two new options ...
🔧 --target-size 21g
🔧 --target-bpw 4.5
⚠️ This isn't an automatic download option. You create a new GGUF from high-precision model weights using llama-quantize and an importance matrix generated with llama-imatrix.
Results? Across 238 tests on 34 models, the developer reports that this approach produced equal or lower quantization error than standard quantization in 93% of comparisons.
There is a trade-off.
The optimization process can take 5–10× longer than conventional quantization, although its calculations can be saved and reused.
And remember, the model file isn't the entire VRAM requirement. You still need room for the KV cache and runtime overhead.
This could be especially useful when every last gigabyte of VRAM matters.
Links in ALT
