Practical Guide to VRAM Requirements and Quantization for Local LLM Deployment

    This guide explains why loading a local model successfully is not the same as running it reliably. It breaks down inference VRAM into weights, KV cache, activations, and framework overhead, provides a first-pass budget by parameter scale and quantization bit width, and outlines deployment strategies for different VRAM tiers. It also covers sparse-activation models, unified-memory devices, a reusable testing process, and what to adjust first when VRAM is insufficient.

    1. Why Loading a Model Is Not the Same as Running It Reliably

    A common mistake in local LLM deployment is treating the download size of a model as the VRAM requirement. In reality, after the weights are loaded, inference also needs to keep the conversation history, create computation buffers, and pay the memory overhead of the runtime framework itself.

    VRAM planning should answer at least three questions:

    • Can the model weights fit in device memory?
    • Can inference run continuously at the target context length and concurrency?
    • Is the generation speed and response latency acceptable for the intended use?

    For personal use, completing a few short conversations may be enough. For code analysis, long-document processing, or an internal service, a successful startup is rarely enough. A configuration should be designed for the actual workload, not just for the parameter count.

    Also note that models with similar parameter counts can behave differently because of architecture-specific cache layouts, quantization support, and runtime behavior. The estimations below are a general budgeting method, not a measured promise for any specific model.

    2. What Actually Consumes VRAM

    Inference VRAM can be approximated as:

    Total VRAM ≈ weights + context cache + activations and workspace + framework overhead + other components.

    Weights

    Weights are usually the easiest part to estimate. If a model has P parameters and each parameter is stored in b bits, the theoretical weight size is:

    Weight bytes ≈ P × b ÷ 8.

    For example, 4 billion parameters at 16 bits is about 8GB; 4 billion parameters at 4 bits is about 2GB. But 4-bit quantization does not mean every byte in the file is packed at exactly 4 bits. Scaling factors, group metadata, unquantized layers, alignment padding, and even temporary copies during loading can add extra usage. Some loading paths may create temporary copies, so peak memory during loading can be higher than steady-state inference. The theoretical formula is useful for a first filter, not for purchase decisions.

    KV Cache

    Autoregressive generation usually stores keys and values from attention, often called KV cache. Its purpose is to avoid recomputing the entire history for every new token. In common uncompressed implementations without cross-request cache sharing:

    KV cache bytes ≈ 2 × layers × KV heads × head dimension × cached tokens × bytes per element × concurrent sequences.

    The factor 2 accounts for keys and values. If concurrent requests have different lengths, a more accurate approach is to sum the cached token counts of each sequence.

    This formula shows that longer contexts and more concurrent requests usually mean a larger cache. However, windowed attention, cache compression, and shared prefixes can change actual usage, so do not apply this single formula mechanically to every architecture. Weight quantization and KV cache quantization are different decisions. If a model uses 4-bit weights, that does not automatically make the KV cache 4-bit.

    Compute and Framework Overhead

    Inference also uses temporary activations, operator workspace, and device memory pools. The peak memory during input preprocessing can differ from the peak during token-by-token generation, so long inputs should be tested separately.

    Some frameworks preallocate a large cache or memory pool. Therefore, distinguish memory actually used from memory reserved by the framework; a single monitoring number is not enough. If the GPU also drives a display, or other applications are using acceleration resources, the VRAM available to the model will be smaller.

    3. First-Pass Budget by Parameter Scale

    The table below shows theoretical weight sizes at different parameter scales, in decimal GB. It does not include quantization metadata, KV cache, or runtime overhead, and it does not correspond to any specific product.

    Parameter scale 16-bit theoretical weights 8-bit theoretical weights 4-bit theoretical weights
    2B ~4 GB ~2 GB ~1 GB
    4B ~8 GB ~4 GB ~2 GB
    13B ~26 GB ~13 GB ~6.5 GB
    30B ~60 GB ~30 GB ~15 GB

    If a device reports GiB, these GB values are not exactly the same: 1 GiB = 2^30 bytes. When building a boundary configuration, unify the units first.

    The important conclusion is that quantization significantly reduces weight size, but it does not eliminate context and runtime overhead. A model with about 15GB of theoretical weights cannot be assumed to run stably on a 16GB device. A more realistic method is to estimate weights first, then reserve space for the target context, concurrency, and runtime overhead, and finally verify the usable range with actual tests.

    4. Deployment Strategy by VRAM Capacity

    4GB to 6GB: Validate Small Models and Short Contexts

    This tier is suitable for establishing a minimal runnable pipeline: model loading, single-turn Q&A, and simple text processing. Start with a small model at a low quantization bit width, limit input and output length, and keep concurrency at one request. If the model can start only with very short input and then reports out-of-memory as soon as conversation history increases, the configuration has no usable margin.

    Do not choose a large parameter count if it requires frequent weight swapping between host memory and VRAM. It may be technically possible, but interactive latency is often unacceptable.

    8GB to 12GB: Evaluate Daily Single-User Workloads

    At this tier, a larger quantized model is possible, but avoid simultaneously pursuing maximum parameter count, maximum context, and multiple concurrent requests. Define the use case first, then choose the configuration. Short text rewriting may be more sensitive to latency; multi-turn conversations need tighter history control; code analysis may need both a generous input budget and a generous output budget.

    Remember to include generation in the total sequence length. Testing only that an input can be processed without reserving space for later output can still exhaust VRAM during generation.

    16GB: More Choices, but Still Manage Context

    This tier can usually hold more quantized weights and cache. It is reasonable for serious evaluation of medium-sized models. However, more VRAM does not automatically mean every long-context task will run. Pay attention to peak usage during long-input preprocessing and cache growth after many turns. For long interactions, limit history length, use summary compression, or retrieve relevant segments to reduce irrelevant context.

    24GB and Above: Larger Models and More Cache Budget

    At higher capacities, model size, context length, and concurrency can be adjusted more freely, but they still compete for the same resource. A personal user may prefer a higher-quality model; a multi-user service may work better with a smaller model plus modest concurrency. More VRAM does not mean you should always load the largest possible model.

    Compare actual task quality, time to first token, and sustained generation speed instead of comparing parameter counts only.

    5. Sparse-Activation Models: Compute Scale Is Not Storage Scale

    Some models use sparse activation architectures: each token activates only part of the parameters for computation. This may reduce computation per token, but it does not mean only activated parameters need to be stored. If all expert weights reside in VRAM, the capacity budget is still mainly determined by total parameters. Only with strategies such as tiered placement, on-demand loading, or expert offloading does device memory decrease, and those strategies may add data-transfer overhead.

    For these models, look at three metrics separately:

    • Total parameter count: affects weight storage requirements.
    • Activated parameters per token: affects part of the compute cost.
    • Weight placement strategy: affects VRAM usage and transfer latency.

    Do not calculate the full model VRAM requirement from activated parameters alone, and do not use activated parameters alone to guarantee generation speed.

    6. Unified-Memory Devices: How to Budget Capacity

    On unified-memory architectures, the CPU and graphics compute units share physical memory, so the device’s nominal memory should not all be considered available to the model. The OS, desktop applications, inference framework, model weights, and cache all compete for the same memory. Also check whether the runtime has a limit on device-addressable memory.

    A simple budget is:

    Usable model memory ≈ physical memory - system and application usage - safety margin.

    On a 16GB unified-memory device, a small quantized model is usually the safer choice. On 32GB, there is more room for medium-sized model experiments. Higher capacity helps with larger models and longer contexts. These are only capacity-level directions, not speed guarantees.

    Unified memory is not unlimited bandwidth even when capacity is adequate. Generation speed may still be limited by memory bandwidth and compute. If the system has to rely heavily on swap, latency usually degrades sharply; that state should not be treated as a stable deployment.

    7. Build a Reusable Test Procedure

    Instead of searching for one isolated VRAM number, build a repeatable test setup.

    Step 1: Record the Configuration

    Record at least parameter count, quantization bit width, quantization group size, context limit, cache precision, concurrency, weight offload policy, and runtime or framework versions. Without these, results from different tests are hard to compare.

    Step 2: Measure Loading Peak

    Record memory usage before loading, during loading, and after loading completes. This helps separate temporary conversion overhead from resident model usage. Avoid checking only the stable state and missing startup failure risk.

    Step 3: Increase the Load Progressively

    Start from a short input and a single request. Then increase input length, generation length, and concurrency. Change one variable at a time if possible. Watch peak VRAM, time to first token, and generation speed.

    Step 4: Validate Sustained Operation

    A single successful run is not proof of long-term stability. Test consecutive requests, different input lengths, and multi-turn conversations. Check for continuously growing memory, frequent offloading, or abnormal exits. Keep a representative task sample set to evaluate output quality after quantization. Deployment optimization should not only show how much memory was saved; it should confirm that quality on key tasks has not declined unacceptably.

    8. When VRAM Is Not Enough: What to Adjust First

    First close unrelated device usage and confirm actual available capacity. Then choose measures based on the cause of growth.

    • If the weights are too large, consider lower-bit quantization or a smaller model, but revalidate quality.
    • If VRAM grows quickly with input length, reduce context, generation limit, or concurrency first.
    • If the problem is mostly framework preallocation, inspect cache strategy and memory configuration.

    Partial weight offloading can relieve VRAM pressure, but it adds dependence on host memory, interconnect bandwidth, and scheduling. It is a resource tradeoff, not a free capacity expansion.

    Multi-GPU deployment also needs validation of parallelism support, device interconnect, and load distribution. The combined VRAM of multiple cards does not guarantee that a model will automatically use all of it.

    9. Final Selection: Target a Stable Operating Envelope

    A reliable local deployment is not one that just fits a model into memory. It should continue to deliver acceptable quality and speed under the target input length, output length, and concurrency.

    A useful decision order is:

    1. Clarify task requirements.
    2. Estimate weights and cache.
    3. Choose an initial configuration.
    4. Test peaks and latency.
    5. Leave a safety margin.

    If the device also handles other jobs, or if request lengths vary widely, avoid running close to the capacity limit. Compared with chasing the largest parameter count, a configuration with enough cache headroom, stable response, and validated task performance is more suitable for long-term use.