How Much VRAM for Local LLMs?
In this article
For running local language models, you need at least 8 GB of VRAM for a 7B-parameter model with 4-bit quantization, 12–16 GB for a 13B model, and 24 GB or more for a 30B+ model or for larger contexts. This is the practical baseline for comfortable use; with less VRAM, you can still run smaller models or rely on CPU offloading, but speed and context length will suffer.
Why VRAM Matters for LLMs
Large language models are essentially huge matrices of numbers. When you run one locally, the model weights must be loaded into memory that the GPU can access quickly. VRAM (video RAM) is that memory. If the model fits entirely in VRAM, inference is fast. If it doesn't, the system must swap data between VRAM and system RAM, which is dramatically slower. This is why VRAM is the single most important hardware factor for local LLM performance.
Beyond the weights, VRAM also holds the key-value cache, which stores attention data during generation. This cache grows with context length and batch size. So even if a model's weights fit, a long conversation or a large input document can push you over the VRAM limit.
How Model Size and Quantization Affect VRAM
Model size is usually described by the number of parameters (e.g., 7B, 13B, 70B). The raw memory needed for the weights is roughly:
- FP16 (16-bit floating point): ~2 bytes per parameter
- INT8 (8-bit quantization): ~1 byte per parameter
- INT4 (4-bit quantization): ~0.5 bytes per parameter
So a 7B model in FP16 needs about 14 GB just for weights, but in 4-bit it needs about 3.5 GB. This is why quantized models are so popular for local use. However, quantization reduces quality slightly, and some models degrade more than others. A common rule of thumb: use 4-bit if VRAM is tight, 8-bit if you have headroom, and FP16 only if you have plenty of VRAM and want maximum fidelity.
VRAM Requirements by Model Size
Here are approximate VRAM needs for running models with 4-bit quantization (the most common choice for local use), including overhead for the key-value cache and CUDA context:
- 1–3B models (e.g., TinyLlama, Phi-3-mini): 4 GB VRAM is enough, even 2 GB might work with aggressive quantization.
- 7B models (e.g., Llama 3 8B, Mistral 7B): 8 GB VRAM is the sweet spot. You can run them on 6 GB with a smaller context, but it will be tight.
- 13B models (e.g., Llama 2 13B): 12–16 GB VRAM recommended. 10 GB can work with a short context.
- 30B–34B models (e.g., Yi-34B, Mixtral 8x7B): 24 GB VRAM is the practical minimum for decent speed. 48 GB is comfortable.
- 70B models (e.g., Llama 3 70B): 48 GB VRAM is needed for 4-bit, and even then context length is limited. Many people run these on multiple GPUs or use CPU offloading.
These numbers assume you are using a modern inference engine like llama.cpp or Ollama with GPU acceleration. The exact requirement varies by model architecture, context length, and batch size.
What If You Don't Have Enough VRAM?
If your VRAM is below the recommended amount, you have several options, each with trade-offs:
- CPU offloading: Tools like llama.cpp can offload some layers to the CPU. This lets you run a model larger than your VRAM, but speed drops significantly. For example, a 70B model on a CPU with 64 GB RAM might generate a few tokens per second, versus 20+ on a GPU.
- Smaller context length: Reducing the context window (e.g., from 8192 to 2048 tokens) frees up key-value cache memory, allowing a larger model to fit.
- More aggressive quantization: Some tools support 3-bit or 2-bit quantization, but quality degrades noticeably. Use only if necessary.
- Use a smaller model: A 7B model with 4-bit quantization can run on 8 GB VRAM and is often sufficient for many tasks like summarization, code generation, and chat.
How to Choose the Right VRAM for Your Use Case
Your ideal VRAM depends on what you plan to do:
- Casual chat and simple tasks: 8 GB VRAM is enough for a 7B model, which handles most everyday queries well.
- Code generation and more complex reasoning: 16 GB VRAM lets you run a 13B model or a 7B with a large context, which improves accuracy.
- Roleplay, creative writing, or long documents: 24 GB VRAM allows a 30B model or a 7B with an enormous context (e.g., 32k tokens).
- Research or experimentation with large models: 48 GB or more (e.g., RTX 6000 Ada, A6000, or multiple GPUs) is needed for 70B models.
Also consider that VRAM is not the only factor. Memory bandwidth (how fast data moves) affects token generation speed. A GPU with high VRAM but low bandwidth (like some older cards) may still be slow.
Common Misconceptions About VRAM and LLMs
Misconception 1: “You need a top-end GPU to run any LLM.” False. Thanks to quantization, even a 6 GB GTX 1660 can run a 7B model at acceptable speeds. The key is choosing the right model size and quantization.
Misconception 2: “More VRAM always means faster.” Not exactly. If the model fits in VRAM, adding more VRAM doesn't speed things up. Speed is limited by compute and memory bandwidth. However, more VRAM allows larger models or longer contexts, which can indirectly improve quality.
Misconception 3: “You can use system RAM as VRAM.” Some tools allow CPU offloading, but this is not the same as VRAM. The CPU and system RAM are much slower for this workload, so you get a significant performance hit.
Costs and Hardware Considerations
VRAM is a major factor in GPU price. Cards with 8 GB (like RTX 3060 Ti) are budget-friendly, while 24 GB cards (like RTX 3090 or 4090) are expensive. If you're on a tight budget, consider buying a used GPU or using a cloud service for occasional large-model runs. Also note that some laptops have GPUs with lower power limits, which can affect sustained performance.
When building a system for LLMs, prioritize VRAM over raw compute. A used RTX 3090 (24 GB) is often a better choice than a newer RTX 4070 (12 GB) for LLM work, because the extra VRAM lets you run larger models.
Frequently Asked Questions
Can I run a 7B model on 4 GB VRAM?
Yes, but with limitations. You can use 4-bit quantization and a very short context (e.g., 1024 tokens). You may also need to offload some layers to CPU. Expect slow generation speeds, but it is possible.
Is 16 GB VRAM enough for local LLMs?
Yes, 16 GB is a sweet spot. It runs 13B models comfortably and even 30B models with 4-bit quantization and a short context. It's also enough for 7B models with very long contexts (32k tokens).
Does VRAM affect output quality?
Indirectly. If you have less VRAM, you might have to use a smaller model or more aggressive quantization, which can reduce quality. But if the model fits, VRAM doesn't change the output quality—only the speed and context length.
Can I use multiple GPUs to combine VRAM?
Yes. Tools like llama.cpp and Hugging Face's accelerate support multi-GPU inference. You can split a model across two 12 GB GPUs to run a 24 GB model. This is often cheaper than buying one large GPU.
Is it better to buy a GPU with more VRAM or a faster one?
For LLMs, VRAM is more important than raw speed. A slower GPU with 24 GB VRAM will let you run larger models, which often matters more than speed. However, if you only run small models, a faster GPU with less VRAM might be better for speed.
What is the minimum VRAM for a 70B model?
With 4-bit quantization, a 70B model needs about 35 GB for weights plus overhead, so 48 GB VRAM is the practical minimum. You can run it on less with CPU offloading, but it will be very slow.