Quantization Choices for Local LLMs: Q4_K_M vs Q5_K_M vs Q8_0
There is no universal best quantization format for local LLMs. Q4_K_M is the practical default for most users, Q5_K_M is the usual upgrade when Q4 quality feels…
TAGGED GUIDES
Explore the guides, ideas, and practical explanations in this topic.
26 published articlesThere is no universal best quantization format for local LLMs. Q4_K_M is the practical default for most users, Q5_K_M is the usual upgrade when Q4 quality feels…
The useful comparison is not CPU versus GPU in the abstract, but whether the model, its KV cache, and runtime overhead fit inside VRAM. A published layer…
Measure local model performance by tracking three numbers separately: prompt processing speed, generation speed, and peak memory. llama.cpp's llama-bench and Ollama's --verbose flag produce these figures directly,…
Comparing quantization levels on one model is a controlled experiment: change the quant, hold the runtime, context, and prompts constant, then measure memory footprint and task accuracy…
You can run a local language model without a GPU by using a small quantized model and a CPU-focused inference stack such as llama.cpp, Ollama, or LM…
A KV cache stores the key and value tensors for every token already in the sequence, at every attention layer, so the model does not reprocess the…
VRAM usage is not one number. Device-level tools such as nvidia-smi, per-process NVML queries, framework allocator stats, and breakdown tools like LLM Inspector each answer a different…
In llama.cpp, GPU layer offloading is controlled with -ngl, --gpu-layers, or --n-gpu-layers, which accepts an exact layer count, auto, or all. Ollama generally manages offloading automatically, so…
Model distillation trains a smaller student network to imitate a larger teacher, which makes it the only common compression technique that changes the architecture and requires a…
At 4-bit quantization, budget roughly 2 GB for a 3B model, 5 GB for a 7–8B model, 8 GB for a 13–14B model, and 40 GB for…
CUDA out of memory in local AI usually means weights, KV cache, and activations together exceed available VRAM. This guide gives a diagnostic order that starts with…
Quantization is a representation technique that stores weights at lower precision. QLoRA is a fine-tuning method that trains low-rank adapters on a frozen 4-bit base model. They…