Local LLM Deployment: VRAM Requirements and Quantization Guide
This guide explains how to estimate VRAM for local large language model deployment. It covers weight memory by parameter count and precision, common model-size references, INT4 quantization overhead, KV cache consumption from context length and concurrency, storage requirements, quantization trade-offs, and a practical checklist for choosing hardware and deployment settings.
Introduction: Estimate VRAM before deploying locally
When deploying large language models locally, a common mistake is to choose hardware based only on the GPU model or model name. The real constraints are more nuanced: model weights, KV cache, the inference framework, and runtime overhead all consume VRAM. For models around the 10B-parameter class, the key question is not simply whether the model will fit, but how much headroom remains after loading.
This guide starts with a basic conversion from parameter count and precision to weight memory. It then looks at hidden costs such as KV cache and context length, followed by practical guidance for model selection, quantization, and deployment under limited hardware budgets.
1. Basic weight-memory conversion: parameter count × bytes per parameter
A simplified formula for estimating weight memory is:
Weight VRAM ≈ parameter count × bytes per parameter.
The cost of one parameter depends on precision:
- FP32: about 4 bytes per parameter;
- FP16 / BF16: about 2 bytes per parameter;
- INT8: about 1 byte per parameter;
- INT4: theoretically about 0.5 byte per parameter, but in real deployments the actual usage is usually slightly higher.
For a 10B model with about 10 billion parameters:
- FP16: about 18.6GB, commonly rounded to 20GB;
- INT8: about 9.3GB, commonly rounded to 10GB;
- INT4: about 4.7GB, commonly rounded to 5GB.
For a 100B model with about 100 billion parameters:
- FP16: about 186GB, commonly rounded to 200GB;
- INT8: about 93GB, commonly rounded to 100GB;
- INT4: about 47GB, commonly rounded to 50GB.
A common misconception is that local deployment of large models always requires far more VRAM than consumer GPUs provide. This is mainly true for 100B-class models, long-context scenarios, or high-concurrency serving. For a 10B-class model, FP16 needs about 20GB, so a 24GB GPU may still load it, but the remaining headroom may be tight. Hardware requirements should not be judged without considering the model size.
2. Reference VRAM by common model size
To answer “How much VRAM do I need?” more directly, the table below shows approximate weight-memory estimates for common model sizes. Values are approximate and do not include KV cache, the inference framework, CUDA context, or batch buffers.
| Parameter size | FP16 / BF16 | INT8 | INT4 | General guidance |
|---|---|---|---|---|
| 7B | 13–14GB | 6–7GB | 3–4GB | INT4 may work on 12GB; 16GB+ is more comfortable |
| 13B | 25–26GB | 12–13GB | 6–7GB | 24GB can run FP16 or INT8; 12GB is better with INT4 |
| 70B | About 140GB | About 70GB | About 35GB | FP16 needs multiple GPUs or large-memory GPUs; INT4 may need 2× 24GB-class GPUs |
| 10B | About 20GB | About 10GB | About 5GB | 24GB can load FP16, but context and concurrency headroom may be limited |
| 100B | 186–200GB | 93–100GB | 47–50GB | Usually requires multiple GPUs, professional GPUs, or a more complex deployment |
The table shows that VRAM planning is not only about whether a model can load. It is also about whether there is enough remaining space for context caching and serving multiple requests. For example, a 7B model running INT4 on a 12GB GPU is often feasible, but long context or higher concurrency can noticeably reduce the actual experience.
3. INT4 is not exactly 0.5 byte per parameter
Many people estimate INT4 weight memory as parameter count × 0.5 byte. This is theoretically valid, but real implementations are usually not exact. Most INT4 schemes use group quantization, where each group stores metadata such as scale factors and zero points. This metadata is small per group, but it still adds extra memory.
In practice, it is safer to estimate INT4 weights as 0.52–0.6 bytes per parameter, or to reserve 5%–20% extra over the theoretical value. Asymmetric quantization, smaller group sizes, or special quantization formats may increase the overhead further. On hardware with tight VRAM budgets, this detail can determine whether the model runs reliably.
4. KV cache: longer context means larger hidden overhead
Estimating VRAM from model weights alone is one of the most common causes of failure in local LLM deployment. During autoregressive generation, the model caches the Key and Value tensors of historical tokens to avoid repeated computation. This cache is the KV Cache, and its memory usage depends directly on:
- Context length: longer sequences produce larger caches;
- Concurrent batch size: serving more requests at the same time multiplies the cache;
- Model architecture and precision: layers, attention-head dimensions, and cache data types all matter.
A simplified estimate is:
KV cache VRAM ≈ 2 × layers × KV heads × head dimension × sequence length × batch size × bytes per element.
For example, assume a 70B-class model has about 80 layers, 8 KV heads, a head dimension of 128, a context length of 32K, batch size 1, and FP16 KV cache:
- With 32K context, KV cache is about 10GB;
- If context is reduced to 8K, it is about 2.5GB;
- If batch size increases to 4, KV cache at 32K context is about 40GB.
This means that even when model weights fit into a GPU, long context and high concurrency can quickly exhaust VRAM. Available VRAM can be roughly understood as:
Available VRAM = total VRAM − weights − KV cache − inference-framework overhead − other runtime overhead.
Therefore, it is recommended to reserve a safety margin of 1.2–1.5× the theoretical requirement. For production deployment, the design should not be based only on “can it start?” but should leave enough space for fluctuation and peak load.
5. Plan storage in advance
VRAM and storage are two separate dimensions. Model weights must first be stored on disk and then loaded into VRAM when needed. Therefore, disk usage is usually close to the size of the weights.
For example:
- A 10B model with FP16 weights is about 20GB, so disk usage should be at least about 20GB;
- A 100B model with FP16 weights is about 200GB, so similar space should be reserved;
- If multiple versions such as FP16, INT8, and INT4 are kept for comparison testing, storage requirements increase further.
Disk read/write speed also affects model-loading time. For scenarios that frequently switch models, compare quantization results, or repeatedly debug, a high-speed SSD can significantly reduce cold-start and model-switching delays. Good storage planning can improve both experimentation and operations efficiency.
6. Quantization is not free: precision, speed, and complexity must be balanced
Quantization can significantly reduce VRAM requirements, but it involves three trade-offs.
1. Precision loss
In general, lower bit widths have a larger theoretical impact on output quality. INT8 usually causes relatively small quality loss and is a common balance point between precision and resource usage. INT4 may still be acceptable for many general dialogue tasks, but for complex reasoning, code generation, long-text consistency, and structured output, it must be evaluated on real business data. General leaderboards alone are not enough.
2. Inference speed
Quantization does not always provide a speedup. In memory-bandwidth-limited scenarios, lower bit widths can reduce data movement and improve throughput. In compute-intensive or large-batch scenarios, some 4-bit schemes may require extra dequantization, which can introduce performance overhead. Whether quantization improves speed depends on hardware architecture, inference framework, batch size, and implementation.
3. Deployment complexity
Quantization is not limited to weight-only quantization. Weight-only quantization and weight-plus-activation quantization differ in precision, performance, compatibility, and implementation difficulty. When choosing a solution, prefer approaches that are well validated by the community and supported by mature toolchains, rather than chasing extreme compression.
7. Practical checklist for local deployment selection
Based on the points above, use the following steps to make decisions:
Determine the model size first
Clarify whether the target workload is 7B, 13B, 70B, or a model larger than 10B parameters. Hardware paths differ significantly across sizes.Choose a precision strategy
When VRAM is sufficient, try FP16 or BF16 first. When VRAM is tight, consider INT8 first. In extremely constrained environments, consider INT4 and prepare to run quality evaluation.Estimate KV cache based on real workload
Estimate cache usage from the maximum context length and concurrency of the business. Do not only ask whether the weights fit; also ask whether the service can run after startup.Reserve a safety margin
Prepare 1.2–1.5× the theoretical VRAM requirement. For long text, multi-turn dialogue, batch processing, or high concurrency, increase the margin further.Evaluate multi-GPU communication cost
When a single GPU cannot hold the model, multi-GPU parallelism is common, but inter-GPU bandwidth, communication protocols, tensor parallelism, or pipeline parallelism can add overhead.Test quality with a small sample
Compare model quality before and after quantization using real business data. Whether quantization loss is acceptable should be decided by task performance, stability risk, and cost, not by VRAM numbers alone.
8. FAQ: common questions about local LLM deployment
Q: How much VRAM do 7B, 13B, and 70B models need?
A: For weights only, a 7B model uses about 14GB in FP16, about 7GB in INT8, and about 4GB in INT4; a 13B model uses about 26GB in FP16, about 13GB in INT8, and about 7GB in INT4; a 70B model uses about 140GB in FP16, about 70GB in INT8, and about 35GB in INT4. Real deployment must also add KV cache and framework overhead.
Q: How much accuracy is lost with INT4?
A: There is no single answer. The impact varies greatly by model, quantization method, and task. General dialogue may show little noticeable loss, but complex reasoning, code generation, and long-text tasks should be validated with real tests.
Q: What if the model does not fit on a single GPU?
A: Possible options include using lower-precision quantization, shortening context, reducing concurrency, using CPU/GPU hybrid offloading, adding GPUs, or switching to a smaller model. The final choice should consider performance, quality, and hardware cost together.
Summary
The core of local LLM deployment is balancing model size, precision, context length, concurrency, and hardware cost. Understanding the basic conversion “weight VRAM ≈ parameter count × bytes per parameter,” and then adding KV cache, framework overhead, and safety margins, allows for more accurate VRAM estimation. FP16, INT8, and INT4 represent different paths from original quality to extreme compression. Only by combining estimation, real testing, and risk control can local LLM deployment be completed reliably, like an engineering budget.
