VRAM Requirements and Hardware Selection for Running Mixture-of-Experts LLMs Locally
This guide explains how to estimate memory needs when running large language models locally. It covers why parameter count alone does not predict memory use, the main components of runtime memory, recommended model sizes for different GPU VRAM and unified memory tiers, the effects of quantization and context length, and a checklist for testing a deployment before regular use.
1. Why Parameter Count Cannot Directly Equal Memory Requirements
When deploying a large language model locally, many people estimate memory by multiplying the number of parameters by the bytes each parameter uses. This method gives a theoretical starting point, but it does not reflect actual runtime requirements.
Real memory usage typically comes from the following components:
Model weights
Model weights are the largest fixed cost. With half-precision storage, each parameter typically needs about 2 bytes. With 8-bit quantization, it needs about 1 byte. With 4-bit quantization, it theoretically needs about 0.5 bytes.
Quantization metadata
Quantization does not simply compress each parameter into a fixed number of bits. In practice, inference also stores scaling factors, group information, biases, and other auxiliary data, so actual usage is higher than the theoretical value.
KV cache
During text generation, the model stores the context states it has already processed. This is usually called the key-value (KV) cache. The longer the context and the more concurrent sessions, the more memory the cache uses.
Runtime workspace
The inference framework needs space for matrix computation, operator scheduling, temporary tensors, and memory alignment. Even if the model weights fit in VRAM, startup can still fail when the workspace is insufficient.
System and graphics overhead
A GPU is not reserved exclusively for the model. Display output, drivers, the desktop environment, and other programs may already use part of the VRAM. The rated capacity therefore cannot all go to loading the model.
Whether a model can be loaded and whether it suits long-term use are different questions. The first only requires that the weights barely fit. The second also considers context length, speed, concurrency, and stability.
2. Resource Ranges for Models of Different Sizes
The values below assume common 4-bit quantized inference. Actual results depend on the quantization format, the inference framework, the context length, and how the model is run. Use them only as a rough guide for selection.
| Model size | Quantized weights and base runtime usage | Recommended hardware tier | Typical use cases |
|---|---|---|---|
| About 2B | About 2–4 GB | 4 GB-class VRAM or higher | Workflow testing, lightweight Q&A, edge devices |
| About 4B | About 4–6 GB | 6 GB-class VRAM, or 16 GB unified memory | Everyday chat, simple code assistance |
| About 26B MoE | About 12–16 GB | 16 GB-class VRAM, or 32 GB unified memory | Stronger reasoning, code analysis, complex tasks |
| About 31B | About 20–24 GB | 24 GB-class VRAM, or 64 GB+ unified memory | Quality-focused use, long context, complex reasoning |
In a mixture-of-experts (MoE) model, the total parameter count differs from the number of parameters activated for each inference step. Some MoE models have a large total parameter count but activate only part of their computation paths at a time. The model weights usually still need to be loaded in full, so you cannot estimate memory from the active parameter count alone.
3. Choosing a Model by GPU VRAM
1. 4 GB to 6 GB VRAM
This tier suits quantized models of about 2B to 4B parameters.
Models of about 2B are usually easier to start. They work well for testing a local inference workflow, checking API calls, and handling simple text tasks. Models of about 4B are more practical on a 6 GB device, but you should still avoid setting a long context from the start.
Recommended setup:
- Prefer 4-bit quantization.
- Keep the initial context short.
- Turn off unnecessary concurrent requests.
- Reserve at least a few hundred MB to 1 GB of VRAM for the system and runtime.
- If loading fails, first reduce the context length or switch to a more compact quantization format.
This tier is not suitable for high model quality. Even if an about 26B model runs by offloading part of its weights, generation speed may drop significantly. The experience is usually worse than running a smaller model.
2. 8 GB to 12 GB VRAM
This tier runs about 4B models reliably and lets you start testing low-bit quantized versions of larger models.
Although 8 GB and 12 GB differ by only 4 GB, the difference matters for deployment. 12 GB leaves more room for the context cache and runtime workspace, so the setup is often more stable than one that just barely loads.
Recommendations:
- For daily use, prefer an about 4B model.
- When testing larger models, start with a shorter context.
- Do not keep VRAM usage close to 100% for long periods.
- For code tasks and multi-turn conversations, keep enough space for the cache.
- If inference speed is too low, check whether the model is offloading heavily to host memory.
When VRAM is insufficient, some frameworks automatically move part of the weights to system memory. This avoids immediate errors, but it increases data transfer. Time to first token and generation speed both drop.
3. 12 GB to 16 GB VRAM
This range is a reasonable place to try an about 26B MoE model.
At 4-bit quantization, the weights and base runtime usage of an about 26B model already come close to the upper limit of this tier. Smaller cards in this range may only support short contexts and a single session. A 16 GB card has more room, but you still cannot allocate all of its capacity to the weights.
Recommendations for deployment:
- Reserve about 1 GB to 2 GB for the runtime.
- Test startup first with a short context.
- Check the actual VRAM usage after loading finishes.
- Increase the context gradually rather than setting a large value at once.
- Prioritize single-user interaction over multi-user concurrent serving.
- Focus on sustained generation speed, not only on whether the model starts.
If you use the model mainly for code completion, long document analysis, or multi-turn conversations, the KV cache may become the bottleneck. In that case, even if the weights already fit in VRAM, increasing the context further can still cause out-of-memory errors.
4. 24 GB and above
24 GB of VRAM is a common starting point for running about 31B quantized models.
This tier provides relatively ample space for weights, cache, and temporary workspace. It suits developers who need higher output quality. However, 24 GB does not mean every context length and concurrency setting can be pushed to the maximum.
For longer context or parallel handling of multiple sessions, consider the following:
- Higher-capacity VRAM;
- Lower-bit quantization;
- Limits on concurrency;
- Paged cache or tiered memory strategies;
- Splitting the model
