VRAM Requirements for Local LLMs: A Practical Hardware Selection Guide from Beginner to Advanced
This guide explains how to estimate the GPU memory (VRAM) a large language model needs to run locally. It covers the three main memory components, shows approximate footprints for common model sizes at 4-bit quantization, maps model sizes to VRAM tiers from under 4GB to 24GB and above, and lists ways to reduce memory use when hardware falls short.
1. Why VRAM Is the First Constraint for Local Inference
Many developers who run a large language model locally for the first time focus only on parameter count and overlook VRAM, which is the hard limit. Insufficient disk space can be solved by adding a drive, and insufficient RAM can be offset with a swap partition, although that is slow. Insufficient VRAM is different. The inference process either fails with an error, or it is forced to offload large amounts of weights to system RAM, which can slow generation by several times or make the model unusable.
With that in mind, model selection becomes straightforward: first determine how much VRAM you have, then work out which model size you can run reliably, instead of choosing a model first and hoping the hardware can handle it.
2. What Makes Up VRAM Usage
To estimate VRAM requirements accurately, break total usage into its parts:
1. Model weights. This is the largest component. Weight memory is roughly the parameter count multiplied by the bytes per parameter. At full precision (FP16), each parameter takes 2 bytes. At 8-bit quantization, it takes about 1 byte, and at 4-bit quantization, about 0.5 bytes. A 7-billion-parameter model needs about 14GB in FP16 and about 4GB at 4-bit.
2. KV cache. During inference, the attention mechanism stores key and value pairs for previous tokens. This cost grows linearly with context length and the number of concurrent requests. Increasing the context from 4K to 32K can multiply KV cache size by eight. This is the main reason many users can start a model but run out of VRAM when they process long texts.
3. Inference framework and runtime overhead. This includes the compute graph, temporary tensors, and memory pool reservations. It usually adds 1 to 2GB, depending on the framework implementation and parallelism strategy.
A practical rule of thumb is: quantized weights + KV cache + 1 to 2GB of headroom ≈ actual VRAM required. When selecting hardware, leave an extra safety margin of about 15% on top of that estimate.
3. VRAM Requirements by Model Size
Based on this estimation method, the typical footprints of common model sizes under popular quantization schemes are roughly as follows:
| Parameter Scale | Weights at 4-bit | Total Footprint with Runtime | Recommended VRAM Tier | Best For |
|---|---|---|---|---|
| ~2B | ~2GB | ~2–4GB | Under 4GB | Verifying the smallest working setup |
| ~4B | ~3GB | ~4–6GB | 6GB to start | Most people’s first local experience |
| ~26B | ~13GB | ~14–16GB | 16GB, for more headroom | Stronger reasoning without the heaviest models |
| ~31B | ~17GB | ~20–24GB | 24GB or more | Output quality, coding, and long context |
The “Total Footprint with Runtime” column already includes KV cache for a medium context length (8K to 16K tokens). Even so, leave a buffer rather than configuring hardware right at the lower bound.
4. Working Backward from VRAM Tiers
Under 4GB: Get the Workflow Running First
This tier only suits 2B-class models at 4-bit quantization. The goal is to confirm that the toolchain works: the model loads, responds to chat, and connects to an API. Output quality is not the focus. After the workflow is verified, decide whether to upgrade hardware.
Around 6GB: The Main Tier for Getting Started
At this tier, run a quantized 4B-class model. Larger models might technically fit, but starting with one by default often leads to out-of-memory errors. Debugging those failures costs far more time than building experience with a small model first. This tier handles everyday Q&A, simple writing assistance, and basic code completion.
8GB to 12GB: Room to Explore, but Watch Hidden Costs
A 4B-class model remains the most stable choice. You can also check whether a quantized version of a larger model is feasible. Keep in mind that context length and runtime overhead matter here, so do not push right to the limit. For example, if the model weights take 10GB, 12GB may look sufficient. However, a long context adds KV cache on top of that, and the total can easily exceed available VRAM. The usual symptom is a process crash partway through a conversation.
12GB to 16GB: Mid-Sized Models Become Worth Trying
At this tier, a 26B-class model enters the range worth trying seriously. Keep in mind that a model that starts is not necessarily a model that runs reliably, and a model that runs reliably is not necessarily fast enough to be useful. Judge performance by actual tokens generated per second, not by the advertised configuration. If generation drops to only a few tokens per second, the experience will be painful. In that case, a smaller model that runs smoothly is the better choice.
24GB and Above: The Comfort Zone for Large Models
A 31B-class model is worth serious consideration at this tier. Models in this range clearly outperform mid-sized ones on complex reasoning, code generation, and long-document understanding, which makes them a good fit for advanced users who care about output quality. If you need a longer context window or want to serve multiple concurrent requests, a configuration with 32GB or more may be worth considering.
5. Ways to Reduce VRAM Usage
If the target model does not fit in your current VRAM, consider these general strategies:
- More aggressive quantization: Moving from 8-bit to 4-bit, or lower, significantly reduces weight size. The cost is some loss in accuracy. For most cases, 4-bit is the point of best value.
- Shorter context length: KV cache grows linearly with context. Reducing the window from 32K to 8K often frees several gigabytes of VRAM.
- Layer offloading: Run some layers in system memory. VRAM pressure drops, but inference becomes noticeably slower. This approach suits low-frequency testing.
- Cloud services: If you only occasionally need a large model and your local hardware is limited, on-demand cloud GPU resources can be more economical than a one-time hardware upgrade. Check the relevant documentation from the provider for current availability and pricing.
6. Conclusion
The goal of choosing a local LLM is not to run the most powerful model possible. It is to run the most capable model you can while keeping generation stable and responsive. A sound approach is to estimate your VRAM ceiling, choose a model that fits your tier, leave a safety margin, measure actual inference speed, and adjust quantization or context length as needed. Following this process produces more practical productivity than chasing the largest parameter count.
