Local LLM Deployment: A Complete Guide to VRAM Requirements and Hardware Selection
This guide explains why VRAM capacity, rather than raw compute, is the first constraint when running large language models locally. It breaks VRAM usage into model weights, KV cache, activations, and framework/runtime overhead, shows how quantization (FP16/BF16, INT8, INT4) trades a little accuracy for large memory savings, and lays out four hardware tiers, from 2B–4B models on 4–6GB VRAM to 26B MoE and 31B dense models. It also includes practical selection principles and when to consider moving inference to the cloud. Use it to match your model, quantization precision, and context length to the hardware you actually have.
Why VRAM Is the First Gate for Local LLM Deployment
When people run a large language model (LLM) locally, their first question is usually “Will my GPU be able to handle it?” The answer has little to do with compute (TFLOPS) and everything to do with VRAM capacity. During inference, the model parameters must stay resident in VRAM as a whole. Once the model weights, runtime activations, and KV cache together exceed the available VRAM, one of two things happens: the program exits with an error, or it starts offloading data to system memory or even disk, and inference speed falls off a cliff.
The right approach to hardware selection follows a clear order: estimate the VRAM requirement → choose a quantization precision → match a hardware tier. Let’s start from the fundamentals.
What Actually Consumes VRAM
Many beginners assume that VRAM usage equals the size of the model file. That’s only a rough approximation. Real VRAM usage has four components:
- Model weights: the largest portion, directly tied to the parameter count and quantization precision.
- KV cache: closely tied to context length and concurrency. The longer the context, the larger the cache, and in long-context workloads it can even surpass the weights in size.
- Activations and intermediate tensors: temporary data produced during inference, scaling roughly with batch size.
- Framework and runtime overhead: the inference framework itself, the CUDA context, memory fragmentation, and so on. Reserving 0.5–2GB is the safer option.
A rough estimation formula helps you gauge the order of magnitude:
Total VRAM ≈ parameter count × bytes per parameter (weights)+ KV cache related to context length+ runtime and fragmentation overheadBytes per parameter under common precisions:FP16 / BF16 → ~2 bytesINT8 → ~1 byteINT4 → ~0.5 bytes
To put it in perspective: a 7B model in FP16 needs about 14GB just for its weights, while after INT4 quantization it drops to roughly 4GB. This is why quantization is the key enabler for running local LLMs on consumer hardware.
Quantization: Trading Precision for Feasibility
Quantization is the process of compressing model weights from high-precision floating point into low-bit integers. Its value lies in trading a controlled loss of accuracy for a large reduction in VRAM usage. A few common misconceptions are worth clearing up:
- More aggressive quantization isn’t always better. INT4 saves a significant amount of VRAM, but too low a bit width can cause quality regressions in complex reasoning and code generation.
- There’s a trade-off between VRAM usage and inference quality. Everyday chat and summarization tasks tolerate quantization relatively well, while math, code, and long chains of reasoning are more sensitive to precision.
- Different quantization formats (for example, methods that quantize weights and activations differently) involve different trade-offs between speed and memory. Before going to production, run a small-scale comparison on your own real samples.
Four VRAM Tiers at a Glance
Combining parameter count, quantization precision, and typical use cases, the table below offers a tiered reference. Parameter sizes follow the model-size categories commonly used in the industry, but in practice, defer to the official documentation of the model you’re using.
| Model size tier | Approx. VRAM after quantization | Recommended hardware | Best suited for |
|---|---|---|---|
| ~2B small models | ~2–4GB | Lightweight devices with up to 4GB | Getting a minimal working setup up and running |
| ~4B models | ~4–6GB | A 6GB GPU or a device with 16GB of unified memory as a starting point | Most people’s first local LLM experience |
| ~26B MoE (Mixture of Experts) models | ~12–16GB | 16GB for a more comfortable fit | Stronger reasoning without going all-in on the largest models |
| ~31B dense models | ~20–24GB | 24GB or more | Quality, coding, and long context above all |
Each tier is described in more detail below.
Entry Tier: ~2B / 4B Models
The main goal at this level is proving feasibility, not chasing peak performance. A 2B model can run on 4GB of VRAM, making it suitable for older machines or integrated graphics. A 4B model works well on a 6GB GPU or a laptop with 16GB of unified memory. It responds quickly, runs fully offline, and suits lightweight tasks such as local assistants, simple Q&A, and text cleanup.
Keep in mind that this tier has limited ability in complex logical reasoning and long, multi-turn conversations. It’s best treated as a starting point or an offline fallback.
Mid Tier: ~26B MoE (Mixture of Experts) Models
The defining feature of a Mixture of Experts (MoE) architecture is that its total parameter count is large, yet each inference activates only a small subset of its expert networks. In practice, this means compute and activated VRAM don’t grow linearly with the total parameter count. A model with roughly 26B total parameters and a few billion activated parameters typically falls in the 12–16GB range after quantization, which 16GB of VRAM can handle comfortably.
Its positioning is clear: a middle ground between models that are noticeably more capable than small models and 30B-class dense models, without the heavy VRAM cost of the latter. It’s a popular choice for cost-effective local inference.
High-Performance Tier: ~31B Dense Models
In a dense model, every parameter takes part in the computation during inference. This gives dense models a high capability ceiling and more consistent performance on tasks like code generation, complex reasoning, and long-context understanding. The trade-off is the highest VRAM requirement: a ~31B model often needs 20–24GB of VRAM after quantization. Going with 24GB or more is recommended, and you should also leave headroom for long contexts and some concurrency.
If your VRAM budget falls just short, there are fallbacks: lower the quantization precision, shorten the context window, or offload some layers to system memory so the model can at least run.
Practical Principles for Choosing Hardware
- Prioritize VRAM over compute: insufficient VRAM means the model won’t run at all, whereas insufficient compute only makes it slower. Choose enough capacity first, then think about speed.
- Unified memory devices are also an option: some laptops and desktops with a unified memory architecture offer a large pool of usable memory for medium-to-large models, though their bandwidth is typically lower than a discrete GPU, so expect speed differences.
- Leave room for long contexts: if you regularly work with long documents, reserve space for the KV cache beyond what the weights consume, or usage will overflow as soon as the context grows.
- Test quantization formats in practice: for the same parameter count, different quantization schemes can differ noticeably in both VRAM and speed. Benchmark them on your real workload samples rather than relying on theoretical numbers alone.
When Local Hardware Isn’t Enough: Cloud Compute as a Supplement
When your local hardware can’t handle the target model size, or you need higher concurrency and stability, it makes sense to move inference to the cloud. You don’t need to commit to any particular vendor; a general approach is to choose the capabilities your workload requires:
- Elastic GPU compute or container platforms: scale resources up or down with demand, making them a good fit for spiky or batch inference workloads.
- Object storage: store model weights, datasets, and inference outputs.
- Logging services and monitoring alerts: track inference latency, VRAM utilization, and error rates so bottlenecks can be spotted early.
Baidu AI Cloud, for example, offers general-purpose cloud capabilities such as a container platform, object storage, and monitoring and alerting. These can help teams move locally validated models to the cloud smoothly, following a “try locally, scale to the cloud as needed” path. The core principle remains the same: validate feasibility locally at low cost first, then decide whether cloud capacity is needed based on actual load.
Summary
Choosing VRAM for local LLM deployment comes down to balancing parameter count, quantization precision, and context length: small models keep things feasible, MoE models offer cost efficiency, and dense large models deliver quality and capability at the price of higher VRAM usage. Master the estimation framework of weights + KV cache + runtime overhead, factor in your real needs for precision and long-text handling, and you can make an informed choice among consumer GPUs, unified memory devices, and cloud compute. A practical rollout path: start with a tier you can run stably, stress-test VRAM and speed with real samples, then step up a tier at a time.
