🧠 VRAM Requirement Calculator

Estimate the GPU VRAM required to run local LLMs like Llama 3, Mistral, Mixtral, Gemma 2, and Qwen2 at FP16, INT8, or INT4 quantization, including KV cache overhead, and get a recommended GPU tier for your setup.

🧠 Model & Config
8,192 tok
📈 VRAM Estimate
Total VRAM Required
Base Model VRAM
KV Cache (approx.)
Parameters
Bytes / Parameter
Recommended GPU Tier
Overhead Factor
1.2×
VRAM Needed by Quantization (this model)
⚠️ Base VRAM = params(B) × bytes/param × 1.2 overhead factor. KV cache is approximated as params(B) × 0.00025 × (context/1000) × batch size — actual KV cache size depends on the model's layer count, attention heads, and head dimension, so treat this as an estimate, not an exact figure.
📊

Enter your details and click Calculate to see results

Guide

About the VRAM Calculator

Running a large language model locally requires enough GPU VRAM to hold both the model's weights and the working memory it needs during inference. Get this wrong and the model either won't load at all or will run painfully slowly by offloading to system RAM. This calculator estimates total VRAM requirements for popular open models — Llama 3, Llama 3.1, Mistral, Mixtral, Gemma 2, Qwen2, and Phi-3 — at different quantization levels, and maps the result to a recommended consumer or data-center GPU tier.

How It Works

Select a preset model (or enter a custom parameter count), choose a quantization level (FP16/BF16, INT8, or INT4), and set your expected context length and batch size. The calculator computes base VRAM as parameter count (in billions) × bytes per parameter for the chosen quantization × a 1.2 overhead factor that accounts for CUDA kernels, activation buffers, and memory fragmentation beyond the raw weights. It then estimates KV cache size — the memory used to store attention keys and values for every token in context — using the approximation params(B) × 0.00025 × (context/1000) × batch size, and adds base VRAM plus KV cache for a total, which it maps to a recommended GPU tier from RTX 4060 up to multi-GPU/cloud clusters.

Why It Matters

Quantization is the single biggest lever for fitting a large model onto affordable hardware — dropping from FP16 to INT4 cuts memory needs by roughly 4x, often the difference between needing a multi-GPU cluster and running comfortably on a single consumer card, at some cost to output quality depending on the quantization method. KV cache is easy to overlook but becomes a major factor for long-context or high-concurrency serving, since it scales with both context length and batch size — a model that fits comfortably for single-user chat may run out of memory serving many concurrent long-context requests.

Tips for Accurate Results

  • Always leave headroom above the estimated total — real-world inference frameworks (vLLM, llama.cpp, TensorRT-LLM) have their own memory management overhead beyond this calculator's 1.2× multiplier.
  • If you plan to serve multiple concurrent users, increase batch size to see how quickly KV cache requirements grow — this is often the most underestimated part of a deployment plan.
  • INT4 quantization can noticeably affect output quality for some models and tasks — validate accuracy on your specific use case before committing to the smallest quantization tier purely for VRAM savings.
  • Mixture-of-experts models like Mixtral count total parameters for storage (all experts must be loaded), even though only a subset activates per token — VRAM sizing should always use total parameter count.
  • If your total VRAM requirement exceeds what a single GPU offers, compare rental costs for multi-GPU cloud setups using our GPU Cost Calculator rather than assuming a purchase is the only option.
About

Understanding VRAM Sizing

🔢

Bytes per Parameter

FP32 uses 4 bytes/parameter, FP16/BF16 uses 2 bytes, INT8 uses 1 byte, and INT4 uses 0.5 bytes. Lower precision means less memory but potentially reduced output quality — INT8 and well-tuned INT4 are usually good tradeoffs.

📚

KV Cache Scaling

KV cache memory grows with both context length and batch size. Long-context or high-concurrency serving can require far more VRAM for KV cache than for the model weights themselves — always factor it into capacity planning.

🖥️

Matching Hardware to Models

Consumer cards (RTX 4060–4090) suit smaller quantized models; data-center cards (A100, H100 80GB) suit large models at higher precision. Multi-GPU setups or cloud rental become necessary once a single card's VRAM is exceeded.

FAQ

Frequently Asked Questions

Common questions about VRAM and local LLM hosting

How much VRAM does Llama 3 70B need?
At FP16, Llama 3 70B needs roughly 168GB of VRAM for weights alone (70B × 2 bytes × 1.2 overhead), which requires multiple 80GB GPUs. At INT8 it drops to roughly 84GB, and at INT4 it drops to roughly 42GB, which fits on a single 48GB card like an A6000, plus additional KV cache depending on context length and batch size.
What does the 1.2× overhead factor account for?
Raw model weights are only part of what occupies VRAM. Framework overhead, CUDA kernels, activation buffers, and memory fragmentation typically add roughly 15-25% on top of the raw weight size. This calculator uses a 1.2× (20%) multiplier as a reasonable rule-of-thumb estimate — actual overhead varies by inference framework and settings.
Why does quantization reduce VRAM so much?
Quantization reduces the number of bits used to store each model parameter. FP32 uses 4 bytes/parameter, FP16/BF16 uses 2 bytes, INT8 uses 1 byte, and INT4 uses 0.5 bytes. Going from FP16 to INT4 cuts memory requirements by 4x, though it can introduce a small accuracy trade-off.
What is KV cache and why does it grow with context length?
The KV (key-value) cache stores intermediate attention data for every token in the context so the model doesn't recompute it on each new token. Its size grows roughly linearly with context length and batch size. This calculator's formula is an approximation; actual usage depends on the model's architecture.
Can I run a model that needs more VRAM than my GPU has?
If the model doesn't fit in a single GPU's VRAM, options include using multiple GPUs with tensor/pipeline parallelism, offloading some layers to system RAM (much slower), using a more aggressive quantization like INT4, or renting cloud GPU capacity — see our GPU Cost Calculator to compare rental prices for larger cards.

Related Calculators

Explore other AI & infrastructure tools