LLM VRAM Calculator
Will your local language model fit on one GPU? Estimate the memory for the model weights, the conversation cache and the runtime, then see which setting to change first.
Estimated GPU memory
- Total estimate
- Model weights
- Conversation cache (KV)
- Runtime reserve
- Free after estimate
Near limit means less than 0.75 GiB remains after the reserve. That is a planning buffer, not a runtime rule.
What measured runs show
In LeanLM's Ollama benchmark, Qwen2.5 7B Instruct at Q4_K_M peaked at 5.1 GiB at 4,096 context tokens and 6.8 GiB at 32,768 tokens. Both runs used full GPU offload with flash attention on one 96 GiB RTX PRO 6000. These are third-party measurements on that setup, not measurements on 8, 12 or 16 GiB cards, and not the Qwen3 preset above.
For a worked estimate, the Qwen3 8B preset gives about 6.25 GiB at 4,096 tokens. At 32,768 tokens it rises to 10.18 GiB, with the same weights and 1 GiB reserve. That is why lowering context can help when the weights alone already fit.
How this estimate works
Total = weights + KV cache + runtime reserve. For standard attention with uniform layer dimensions, this planner estimates the cache as 2 × layers × KV heads × head dimension × bytes per cache value × context tokens × simultaneous sessions. The factor of 2 is for keys and values. We convert bytes to GiB, where 1 GiB is 1,073,741,824 bytes; file hosts often display decimal GB instead.
The default weight size uses Qwen's Qwen3 8B Q4_K_M file listing; its layer and head values come from the official model configuration. Cache precision and weight quantization are separate settings. The 8-bit cache option is approximate, excludes block metadata and only applies if your runtime supports it.
This is a planning estimate for one fully offloaded GPU, not a guarantee. File size is only a proxy for resident weights. Allocators, batching and backend buffers can differ; sliding-window and hybrid models, CPU offload and multiple GPUs are not modeled. Use your runtime's configured context and stay below the model's supported context even when the memory estimate suggests more room.