Local LLM Deployment: VRAM Requirements for Running Different Model Sizes
A practical guide to local LLM deployment that answers the core question: how much VRAM do you need to run a given model size. It breaks down where VRAM actually goes (weights, KV cache, runtime overhead, and communication buffers), explains the techniques lowering the VRAM threshold (low-bit quantization, sparse/MoE architectures, KV cache optimization, VRAM tiering, and unified memory), and provides a single-GPU VRAM-to-model-size reference table alongside a GiB-based Python estimator. It also covers hardware selection across capacity, bandwidth, and compute, an engineering checklist to avoid "deployable but unusable" setups, monitoring guidance, and an FAQ on common VRAM questions. The goal is to help you work backward from business tasks, latency budgets, concurrency, and compliance requirements to a validated configuration.
1. The Bottom Line First: VRAM Thresholds Are Dropping, Not Disappearing
Local LLM deployment is usually driven by keeping data in-house, offline availability, long-term cost control, and tailoring behavior to business needs. But whatever the motivation, developers first have to answer one question: how much VRAM runs how large a model?
Historically, this was often simplified to “model size.” For example, a 128B dense model at 8-bit precision needs about 128 GB for weights alone, and a 480B illustrative model at 8-bit needs about 480 GB. The 480B figure here is illustrative, meant to show that “more parameters means more weight VRAM,” and does not refer to any specific public model.
At 4-bit weight quantization, sizes drop noticeably:
- 128B model: ~128 GB at 8-bit, ~64 GB at 4-bit
- 480B illustrative model: ~480 GB at 8-bit, ~240 GB at 4-bit
Combined with VRAM tiering, unified memory, CPU offloading, and KV cache optimization, some models that previously only ran in data centers can now “conditionally run” on workstations, high-memory thin laptops, or high-end consumer devices.
Two clarifications are essential:
- Thresholds are dropping, not vanishing. VRAM still sets the ceiling for local deployment; what changes is how large a model a given GPU can hold.
- VRAM numbers without preconditions are meaningless. Any “how much VRAM runs how large a model” claim must specify: total vs. activated parameters, quantization bit-width, context length and concurrency, and whether weights are fully resident in VRAM.
Otherwise, “it runs” could mean “it fits the weights,” “it can do single-turn chat,” or “it can stably serve concurrent requests.” These three carry completely different engineering implications.
2. Do the Math First: What Actually Consumes VRAM
To assess VRAM needs, don’t just look at “how big the model is”; break down where VRAM goes. Local inference VRAM usage can be approximated as:
Total VRAM ≈ weights W + KV cache K + runtime overhead O + communication buffer C
| Component | Main determining factors | Estimation | Optimization |
|---|---|---|---|
| Weights W | Parameter count, quantization bit-width | Parameters × bits ÷ 8 | Low-bit quantization, pruning, distillation |
| KV cache K | Layers, KV heads, context length, concurrency, cache precision | Grows with generation length and concurrency | GQA, paged management, KV quantization |
| Runtime overhead O | Framework, drivers, activation buffers, VRAM fragmentation | Usually reserve 10%–20% | Set sensible VRAM reserve and batch size |
| Communication buffer C | Multi-GPU parallelism method and interconnect bandwidth | Depends on the parallel strategy | Prefer single GPU; go multi-GPU only when necessary |
Many selection decisions fixate on “model size” while ignoring KV cache and runtime overhead. In practice, doubling the context doubles the KV cache; doubling concurrency doubles the KV cache too. Once VRAM approaches the limit, the inference engine may start queueing requests, preempting, evicting KV blocks, or swapping them out to memory, which reduces throughput and can even trigger OOM.
KV Cache Formula
For a common Transformer structure, the KV cache can be written as:
KV cache bytes =2 × layers × KV heads × head dim × cache precision bytes × context length × concurrency
Take a mainstream dense model: 32 layers, 8 128-dim vectors for both K and V per token, stored in FP16. The per-token KV cache is then:
2 × 32 × 8 × 128 × 2 bytes = 131072 bytes ≈ 128 KiB
Scaled across contexts:
- 8K context: ~1 GiB
- 16K context: ~2 GiB
- 32K context: ~4 GiB
- 64K context: ~8 GiB
- 128K context: ~16 GiB
If 128 concurrent requests each hold an 8K context, the KV cache alone can exceed 128 GiB. This is the common reason a model with “small parameters” runs out of VRAM first.
3. The Techniques: Why VRAM Thresholds Keep Dropping
3.1 Low-Bit Quantization: The Most Direct Cut
Quantization compresses weights from FP16 to 8-bit or even 4-bit and runs matrix computation at lower precision. 4-bit weights are roughly one-quarter the size of FP16, so VRAM requirements drop sharply.
But lower bit-width is not automatically better:
- Outliers in the weight distribution inflate quantization error;
- A common practice is per-channel grouping, each with its own scale factor;
- Keeping higher precision on sensitive channels is a common compromise;
- Different methods make different trade-offs in activation calibration and per-channel scale protection.
Also, 4-bit is not “pure 4-bit.” Actual weights also carry group scale factors, zero points, or metadata, in formats such as AWQ, GPTQ, and GGUF Q4_K_M, so the effective bit-width is typically around 4.5–5 bits. Leave a bit of headroom above the theoretical value when estimating.
The lower the bit-width, the smaller the size, but marginal quality loss tends to accelerate. Whether that loss is acceptable must be validated on your business data.
3.2 Sparse Architecture: Trade “Total Parameters” for Capability, Save Compute with “Activated Parameters”
Mixture-of-Experts (MoE) models consist of multiple expert sub-networks plus a router, and each token activates only a few experts. This has two direct consequences:
- VRAM depends on total parameters; compute depends on activated parameters. Total parameters determine weight size; activated parameters determine compute.
- Speed no longer scales with capability. At similar total parameter counts, fewer activated parameters usually means faster decoding, but each token can access a more limited knowledge capacity.
On a single GPU, VRAM tracks total parameters and bandwidth tracks activated parameters; the more experts and the more dispersed the routing, the more it relies on multi-GPU or expert parallelism, where communication becomes a new bottleneck.
For example, a 235B-total, 22B-activated MoE model at 4-bit has weights of about 109 GiB, and typically needs a 128 GiB-class single GPU, a multi-GPU setup, or a unified memory approach; it is not suitable for stable single-card operation on ordinary consumer GPUs.
3.3 KV Cache Optimization: Long Context Is the Real VRAM Killer
Three common categories of optimization:
- Grouped-Query Attention (GQA): multiple query heads share one set of key/value heads, trading a small capability cost for a smaller cache;
- Paged management: split the KV cache into fixed-size blocks allocated on demand, reducing VRAM fragmentation;
- Cache reuse and quantization: cache an identical system prompt only once; storing K/V at 8-bit or lower further reduces footprint.
3.4 Inference Optimization and VRAM Tiering: Trading Space for Throughput
- Continuous batching: swap in a new request as soon as one finishes, reducing the VRAM waste caused by a fixed batch size;
- Speculative decoding: a small model drafts and the large model verifies in batches, trading a little extra VRAM for lower latency;
- Layered VRAM offloading: keep only the currently needed layers in VRAM and the rest in memory, suited to small-VRAM setups that are not latency-sensitive;
- Unified memory architecture: CPU and GPU share an address space with no explicit copies, but bandwidth is usually lower than dedicated VRAM;
- Pure CPU inference: bypasses the GPU VRAM limit entirely, suited to low-power devices and offline batch jobs, at the cost of speed bounded by CPU memory bandwidth and core count.
What this combination genuinely changes is not “fitting a model without limit,” but the cost structure of inference: it converts dependence on a “single GPU with large VRAM” into dependence on memory capacity, memory bandwidth, quantization precision, and latency budget.
4. How Much VRAM Runs How Large a Model: Single-GPU Reference Table
The table below assumes: single-GPU deployment, single request, concurrency = 1, 4-bit weights, FP16 KV cache, 15% runtime overhead reserved, no CPU offloading. All estimates here use GiB; if a GPU spec sheet says GB, the numbers are about 7% smaller. Actual deployment must be recomputed for the model structure, context, and concurrency.
| VRAM tier | Stable operation | Possible but with trade-offs | Common hardware form | Positioning |
|---|---|---|---|---|
| 4 GiB | 1.5B–3B, context ≤8K, single request | 7B–8B: only short context, extreme quantization or CPU offload; speed may fall below 5 token/s | Entry discrete GPU, some iGPUs, mini PCs | On-device experience, offline tools |
| 8 GiB | 4B–8B, context ≤16K, single request | 14B: short context, CPU offload or extreme quantization; not recommended for real-time interaction | Mainstream consumer GPU | Personal development, customer-service Q&A |
| 12 GiB | 8B–14B, context ≤16K, single request | 27B: only CPU offload or very low-bit; 32B generally not recommended at this tier | Mid-range consumer GPU | Code assistant, document summarization |
| 16 GiB | 14B, context ≤32K, single request | 27B–32B: short context, CPU offload or extreme quantization; latency and throughput noticeably affected | Upper-mid consumer GPU, thin-laptop discrete GPU | Long-document processing, RAG |
| 24 GiB | 27B–32B, context ≤32K, single request | 70B: 4-bit + CPU offload or unified memory; not suitable for high-concurrency real-time service | High-end consumer GPU | High-quality inference, single-user sharing |
| 48 GiB+ | 70B, 4-bit, context ≤32K, single request | 10B-class MoE, multi-GPU, multi-concurrency; recompute weights and KV cache | Pro cards, workstations, unified memory devices | Team sharing, hybrid deployment |
Table notes:
- Stable operation: under the stated assumptions, weights and KV cache can reside in VRAM with some headroom, suitable for normal interaction.
- Possible but with trade-offs: may rely on CPU offloading, short context, low concurrency, extreme quantization, or higher latency tolerance.
- Multi-concurrency: each additional concurrent request adds roughly one single-request KV cache. The table assumes a single request and cannot be applied directly to multi-user sharing.
- Model structure differences: fewer layers, fewer KV heads, or KV quantization gives stronger long-context capability; otherwise it is more VRAM-hungry.
- Long context without GQA: if the model has no GQA and the context is long, the KV cache may exceed the weights themselves and must be recomputed using the Section 2 formula.
- All figures and code results here are estimates; validate against real business data.
For example, an 8B model with 4-bit weights and FP16 KV cache at 32K context:
- Weights: ~3.7 GiB
- KV cache: ~4 GiB
- With 15% reserve: ~8.9 GiB
So the 8 GiB tier is conservatively capped at ≤16K; if you must have 32K, start at 16 GiB.
5. VRAM Estimation Code: Unified GiB Basis
The code below uses GiB throughout and defaults to the 24 GiB-and-above tiers. For lower-VRAM tiers, reduce ctx and concurrency.
def estimate_vram_gib(n_params_b, bits=4, ctx=32768,kv_kib_per_token=128, overhead_ratio=0.15,concurrency=1):"""Estimate single-GPU local inference VRAM (GiB).Default assumptions:- Weights: 4 bit- Context: 32768 tokens- Per-token KV cache: 128 KiB (derived from model structure)- Reserve: 15%- Concurrency: 1Note: the default ctx targets the 24 GiB and above tiers;for lower-VRAM tiers, lower ctx according to the table.nvidia-smi often shows MiB; 1 GiB = 1024 MiB.kv_kib_per_token can be approximated as:2 x layers x KV heads x head dim x 2 bytes / 1024"""weights = n_params_b * 1e9 * bits / 8 / 1024**3kv_cache = ctx * kv_kib_per_token * 1024 * concurrency / 1024**3return (weights + kv_cache) * (1 + overhead_ratio)if __name__ == "__main__":for params in (8, 14, 32, 70):print(params, "B:", round(estimate_vram_gib(params), 1), "GiB")# approx: 8B: 8.9 GiB | 14B: 12.1 GiB | 32B: 21.7 GiB | 70B: 42.1 GiBprint("32B, 4 concurrency:",round(estimate_vram_gib(32, concurrency=4), 1), "GiB")# approx: 32B, 4 concurrency: 35.5 GiB
6. Hardware Selection: Three Main Lines — Capacity, Bandwidth, Compute
Hardware evaluation should follow three main lines:
- Capacity decides “whether it fits.” It determines whether the model can reside in VRAM, how long the context can be, and how large the concurrency can be.
- Bandwidth decides “how fast.” The theoretical upper bound on single-request generation speed is roughly:
Theoretical generation speed ≈ VRAM bandwidth ÷ weight bytes read per step
For example, with 1000 GB/s VRAM bandwidth and 6 GB of weights, the theoretical ceiling is about:
1000 ÷ 6 ≈ 167 token/s
In practice, you usually reach only 50%–70% of the theoretical value. This basis covers only weight reads during the single-request decode phase and excludes first-token prefill, KV reads, multi-GPU communication, CPU offloading, scheduling overhead, and VRAM fragmentation.
- Compute decides “how smoothly it reads.” It mainly affects first-token latency and long-context prefill speed, with relatively limited impact on single-request generation speed.
Also consider:
- Multi-GPU does not scale linearly: cross-card tensor parallelism introduces communication overhead, and bus bandwidth and interconnect method often become the bottleneck;
- PCIe and power: multiple GPUs need enough PCIe lanes, a matched power supply, and good cooling;
- VRAM sharing demands caution: some systems borrow memory when VRAM runs low, but performance drops sharply once that is triggered;
- Non-VRAM bottlenecks: if CPU memory capacity is insufficient, offloading schemes may fail outright;
- Offload failure risk: insufficient VRAM or a process crash can lose unsaved input, so persist intermediate results for long-document processing.
Five-Step Selection Method
Work backward in the order below rather than buying a GPU first and looking for a model afterward:
- Define the task: summarization, Q&A, code generation, and structured extraction have very different model capability requirements.
- Define the budget: write down first-token latency, generation speed, concurrency scale, and data-compliance requirements.
- Choose the model and quantization: use the VRAM formula to estimate weights + KV cache, then reserve 10%–20% headroom.
- Validate capability: compare before and after quantization using your own business datasets, not just generic benchmarks.
- Stress-test to finalize: record VRAM peaks, first-token latency, generation speed, P99 latency, temperature, and power.
7. Engineering Checklist: Avoid “Deployable but Unusable”
| Common problem | Symptom | Response |
|---|---|---|
| VRAM fragmentation | Enough total VRAM but reports insufficient VRAM | Limit max context and concurrency, enable paged cache, restart the process periodically |
| Long-context bloat | Slower the longer the context | Set a max context, evaluate KV quantization and sliding-window schemes |
| Offload throughput drop | Generation falls to single-digit token/s | Use only for non-real-time scenarios, or adjust the number of offloaded layers |
| Low-bit quantization quality loss | Long-text reasoning and instruction following degrade | A/B evaluate with business datasets; fall back to 8-bit if needed |
| Speed and thermal instability | Throttling after long runs, fluctuating timing | Improve cooling; monitor temperature and power during stress tests |
| Data compliance | Local data and the inference pipeline lack auditing | Establish model versioning, input/output logging, and access auditing |
| Offload failure | Process crash or OOM loses input | Persist intermediate results; set timeouts, retries, and alerts |
On launch, monitor the following metrics:
- VRAM peak: distinguish weights, KV cache, and runtime usage;
- First-token latency: reflects prefill and scheduling efficiency;
- Generation speed: reflects decode-phase weight-read efficiency;
- P99 latency: reflects tail requests and concurrency pressure;
- GPU temperature and power: indicates whether throttling risk exists;
- Error rate: focus on OOM, timeouts, and offload failures.
On NVIDIA/Linux, use the following command for basic observation:
watch -n 1 nvidia-smi --query-gpu=memory.used,utilization.gpu,temperature.gpu,power.draw --format=csv
Other platforms can use:
- AMD/Linux:
rocm-smi; - General terminal monitoring:
nvtop; - Unified memory devices: observe GPU VRAM, system memory, and swap together;
- macOS: use Activity Monitor or tools such as
psandvm_statto observe memory pressure.
8. FAQ
Q: Can 24GB of VRAM run a 70B model?
Generally not for stable real-time use. A 70B model at 4-bit is about 32.6 GiB in weights, and adding a 32K context and runtime overhead usually exceeds 24 GiB. With CPU offloading or unified memory you may get a slow demo, but it is not suitable for daily interaction.
Q: Can 12GB of VRAM run a hundred-billion-parameter model?
Generally not for stable real-time use. With extreme quantization, CPU offloading, or unified memory you may get a slow demo, but it is not suitable for daily interaction.
Q: What if VRAM is insufficient?
The usual priority order is: shorten the context, lower concurrency, enable KV quantization, use a GQA model, enable layer offloading, switch to a smaller model. If real-time requirements still cannot be met, upgrade VRAM or move to multi-GPU.
Q: How much quality does 4-bit quantization lose?
There is no single answer. It depends on model structure, quantization algorithm, calibration data, and the business task. Code generation, long-text reasoning, and structured extraction are more sensitive to quantization, so A/B testing on business datasets is recommended.
Q: How do I estimate the KV cache?
Approximate it as 2 × layers × KV heads × head dim × cache bytes × context × concurrency. Long contexts and high concurrency significantly increase the KV cache.
Q: Why does the model fit but respond slowly?
Possibly because the context is too long, concurrency is too high, the KV cache is squeezing VRAM, or CPU offloading has been triggered. Generation speed is also affected by VRAM bandwidth and weight-read efficiency.
Q: How much extra VRAM does multi-concurrency need?
Given that single-GPU VRAM is sufficient, concurrency mainly increases the KV cache. If concurrency goes from 1 to 4, the KV cache usually grows to roughly 4×.
9. Conclusion
“12GB of VRAM running a hundred-billion-parameter model” sounds like a gimmick because it omits the preconditions. Once you add clarity on total vs. activated parameters, quantization bit-width, whether weights are resident in VRAM, context length, and concurrency, such claims usually get a reasonable explanation; they are more an engineering-limit demo than a daily usable solution.
What has genuinely changed is the overall VRAM-threshold curve: 4-bit quantization cuts same-size model footprints to a quarter, sparse architectures decouple compute needs from parameter scale, KV cache optimization keeps long contexts from simply growing linearly, and VRAM tiering with unified memory lets capacity extend via memory.
But capacity and bandwidth remain unavoidable physical constraints. When selecting hardware, rather than chasing the numbers on a VRAM tier, start from the business task, latency budget, concurrency scale, and data-compliance requirements, work backward step by step to your configuration, and validate the conclusion with measured data.
