Mid-Size LLM VRAM Requirements: A Practical Local Deployment Guide (2026)
The VRAM numbers printed in model cards are only a starting point, not a buying guide. This article explains why the "parameters × 2 bytes" figure falls short, then breaks down the four things that actually consume GPU memory during local inference: model weights, KV Cache, vision encoders and multimodal input, and inference-framework runtime overhead. It gives tested VRAM ranges for three common mid-size model shapes—compact 2B/4B models, sparse mixture-of-experts models (~26B total, ~4B active), and dense ~31B models—along with a runnable Python VRAM estimator, quantization guidance, GPU selection by memory tier, unified-memory and cloud deployment notes, and a troubleshooting checklist. Use it to size hardware for your real context length and concurrency rather than a single headline number.
Why the official VRAM number isn’t enough to buy a GPU
Plenty of developers read the VRAM requirement in a model card, buy a card or spin up a service based on that number, and then hit one of three outcomes: the model loads but crashes after a few turns of conversation; nvidia-smi shows VRAM almost completely full; or it runs fine locally but latency spikes the moment concurrency goes up.
The reason is straightforward. The VRAM figure in an official spec is usually just the base weight footprint in BF16/FP16, typically calculated as “parameters × 2 bytes.” That calculation isn’t wrong, but it only answers “how much do the weights take.” Whether the model actually runs stably depends on more: KV Cache, the vision encoder and multimodal input, and the inference framework’s runtime overhead.
This article focuses on deploying mid-size open-source LLMs locally, covering three typical shapes:
- Compact small models: roughly 2B/4B parameters, suited to ultrabooks, entry-level discrete GPUs, and unified-memory devices.
- Sparse mixture-of-experts models: ~26B total parameters, but usually only ~4B parameters active per token.
- Traditional dense models: ~31B parameters, with fuller weights but higher VRAM pressure.
To avoid applying the estimates incorrectly, here are the testing and estimation assumptions first: the ranges below are compiled mainly from measurements across several devices, under conditions that include 4-bit group quantization, 16K–32K context, single request, and multimodal input disabled. Hardware coverage spans entry-level discrete GPUs, 8GB/12GB/16GB/24GB discrete GPUs, and 16GB/32GB/64GB unified-memory devices. Actual usage varies by inference framework and quantizer—for example llama.cpp/GGUF, vLLM, MLX, TensorRT-LLM, and others—and vision input, embedding models, reranking models, and concurrency all change the result significantly. So the numbers here are budget ranges, not absolute guarantees.
1. The short answer: VRAM ranges by model size
Under 4-bit quantization, 16K–32K context, single request, and no auxiliary multimodal models, you can use the table below as a first filter.
| Model shape | Typical VRAM after quantization | Minimum VRAM for inference | Minimum VRAM with training/fine-tuning | Recommended hardware tier |
|---|---|---|---|---|
| Compact ~2B | ~2–4GB | 6GB | 12GB | Ultrabook integrated graphics, entry discrete GPU, 8GB unified memory |
| Compact ~4B | ~4–6GB | 6–8GB | 16GB | 8GB discrete GPU or 16GB unified memory to start |
| Sparse MoE ~26B, ~4B active | ~12–16GB | 16GB; 24GB for long context | 32GB+ | 16GB is worth trying, 24GB is more comfortable |
| Dense ~31B | ~20–24GB | 24GB | 48GB+ | 24GB and above |
Three extra points are worth noting.
First, the minimum VRAM for inference is only the floor for “loads stably and handles a medium-length conversation.” It does not mean long-document analysis, high-concurrency serving, or multimodal scenarios will also fit. Second, if you plan to do parameter-efficient fine-tuning, VRAM demand rises noticeably. A rough estimate is “quantized model size + a FP16/BF16 base copy + optimizer states and gradients”; if VRAM is short, consider parameter-efficient methods like low-rank adaptation on top of a quantized base. Third, you can’t size unified-memory devices by total memory alone. The CPU and GPU share the same pool, and the OS and GUI take a portion of it. As a rule of thumb, every 8GB of unified memory supports roughly 6GB of model plus cache. That means a 16GB device isn’t suited to a 16GB-class model, a 32GB device can usually run workloads under 24GB, and if you want to run a 24GB-class model stably, go with at least 64GB.
From this, a quick single-request rule of thumb follows:
available VRAM ≈ quantized model size × 1.5 + 2GB
This formula applies to single request, 16K–32K context, no multimodal input, no multiple instances, and no embedding/reranking auxiliary models. The 1.5 factor mainly covers KV Cache and framework runtime overhead; the extra 2GB is for multimodal input, fluctuation, and a safety margin. For multi-concurrency serving, don’t apply this formula directly—recompute using “model weights + single-request KV Cache × peak concurrency + vision/framework fixed overhead + safety margin.”
2. What actually makes up the VRAM cost
When you deploy an LLM locally, VRAM is consumed mainly by four parts: model weights, KV Cache, the vision encoder and multimodal input, and inference-framework runtime overhead. Official numbers usually cover only the first.
1. Model weights: 4-bit isn’t simply “parameters ÷ 2”
Bytes per parameter at common precisions are roughly:
- FP16/BF16: 2 bytes
- INT8/FP8: 1 byte
- 4-bit group quantization: ~0.5–0.6 bytes, including some metadata such as scale factors and zero points
- 3-bit/2-bit mixed or lower: ~0.4–0.5 bytes, but with higher quality risk
Rough 4-bit estimates:
- ~4B model: ~2.2–2.5GB weights
- ~26B sparse MoE model: ~13–16GB weights
- ~31B dense model: ~16–19GB weights
Actual values depend on two factors.
One is the quantization algorithm. Activation-aware quantization, per-channel scaling, group quantization, and mixed-precision retention can generally preserve more capability at a similar size. The other is which layers aren’t quantized. Embedding layers, output layers, normalization layers, and vision encoders sometimes stay in FP16; the smaller the model, the more noticeable their relative share.
Note the special case of sparse MoE models. Each token reads only the selected experts, so the weight reads during decoding can be far below the total parameter count. In bandwidth-limited scenarios like single-request, on-device inference, its generation speed can sometimes approach a dense small model of the same active size. But every expert’s weights must stay resident in VRAM—you cannot estimate VRAM as “total parameters × activation ratio.”
2. KV Cache: the biggest hidden cost in long context
Autoregressive generation reads the Key and Value cache of all prior tokens for every token it outputs. KV Cache grows linearly with context length and is the most easily overlooked cost in long-context scenarios.
A single request’s KV Cache can be estimated with this formula:
KV bytes = 2 × num_layers × num_kv_heads × head_dim × sequence_length × bytes_per_element
Take a model of a given parameter scale: hidden dimension 2048, 32 layers, head_dim 128, 4 KV heads, FP16 cache. The KV Cache per token is:
Per layer per token: 2 × 4 × 128 = 1024 elementsAcross 32 layers: 1024 × 32 = 32768 elementsFP16: 32768 × 2 = 65536 bytes = 64KB
So:
- 8K context is about 0.5GB
- 32K context is about 2GB
- 128K context is about 8GB
Here’s a note on GQA/MQA. KV Cache size depends mainly on the number of layers, KV heads, head_dim, sequence length, cache bit width, and concurrency. More shared groups and fewer KV heads generally mean smaller KV Cache per token; more KV heads, more layers, or larger head_dim mean larger per-token cache. MQA usually has very few or a single KV head, so its cache is smallest; GQA is a trade-off between quality and cache size. Don’t treat an implementation detail like “shared groups” as the deciding factor—look directly at the KV head count in the model config.
Peak VRAM in real serving also multiplies by concurrency. Inference engines support paged KV Cache management, splitting the cache into blocks allocated on demand, and queuing or preempting requests when VRAM runs low, but the capacity ceiling doesn’t change. Peak VRAM for online serving is roughly:
peak VRAM ≈ model weights + single-request KV Cache × peak concurrency + framework fixed overhead + safety margin
Local single-user multi-turn chat looks like there’s no concurrency, but accumulated history messages keep increasing KV Cache too, so you still need to reserve for it.
3. Vision encoder and multimodal input: one image can be a long run of tokens
Mid-size models with native image and video input usually include a vision encoder. At inference, the vision encoder often loads alongside the language model, taking anywhere from a few hundred MB to several GB. On a 4B-class model, this share can be very significant.
Before an image enters the language model, it’s split into a large number of visual tokens. The exact count depends on input resolution, tiling strategy, and vision encoding method. A high-resolution screenshot, a PDF page, or a long image can correspond to hundreds or even thousands of visual tokens. This has a few consequences:
- Prefill-phase transient activation VRAM rises noticeably, and time-to-first-token increases.
- The KV of visual tokens is written into the cache and repeatedly read during later generation.
- Processing multiple images at once or high-resolution long images can push peak usage to several GB.
So the minimum VRAM you measure with “no image loaded” doesn’t represent real usage in multimodal scenarios. If the business needs OCR, chart understanding, screenshot Q&A, or video-frame analysis, estimate by the worst-case input.
4. Framework runtime: a fixed cost you can’t skip
Beyond weights and cache, the inference framework takes extra VRAM. Common overheads include:
- CUDA graph capture, kernel compilation, and context initialization: hundreds of MB to more than 1GB.
- VRAM pool pre-allocation: some high-throughput serving frameworks reserve a large share of KV cache by default—around 90% of free VRAM as a cache pool—so the number nvidia-smi shows can be far higher than actual effective usage.
- Operator scratch buffers: attention, convolution, normalization, sampling, and other operators all create workspaces.
- Auxiliary models: retrieval-augmented generation setups often load an embedding model and a reranking model, adding up to roughly 1GB.
- Vision processor and multimodal preprocessor: image decoding, scaling, normalization, patch embedding, and so on also consume VRAM.
This is why the same model can differ by several GB in measured VRAM across frameworks, parameter settings, and quantizers. Before going live, it’s best to re-test with your own model, framework, and real inputs.
3. A quick VRAM budget script
The function below combines weights, KV Cache, vision overhead, framework fixed overhead, and a safety margin into a runnable estimator. The script defaults to 0.5 bytes per parameter for 4-bit group quantization and doesn’t add scale factors or zero points. If you want to include quantization metadata, pass quant_meta_gb. A common approach is to add 0.05–0.1GB per billion parameters.
def estimate_vram_gb(params_b, # total parameters (billions)bits=4, # weight quantization bit widthlayers=32, # number of layerskv_heads=4, # number of KV heads (grouped-query attention)head_dim=128,seq_len=32768, # target context lengthconcurrency=1, # concurrent requestskv_bits=16, # KV cache bit widthvision_gb=0.0, # vision encoder + multimodal input overheadoverhead_gb=1.5, # fixed framework runtime overheadmargin=0.15, # safety marginquant_meta_gb=0.0, # quantization metadata, e.g. scale factors, zero points):weights_gb = params_b * bits / 8 + quant_meta_gbkv_per_token = 2 * layers * kv_heads * head_dim * kv_bits / 8 # byteskv_gb = kv_per_token * seq_len * concurrency / (1024 ** 3)total = weights_gb + kv_gb + vision_gb + overhead_gbreturn round(total * (1 + margin), 2)# Example: sparse MoE model with ~26B total parametersprint(estimate_vram_gb(params_b=26)) # 18.98print(estimate_vram_gb(params_b=26, seq_len=8192)) # 17.25print(estimate_vram_gb(params_b=26, kv_bits=8)) # 17.83print(estimate_vram_gb(params_b=26, seq_len=131072)) # 25.88print(estimate_vram_gb(params_b=26, concurrency=4)) # 25.88print(estimate_vram_gb(params_b=26, quant_meta_gb=1.3)) # 20.47
These results raise a few points.
First, at 26B, 4-bit, 32K context, and single request, the default script estimates ~18.98GB—already close to 20GB. Running a 32K context on a 16GB card will be tight.
Second, 8-bit KV Cache halves the cache cost; in this example it drops from ~18.98GB to ~17.83GB. The trade-off is a small accuracy loss, worth evaluating for long-context scenarios.
Third, at 128K context or 4 concurrency, the estimate rises to ~25.88GB. At that point a 16GB GPU is essentially out, and even 24GB needs careful planning.
Fourth, if you add quantization metadata at 0.05GB per billion parameters, a 26B model gains about 1.3GB, for an estimate of ~20.47GB. At 0.1GB per billion, you’d need to raise it further. Adjust the script to match your actual quantizer output.
4. Choosing quantization precision: 4-bit is the cost-performance sweet spot
| Precision | Bytes per parameter | ~4B weights | ~26B weights | ~31B weights | Suitable for |
|---|---|---|---|---|---|
| FP16/BF16 | 2 | ~8GB | ~52GB | ~62GB | Fine-tuning, accuracy baseline |
| 8-bit weights | 1 | ~4GB | ~26GB | ~31GB | Accuracy-first single-GPU inference |
| 4-bit group quantization | ~0.5–0.6 | ~2.2–2.5GB | ~13–16GB | ~16–19GB | Mainstream local deployment |
| Below 4-bit | ~0.4–0.5 | ~1.8–2.2GB | ~11–14GB | ~13–16GB | Extremely constrained environments |
Three rules of thumb for choosing quantization precision.
First, 4-bit is usually the cost-performance sweet spot for local deployment. The stronger the base model’s capability, the better it typically tolerates quantization; but sparse MoE models can be affected at low bit widths by routing, expert activation, and quantization metadata, so you can’t extrapolate directly from dense-model experience—regression-test with your real tasks.
Second, when VRAM is short, prefer a smaller model or lower bit width over casually enabling weight offloading. Offloading weights in batches to memory or disk often isn’t worth it in interactive scenarios. Memory offloading is bandwidth-limited, and per-step latency can grow severalfold; disk offloading on a consumer SSD can take several seconds per token, suitable only for offline batch processing.
Third, always validate after quantization. At minimum, run a comparison round on your own typical tasks, watching especially instruction following, structured output, long-document summarization, JSON formatting, multilingual performance, and tool calling. These are the capabilities most prone to degradation after quantization.
5. Choosing a discrete GPU: match it to your VRAM tier
Which GPU for 4-bit and a 32K context?
If the goal is to run a 4-bit model locally with a stable 16K–32K context, judge by the tiers below.
| VRAM tier | Typical hardware examples | Runs stably | Runs cautiously | Not recommended |
|---|---|---|---|---|
| 6–8GB | RTX 3050, RTX 4050, RTX 4060 8GB, entry mobile discrete GPUs | 2B–4B compact models | 4B long context, light multimodal | 26B/31B models |
| 8–12GB | RTX 4060, RTX 3060 12GB, etc. | 4B model, 32K context | 26B model, if you confirm framework offloading and context limits | 31B model resident |
| 16GB | RTX 4060 Ti 16GB, RTX 4070 Ti SUPER 16GB, etc. | 26B-class 4-bit, 16K–32K | 31B model, generally not recommended | High-concurrency 31B |
| 24GB and above | RTX 4090, high-end workstation cards | 31B-class 4-bit, 32K context | 128K context needs focused KV testing | Consumer multi-GPU high throughput needs extra validation |
For 6–8GB entry-level discrete GPUs, prefer a compact 4B model. Leave about 2GB for context, CUDA graph capture, and runtime overhead. A 26B-class model needs 13GB+ even in 4-bit weights, so it can’t stay resident on an 8GB card and isn’t recommended as the default option.
For 8–12GB mainstream cards, a 4B model runs a 32K context stably and can also try light multimodal input. A 26B-class model for single-request inference typically needs 16GB; 12GB is better as a test machine than a stable serving box. If your main goal is fine-tuning, VRAM matters more than compute. 12GB can run a 4B-class model fine-tuning flow via low-rank adaptation on a quantized base; 8GB is better for on-demand cloud use or very light experiments.
For a 16GB mid-to-high-end single card, a 26B-class 4-bit model can usually load and output stably at 16K–32K context—a solid value tier for local use. But watch the ceiling: long context and higher concurrency make KV Cache grow fast. Keep max context within 32K, or set max sequence length, max concurrency, and a VRAM cap on the inference framework side.
For 24GB and above high-end single cards, a 31B-class 4-bit model can stay resident, with relatively comfortable headroom at 32K context and room for local fine-tuning. A 26B-class model can serve more concurrency or try 64K+ contexts. But a 128K-class context’s KV Cache can eat 8GB+, so plan against the business’s real lengths.
Is multi-GPU deployment worth it?
If a single card can’t fit, there are two common approaches.
- Tensor parallelism: split each layer’s weights and compute across multiple cards, sharing VRAM and compute together, but it demands high inter-card bandwidth.
- Pipeline/layer parallelism: place different layers on different cards, lower bandwidth demands, but it introduces pipeline bubbles and can hurt throughput.
Consumer multi-GPU setups usually connect over PCIe, where inter-card communication overhead is significant. This suits local inference that is “short on VRAM but not demanding on throughput,” rather than production serving that chases peak throughput. For high concurrency and high SLA, cloud multi-GPU or a dedicated inference platform is generally steadier.
6. Unified-memory devices: capacity sets the ceiling, bandwidth sets the speed
Unified-memory devices have no dedicated VRAM; the CPU and GPU share the same memory pool. The selection logic differs from discrete-GPU platforms and hinges on three points.
First, capacity determines whether it runs. The OS, GUI, drivers, and background processes take several GB, so usable capacity is often only 70%–80% of the rated value. Second, bandwidth determines generation speed. The decode stage is memory-bandwidth-bound—every token reads the model weights and the entire KV Cache—so memory bandwidth roughly sets the ceiling on token generation speed. Third, architecture and drivers determine efficiency. Support for unified memory varies noticeably across OSes, drivers, and inference frameworks; newer platforms are usually better in media engines, operator support, and memory efficiency.
| Unified memory capacity | Approx. usable memory | Recommended model shape | Notes |
|---|---|---|---|
| 8GB | ~6GB | Compact ~2B | Only for minimum validation |
| 16GB | ~12GB | Compact ~4B to start | Enough for daily chat |
| 32GB | ~24GB | 26B-class worth trying | Noticeable improvement over 16GB |
| 64GB | ~48GB | 26B and 31B both viable | Quality-focused personal first choice |
| 96GB–128GB | ~72–96GB | 31B long context, multi-instance | Workstation/studio-class config |
Also keep in mind when using unified-memory devices:
- A single model process’s usable VRAM/memory ceiling can be lower than total capacity; before running a 31B-class model, confirm the device supports the corresponding large-model workload.
- Available memory differs noticeably across OSes and drivers. Windows, macOS, and Linux differ in policies for graphics memory, shared memory, and swap, so go by official documentation and your own measurements.
- Enabling memory compression, swap, or virtual memory can make the system “look like it runs,” but may cause stutter, latency jitter, and even stability issues. For interactive inference, don’t rely on swap long-term.
- Unified-memory platforms suit personal development and privacy-sensitive, data-sovereign scenarios; but for batch processing and multi-concurrency serving, they usually fall short of a same-priced discrete-GPU server.
7. Cloud deployment: when not to buy a card
Local deployment isn’t the best fit for every scenario. In these cases, on-demand cloud GPU instances are often the better choice:
- The load has clear tides—high concurrency by day, idle by night—so dedicated hardware utilization is low.
- You need multi-model, multi-version parallel evaluation, with fluctuating temporary compute needs.
- You need a stable SLA, elastic scaling, monitoring and alerting, and unified operations.
- You don’t want to bear hardware depreciation, data-center hosting, power, and operations costs.
- Data compliance, data residency, or a clear business case for the cloud applies.
If you choose the cloud, proceed in stages.
Step one, validate. Use on-demand instances to get the inference pipeline working, confirming model quality, latency baseline, quantization accuracy, and VRAM levels. Step two, optimize. Based on measured VRAM usage, throughput, time-to-first-token, and concurrency, pin down instance specs, batching strategy, context limits, and KV Cache strategy. Step three, stabilize. Containerize the inference service, wire in logs, metrics, and alerts, and build observability; model weights, quantization versions, and configs should go under unified version control so behavior stays consistent across environments.
When selecting, focus on four conditions: whether cost is predictable, whether data residency is compliant, whether the SLA meets business needs, and whether the operations responsibility boundary is clear. Don’t look only at the GPU model—also weigh network, storage, inference framework, image management, and failure recovery.
8. Common mistakes and a troubleshooting checklist
| Symptom | Common root cause | Fix |
|---|---|---|
| Crashes after one or two sentences | Cache grows with the conversation and exceeds the VRAM headroom | Reserve for target context; set a max context |
| Out-of-memory error at startup | The framework reserves a cache pool as a share of free VRAM | Lower the VRAM-usage fraction; disable unneeded graph capture |
| Loads but generates extremely slowly | Weights are being offloaded to memory or disk | Pick lower precision or a smaller model, or reduce offloaded layers |
| Smooth day to day, freezes on a long document | Prefill-phase activation VRAM spikes | Cap single-input length; enable chunked prefill and cache reuse |
| Latency spikes after multiple users go live | Concurrent KV Cache multiplies | Add VRAM, cap concurrency, enable request queuing |
| Worse JSON or formatting after quantization | Low-bit quantization causes capability degradation | Raise precision, switch base models, and run task-level regression |
| nvidia-smi shows VRAM almost full | The framework pre-allocates a VRAM pool | Check actual request throughput; adjust the VRAM-usage fraction |
A few basic commands and parameters help when troubleshooting.
# Check GPU VRAM and utilizationnvidia-smi --query-gpu=name,memory.used,memory.total,utilization.gpu --format=csv -l 1# Check process-level memory/VRAM pressureps aux --sort=-%mem | head -n 10# Check memory pressure on unified-memory devicesfree -h
Parameters differ across frameworks, but the approach is the same. With vLLM, watch the VRAM-usage fraction, max model length, and max concurrency. With llama.cpp/GGUF, watch context length, GPU layers, and memory-locking policy. For unified-memory inference, check whether memory mapping is enabled, whether swap exists, and whether a per-process cap is set. The key isn’t memorizing one parameter—it’s first knowing how much “weights + KV + vision + framework overhead” each takes.
Before going live, run this self-check list.
- Are all four items counted: weights, target-context KV Cache, vision encoder, and runtime overhead?
- Is KV Cache estimated by peak concurrency rather than average?
- Is at least a 15% VRAM margin reserved?
- Have you validated quantization quality on your own real corpus and input lengths?
- Have you tested time-to-first-token, generation speed, and long-document scenarios?
- Local or cloud: have you weighed utilization, long-term cost, compliance, and SLA?
9. Conclusion: the estimation method matters more than the number
“There’s no single answer for how much VRAM a model needs.” The more accurate question is: “On my hardware, at my context length and concurrency, with which quantization tier, can it stably produce acceptable speed?”
Fill in the parameters for your target scenario and estimate first, then match it to the hardware-tier tables. That basically avoids two common mistakes: buying a high-VRAM card only to find the framework can’t use it, or buying a small card only to find you’re one tier short. Models iterate far faster than the hardware refresh cycle, so owning the estimation method yourself has more long-term value than remembering any single day’s VRAM figure.
