VRAM Planning for Local LLM Deployment: A Practical Guide to Quantization and GPU Selection
Planning VRAM for local large language model (LLM) deployment is critical but often misunderstood, as official numbers rarely reflect real-world usage. This guide breaks down the core components of VRAM consumption—including model weights, quantization, and KV Cache—and provides practical hardware selection strategies across different VRAM tiers. From 6GB entry-level GPUs to 24GB+ high-end cards and Apple Silicon unified memory architectures, learn how to estimate memory requirements, choose the right quantization level, and optimize context lengths to ensure stable and efficient local AI inference.
VRAM Planning for Local LLM Deployment: A Practical Guide to Quantization and GPU Selection
1. Why “Official VRAM Numbers” Offer Limited Reference Value
Whenever a new model is released, developers are often less concerned with benchmark improvements and more focused on one question: “Can my GPU actually run this?” Official documentation typically provides the storage footprint of model weights at their original precision (e.g., BF16). While theoretically accurate, this number is difficult to use directly as a hardware purchasing baseline in real-world deployments.
There are three main reasons for this. First, original precision weights are only part of the “static usage.” Inference requires additional VRAM for activations, KV Cache, and temporary computation graphs. Second, most local deployments utilize quantization to compress model size, and different quantization levels can result in a several-fold difference in VRAM requirements. Third, context length scales almost linearly with VRAM usage. Official figures are usually baselines for short contexts; once conversation history is extended, actual usage can spike rapidly.
Therefore, before discussing “how much VRAM is needed,” it is necessary to understand the core components of VRAM consumption and then reverse-match them to your hardware.
2. Core Components of VRAM Usage: More Than Just “Weight Size”
2.1 Weight Parameters Themselves
Regardless of the model, static weights always occupy the bulk of VRAM. Taking BF16 precision as an example, every billion parameters requires about 2GB of VRAM (1 billion × 2 bytes). A 30B-class model requires about 60GB for original weights, which is clearly beyond the capacity of standard consumer-grade GPUs.
2.2 The “Compression Dividend” of Quantization
Quantization is the process of mapping high-precision floating-point numbers to low-bit representations. Common industry solutions include 4-bit and 8-bit quantization. Taking 4-bit as an example, it requires only about 0.5GB of VRAM per billion parameters, shrinking to a quarter of the original precision. This is why a 30B-class large model can run within 24GB of VRAM—because the quantized weight size drops to around 15GB.
However, it is important to recognize that: Quantized VRAM usage does not equal final runtime usage. Inference frameworks allocate a certain proportion of “runtime overhead” when loading the model, typically about 10%~20% of the weight size, for intermediate variables during forward propagation. Therefore, actual usage will be noticeably higher than the theoretical compressed value.
2.3 Context Length and KV Cache
KV Cache is the historical information that must be cached during autoregressive generation. Its size is directly related to the number of model layers, attention heads, and context length. A simple rule of thumb is: Double the context, and the KV Cache usage roughly doubles. Taking a 31B-class model as an example, the KV Cache under a 4K context might consume about 1-2GB, but if extended to 32K, the extra overhead could reach 8GB or more. This means that even if the model weights fit entirely into VRAM, long conversation scenarios can still consume all the remaining space.
3. VRAM Reference for Mainstream Quantized Models
Based on the principles above, the following data are reference ranges obtained from actual deployments, covering typical model specifications from lightweight to heavy-load scenarios:
| Model Specification | Quantized Weights | Total Runtime Usage (incl. KV Cache) | Recommended Hardware Tier |
|---|---|---|---|
| Lightweight (~2B) | ~1-1.5GB | ~2-4GB | Starting at 4GB VRAM; CPU can barely run it |
| Entry-level (~4B) | ~2-2.5GB | ~4-6GB | 6GB GPU or 16GB unified memory device |
| Advanced (~26B, MoE architecture) | ~8-10GB | ~12-16GB | 16GB VRAM is comfortable |
| Heavyweight (~31B) | ~12-15GB | ~20-24GB | 24GB+ VRAM |
It is worth noting that models using the MoE (Mixture of Experts) architecture have “activated parameters” much smaller than “total parameters.” This means that while the weight file is large, the computation during inference is relatively manageable, resulting in lower VRAM requirements than a dense model of the same parameter count. These models are more viable to run on consumer-grade hardware, but the premise is still proper quantization and reasonable context length.
4. GPU Selection Strategy by VRAM Tier
4.1 ~6GB: Pragmatic Start, Don’t Overreach
Typical Scenario: Entry-level gaming cards, desktop GPUs with less than 8GB VRAM, or thin-and-light laptop GPUs.
At this tier, the safest choice is an entry-level model (~4B). The runtime usage after quantization is about 4-5GB, which can just complete chat tasks without triggering an Out-of-Memory (OOM) error. You can also try the lowest quantized version of advanced models, but you must limit the context length to a very short range (e.g., 1K-2K) and accept slower inference speeds.
Core Advice: The goal for 6GB VRAM is to “get it running,” not “run it well.” Prioritize a smooth experience and focus your attention on prompt engineering and inference parameter tuning rather than pushing hardware to its limits.
4.2 8GB~12GB: The Sweet Spot, Flexible Allocation
Typical Scenario: Mid-range gaming cards or previous-generation sub-flagship cards. This is the most common tier in the Steam Hardware Survey.
This tier can very comfortably run 4B-class models, and under higher quantization precision (like 8-bit), it can even achieve quality close to the original model. At the same time, advanced MoE models (~26B) can fit their weights into VRAM after 4-bit quantization, but the context length must be strictly controlled.
In reality, users in this tier often face the dilemma between “extreme compression” and “quality loss.” It is recommended to use the 4B model as the daily work driver and the 26B model as a fun experiment, rather than the other way around.
4.3 12GB~16GB: Ticket to Advanced Models
Typical Scenario: High-end gaming cards or previous-generation flagship cards.
When VRAM reaches 16GB, advanced MoE models (~26B) enter the “seriously usable” range. Quantized weights of about 12GB plus extra overhead can run within 16GB at a medium context length. Inference speed depends on the GPU’s computing power, generally reaching 10-20 tokens per second, which basically meets interactive chat needs.
Key Reminder: Being able to start doesn’t mean it can run stably. If you need long document analysis or complex multi-turn conversations daily, it is recommended to limit the context length to within 8K, otherwise there is still a risk of VRAM OOM.
4.4 24GB+: High-end Players & Prosumer Scenarios
Typical Scenario: Flagship gaming cards or professional accelerators.
24GB of VRAM means you can fully accommodate the 4-bit quantized version of a heavyweight model (~31B) and run it stably at an 8K-16K context length. At this tier, the improvement in inference quality is visible to the naked eye, especially in code generation, long-text understanding, and logical reasoning.
However, even with 24GB of VRAM, facing ultra-long contexts above 32K will still be tight. If you have such needs, consider offloading some layers to system memory or using a streaming loading strategy, but this will significantly reduce generation speed.
5. Unified Memory Perspective: How Should Mac Users Evaluate?
For Apple Silicon devices, the unified memory architecture is fundamentally different from discrete GPUs: the CPU and GPU share the same physical memory, so there is no split between “VRAM” and “RAM.” From a practical standpoint, the usable memory total—the portion remaining after OS usage—is the space the model can utilize.
Taking a 16GB unified memory machine as an example, the actual usable memory is about 12GB. This means you can smoothly run a 4B-class model (runtime ~5GB), but an advanced 26B model, even if quantized, might suffer from a poor experience due to insufficient memory bandwidth or available capacity.
Machines with 32GB+ enter a more comfortable range. Advanced models can run fully, and heavyweight models have a chance to be tested after quantization. However, note that memory bandwidth is a more critical bottleneck than capacity. Chips with higher bandwidth have a clear advantage in long-context generation, while chips with lower bandwidth might only achieve single-digit tokens per second, even if capacity is sufficient.
6. Common Pitfalls and Troubleshooting Guide
6.1 How to Choose Quantization Precision?
4-bit quantization is the most cost-effective compromise, with acceptable quality loss. If VRAM is sufficient, 8-bit quantization retains more of the original model’s capabilities, but the VRAM requirement almost doubles. It is recommended to try 4-bit first, and upgrade to higher precision if generation quality does not meet your needs.
6.2 What Context Length Is Appropriate?
The principle is simple: More VRAM allows for longer context. For 16GB VRAM, 4K-8K is a safe range; for 24GB VRAM, 8K-16K is feasible; for contexts exceeding 32K, even flagship cards should be evaluated cautiously. During actual deployment, you can gradually extend the context to test VRAM usage and find the upper limit for stable operation.
6.3 What to Do During a VRAM OOM?
First, lower the context length. Second, switch to a lower-bit quantized version (e.g., from 8-bit to 4-bit). Upgrading hardware should be the last resort. You can also use the CPU-GPU heterogeneous offloading feature of inference frameworks to put some computation layers into system memory, though this sacrifices speed.
6.4 Can CPUs Run Large Models?
Yes, but only for lightweight models or as an auxiliary means when GPU VRAM is insufficient. The speed bottleneck of CPU inference is very obvious; large models might generate as slowly as 1-2 tokens per second, making them suitable only for non-real-time batch processing. If budget is limited, prioritize GPU VRAM capacity—CPU compute power is a secondary consideration.
7. A Pre-Deployment Checklist
Before actually downloading model files, it is recommended to self-check in the following order:
- Define the Use Case: Is it for daily Q&A, code assistance, or professional analysis? Different use cases have different weights for speed versus quality.
- Calculate Total VRAM Demand: Quantized model weights + 10%~20% runtime overhead + KV Cache for the target context.
- Reserve a Safety Margin: Do not let total usage approach the VRAM limit. Keep at least a 10% margin for the system and other applications.
- Experience Before Upgrading: Run through the whole process with a lightweight model first, then evaluate whether it is worth upgrading hardware for a larger model.
8. Conclusion
VRAM planning for local LLM deployment is essentially a problem of “maximizing quality under budget constraints.” There is no one-size-fits-all answer, only reasonable trade-offs based on your own hardware conditions. By breaking down VRAM composition, understanding quantization principles, and grasping the boundaries of different hardware tiers, everyone can find a configuration scheme that suits them.
Rather than chasing ever-expanding parameter sizes, it is better to exhaust the performance of your current hardware first. In the gap between hardware upgrades, quantization, context management, and inference parameter tuning can also bring massive leaps in experience. Hopefully, this guide provides a clear map for your local AI journey, helping you avoid detours and reach your destination faster.
