How Much VRAM Do You Need to Run Quantized LLMs Locally? A Complete Guide
A practical guide to estimating VRAM requirements for local LLM deployment. Learn how model weights, KV cache, and runtime overhead add up, which GPU tiers fit which model sizes, and how to avoid common memory pitfalls.
Why VRAM Estimation Is the First Hurdle in Local Deployment
When deploying large language models locally, the first problem most people hit isn’t inference speed—it’s running out of VRAM: the model crashes with an out-of-memory (OOM) error halfway through loading, or it starts but collapses as soon as the context gets a bit longer.
The root cause is often misleading information. Official documentation usually quotes the theoretical size of weights at full precision (BF16/FP16), which only reflects “how large the model file is.” Real inference adds runtime overhead from the inference framework, the KV cache, activation buffers, and CUDA/driver contexts. For users planning to run quantized versions, official figures are of very limited reference value.
This article takes the following approach: first break down what actually consumes VRAM and provide a reusable estimation method, then give hardware recommendations by tier, and finally cover common pitfalls.
What Actually Consumes VRAM
A full inference pass consumes VRAM in roughly four parts:
1. Model weights
This is the biggest chunk. A simple estimation formula:
Weight VRAM ≈ parameter count × bytes per parameter
Bytes per parameter for common precisions:
- BF16 / FP16: 2 bytes
- INT8 (Q8): ~1 byte
- INT4 (Q4): ~0.5 bytes, plus a small amount of extra space for quantization scale factors
Take an 8B (8-billion-parameter) model: about 16GB at BF16, about 8GB at INT8, and about 4–5GB at INT4. This is why quantization is the key technology for running LLMs on consumer hardware—it cuts the VRAM threshold to roughly a quarter of the original.
Note that quantization is not lossless. 4-bit quantization has acceptable quality loss on most general tasks, but on complex math reasoning, code generation, and long multi-turn conversations, the gap can widen. For quality-sensitive applications, use at least Q8 or higher precision for A/B comparison.
2. KV cache
During autoregressive generation, frameworks cache the Key/Value states to avoid recomputing attention over history for every token. Its size scales linearly with context length:
KV Cache ≈ 2 × layers × KV heads × head dimension × sequence length × bytes per element × batch size
This formula explains a very common failure mode: people pick a model that barely fits in VRAM based on weights alone—it runs fine with short contexts, then blows up the moment the context reaches 32K or even 128K. Longer contexts mean larger KV caches, which is especially painful for long-document analysis and large codebase comprehension. Some models use techniques like grouped-query attention (GQA) to compress the KV cache, but that’s a model-architecture-level optimization—you can’t assume every model benefits from it when estimating.
3. Activations and runtime overhead
The inference framework itself, intermediate operator results, and batching buffers typically add another 1–3GB, depending on the framework, batch size, and whether optimizations like Flash Attention are enabled. Rule of thumb: reserve at least 20–30% headroom on top of the weight estimate.
4. System and display context
The OS, desktop environment, and display output also take a share of VRAM. On an 8GB-class GPU, only about 6.5–7GB is actually available for inference—factor this discount into your hardware selection.
How Much VRAM Different Model Sizes Need
Applying the formulas above to common model sizes (based on mainstream 4-bit quantization, including runtime overhead) yields a practical reference table:
| Model size | VRAM after quantization | Recommended hardware tier | Best for |
|---|---|---|---|
| 2B lightweight models | ~2–4GB | Integrated graphics or entry-level 4GB GPUs | Validating a minimal working pipeline; embedded and edge scenarios |
| 4–8B models | ~4–8GB | 6–8GB GPUs or 16GB unified-memory devices | Most people’s first local deployment experience |
| 8–14B models | ~8–14GB | 12–16GB GPUs | Stronger local reasoning while keeping decent speed |
| 30B dense models | ~20–24GB | 24GB+ flagship GPUs | High demands on quality, code, and long context |
| 30B sparse-activation MoE | ~16–20GB | 16–24GB tier | Large-model quality on a limited VRAM budget |
A note on sparse-activation MoE (Mixture of Experts) architectures: these models have very large total parameter counts but activate only a small subset of parameters per token, so inference speed can approach that of a much smaller model—but all weights still need to be loaded into VRAM. In other words, MoE saves compute, not memory—a very common misconception. When choosing hardware, estimate VRAM from total parameters and speed from active parameters.
Hardware Recommendations by GPU Tier
4GB entry-level GPUs / integrated graphics
Stick to 2B lightweight models. The goal at this tier isn’t quality—it’s working through the full “download → quantize → load → infer” pipeline to build experience for future upgrades.
6–8GB GPUs
4-bit quantized 4–8B models are a solid starting point. Larger models aren’t completely off the table—some frameworks support offloading some layers to system memory (CPU offload)—but offloading significantly slows generation, usually making it “runs” rather than “usable.” Always leave headroom for context and runtime; never select hardware at the absolute limit.
12–16GB GPUs
This is the sweet spot for consumer deployment. Quantized 10–14B models are worth a serious try, and 30B-class MoE models are also within reach. Don’t stop at “does it launch”—measure actual tokens/s. Interactive conversation generally needs at least 10 tokens/s to feel usable; below that, the experience lags noticeably.
24GB and above
30B-class dense models can be fully loaded, with both quality and speed assured. Even at this tier, though, long contexts significantly increase VRAM usage—stress-test your target workload’s maximum context length rather than judging by short conversations alone.
A practical stress-testing approach:
# VRAM usage estimation sketch (pseudocode)def estimate_vram(params_b, bits, ctx_tokens):weight_gb = params_b * bits / 8 # weightskv_gb = 0.5 * (ctx_tokens / 8192) # KV cache, rough empirical estimateruntime_gb = 1.5 # runtime overheadreturn weight_gb + kv_gb + runtime_gb# Example: 8B model, 4-bit quantization, 32K contextprint(estimate_vram(8, 4, 32768)) # ~8.5GB; a 12GB-class GPU is the safe choice
In actual deployments, monitor peak VRAM with tracking tools, and make sure your stress tests cover the worst case: maximum context plus maximum concurrency.
Special Considerations for Unified-Memory Devices
The growing number of ARM-based laptops and desktops with unified memory—where CPU and GPU share the same physical memory—requires a completely different evaluation approach than discrete GPUs:
Look at total unified memory, not “VRAM.” These devices have no dedicated VRAM; model weights and the system share the same memory pool, so the upper bound on loadable models depends on total unified memory. A 16GB unified-memory device can run 4–8B models; 32GB can handle 10–14B; 64GB or more can cover 30B-class models.
But memory bandwidth determines actual speed. The usual bottleneck on these devices isn’t capacity but bandwidth—LLM inference is a classic bandwidth-bound workload. When bandwidth is insufficient, even a fully loaded model will generate noticeably slower than a comparable discrete GPU. The practical takeaway: small models run great on these devices, while 30B-class models are “runnable but slow”—fine for speed-insensitive batch tasks (like overnight document summarization), not ideal for frequent interactive conversation.
Another practical tip: on unified-memory devices, consider lowering the configured context length. Memory is shared among the system, applications, and the model, and approaching the limit can trigger memory swapping, causing inference speed to fall off a cliff.
Common Pitfalls and Optimization Checklist
- Looking only at weights, ignoring the KV cache: passing a short-context test doesn’t mean long contexts work—stress-test with your workload’s actual context length.
- Ignoring runtime overhead: adding 20–30% headroom to your estimate is the baseline.
- Treating offloading as a normal strategy: layer offloading solves “can it run,” but the speed loss is often several-fold—use it only for quick validation.
- Blindly choosing the lowest quantization level: quality loss below Q4 (e.g., Q2) is non-negligible for most tasks; avoid it unless VRAM is extremely constrained.
- Skipping speed benchmarks: run a tokens/s benchmark with a fixed set of prompts before committing to a production configuration.
- Forgetting system usage: when the GPU also drives display output, usable VRAM shrinks; headless servers can reclaim that portion.
Conclusion
Choosing hardware for local LLM deployment is essentially a VRAM budget allocation problem: weights dominate, the KV cache grows linearly with context, and runtime overhead is a fixed tax. Master the “parameter count × bytes per parameter” weight estimate and the linear growth pattern of the KV cache, factor in your hardware’s actual available headroom, and you can complete the initial screening in minutes—the rest is left to real-world stress testing.
Three actionable recommendations: first, start with a model one tier below your estimate to validate the full pipeline; second, establish a speed baseline with a fixed prompt set; third, stress-test peak VRAM at your workload’s maximum context length. Only when all three pass do you have a reliable local deployment configuration.
