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

KV cache architecture

Presets use representative attention geometry. Use your model config when you know its layers, KV heads, and head dimension.

Example loaded · 8B, Q4_K_M, 8K context, batch 1.

Memory estimate

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.

Explore 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.