LLM Quantization VRAM & Context Window Estimator (FP16 / Q8 / Q4)
Choose a model size, weight format, and context length to estimate memory for local inference and see which GPU capacities can fit it.
Model setup
Memory estimate
Enter valid model settings to see the estimate.
- Model weights
- KV cache
- Runtime overhead
Memory fit by device capacity
- 16 GB
- 24 GB
- 48 GB
- 80 GB
- 128 GB unified
“Tight fit” means under 10% headroom. Unified memory is shared with the OS and other apps.
Compare local GPU and cloud costs
Use the VRAM estimate to narrow your hardware options, then compare local hardware and running costs with cloud LLM spend in BudgetHub.
Method & FAQ
How are model weights estimated?
Weight memory is parameter count multiplied by effective bits per parameter, divided by 8. The estimator uses 16 bits for FP16 and BF16, 8.5 for Q8, 6.5625 for Q6_K, 4.8944 for Q4_K_M, and 3.996 for Q3. Mixed GGUF formats vary by model and tensor layout. llama.cpp quantization reference.
How is KV cache memory calculated?
KV bytes equal 2 × layers × KV heads × head dimension × context tokens × batch size × bytes per stored element. The factor of two counts keys and values. The calculation assumes full-context storage at every layer. For sliding-window, hybrid, or compressed attention, use your runtime’s actual cache allocation.
What does runtime overhead cover?
The estimate adds 1 GiB plus 10% of weights and KV cache as a planning allowance for runtime buffers and allocations. Actual headroom depends on backend, hardware, and workload. Estimates use GiB (1,073,741,824 bytes), while GPU labels use their marketed GB capacities.
Does a fit badge mean the model supports my context length?
A fit badge compares the estimate with a nominal device capacity. Check your model’s supported context, budget for other memory usage, and confirm runtime support for your chosen KV precision. Batch size is the number of concurrent sequences, each using the selected context.