Local LLM VRAM & Quantization Estimator
Model weight size is only half the story. Long context windows, KV cache precision, concurrent batches, and runtime overhead can quickly overflow GPU memory. Estimate exact VRAM usage, hardware fit, and memory-bandwidth-bound token speed.
- Model Weights
- –
- KV Cache
- –
- Runtime Overhead
- –
- Est. Gen Speed
- –
VRAM Breakdown vs Hardware Budget
All Quantizations Comparison
Click any quantization row button to apply it above. Speed estimates assume memory-bandwidth-bound single-user token generation (bandwidth × 0.78 ÷ active weights).
| Quantization | BPW | Weights (GB) | Total VRAM (GB) | Fit Verdict | Est. Speed |
|---|
How local LLM VRAM is calculated
Running a large language model locally in tools like llama.cpp, Ollama, LM Studio, or vLLM consumes GPU memory in three distinct buckets:
- Model weights: Determined by total parameter count multiplied by the average bits-per-weight (bpw) of the quantization format. For example, a 4-bit
Q4_K_Mquant averages ~4.85 bpw because sensitive layers (embeddings, output head, attention norms) stay at higher precision. - KV cache: Stores attention keys and values for every token in the active context window:
2 × layers × kv_heads × head_dim × context × batch × bytes_per_elem. Modern models use Grouped-Query Attention (GQA) or Multi-Head Latent Attention (MLA, as in DeepSeek-V3/R1) to drastically shrink KV cache size. - Runtime & compute buffers: CUDA, ROCm, or Metal kernels plus activation scratchpads typically add 0.8–1.5 GB on top of weights and KV cache.
Why memory bandwidth determines tokens per second
During single-user autoregressive text generation (decode), the GPU must read all active model weights from VRAM for every single token it generates. Compute (TFLOPS) is rarely the bottleneck at batch size 1; memory bandwidth is. Real-world inference engines typically sustain roughly 75–82% of peak theoretical memory bandwidth, which is why an RTX 5090 (1,792 GB/s) generates tokens dramatically faster than a 400 GB/s laptop or desktop GPU—and why Mixture-of-Experts (MoE) models like DeepSeek-V3 (671B total, 37B active) run much faster per token than a dense model of the same total size.
Tips for fitting larger models
- Quantize the KV cache: Switching KV cache from FP16 to Q8_0 cuts context memory in half with virtually zero perceptual quality loss.
- Stay at Q4_K_M or higher when possible: Going from Q4_K_M down to Q2_K saves VRAM, but reasoning and coding quality degrade rapidly below 4 bits.
- Watch macOS Unified Memory limits: By default, macOS reserves ~25% of unified RAM for the OS, leaving ~75% available as wired GPU memory unless raised via
sysctl iogpu.wired_limit_mb.