A Guide to VRAM Requirements for Local LLM Deployment: How Much Memory Does Each Model Size Need?

    This guide explains why official memory figures for large language models often overstate local requirements. It breaks VRAM usage into model weights, KV Cache, activations, and runtime overhead, then provides an estimation formula, hardware recommendations by VRAM tier, guidance for unified memory systems, and practical deployment tips.

    1. Why Official Figures Are Hard to Apply Directly

    Model documentation usually lists the VRAM needed for the original-precision weights. Common precisions include 16-bit floating point (BF16 or FP16), where each parameter takes 2 bytes. For example, a 30B-parameter model needs about 60GB of VRAM for weights alone, which is far more than most personal devices offer.

    In local deployment, most people use quantized versions that compress the weights to 8-bit or 4-bit. The weight footprint of the same model can drop to one-half to one-quarter of its original size. Choosing hardware by comparing against original-precision figures therefore tends to overestimate requirements, and it does not reflect the actual footprint after quantization.

    2. What Makes Up VRAM Usage

    When running a large language model, VRAM is used mainly for four components:

    1. Model weights: Directly tied to the parameter count and quantization bit width. They usually account for the largest share.
    2. KV Cache: Stores intermediate results of attention computation. Its size grows linearly with context length.
    3. Activations and temporary buffers: Intermediate tensors produced during inference. They increase as concurrent requests or batch sizes grow.
    4. Runtime overhead: VRAM used by the inference framework, the drivers, and the runtime environment. This typically ranges from a few hundred MB to over 1GB.

    Many people focus only on the first item. In practice, runs often fail because the other three exceed expectations.

    3. A Rough Estimation Formula

    You can estimate total VRAM requirements with the following approach:

    Total VRAM ≈ (Weight VRAM + KV Cache VRAM) × (1 + activation buffer ratio) + runtime overhead

    Here, Weight VRAM = parameter count (in billions) × quantization bit width ÷ 8, with the result in GB.

    Example code:

    1. def estimate_vram_gb(
    2. params_b: float, # Number of parameters, in billions
    3. weight_bits: int, # Quantization bit width, such as 4, 8, or 16
    4. ctx_len: int, # Context length, in tokens
    5. num_layers: int, # Number of Transformer layers
    6. kv_heads: int, # Number of KV heads
    7. head_dim: int, # Dimension of a single attention head
    8. kv_bytes: int = 2, # Bytes per element in the KV Cache
    9. overhead_gb: float = 1.0, # Runtime overhead
    10. activation_ratio: float = 0.1, # Ratio for activations and buffers
    11. ) -> float:
    12. weight_gb = params_b * weight_bits / 8
    13. kv_gb = 2 * num_layers * kv_heads * head_dim * ctx_len * kv_bytes / 1024**3
    14. base = weight_gb + kv_gb
    15. return base * (1 + activation_ratio) + overhead_gb
    16. # Example (structural parameters such as layer count are assumed values): ~30B parameters, 4-bit quantization, 8K context
    17. print(round(estimate_vram_gb(30, 4, 8192, 60, 8, 128), 1))

    The example above yields about 19.6GB. This is only a reference value. Actual usage also depends on the framework implementation and the specific model architecture, so measured results should be the final judge.

    4. Choosing by Discrete GPU VRAM Tier

    About 6GB of VRAM: Start with a 4B-class model using 4-bit quantization. Total usage typically runs around 3 to 4GB, which leaves some headroom. 7B to 8B models will be tight, so you will need to limit the context length.

    8GB to 12GB of VRAM: 8B-class quantized models run comfortably. 13B-class quantized models are worth trying, but you need to keep the context length in check and reserve enough headroom for runtime overhead.

    12GB to 16GB of VRAM: 14B-class quantized models run comfortably. The weights of a 30B-class 4-bit model already approach 15GB, so once the cache and overhead are added, 16GB of VRAM will be very tight.

    24GB or more: 30B-class 4-bit quantized models can run at a reasonable context length. Larger models usually require a trade-off in quantization bit width or the use of multiple GPUs.

    Note that being able to load a model does not mean it runs stably. Peak usage only appears during long-context inference, so test your choice against your longest realistic task.

    5. Choosing Hardware with Unified Memory

    Devices with a unified memory architecture share one memory pool between the CPU and GPU. The capacity available to the model equals total memory minus what the system uses. Two factors matter:

    1. Capacity determines whether the model fits: Weights plus KV Cache must fit within the available memory.
    2. Bandwidth determines generation speed: Each generated token requires reading the model weights once, so memory bandwidth sets the upper limit on speed.

    You can roughly estimate the speed ceiling as follows:

    Theoretical maximum generation speed ≈ memory bandwidth ÷ bytes of weights read per token

    Example: Assume the weights are about 15GB and memory bandwidth is about 200GB/s. The theoretical ceiling is then about 13 tokens/s. Actual speed will be lower, because computation, cache access, and other overhead also matter.

    For mixture-of-experts models, each token activates only a subset of parameters, so less data is read per token. Generation may therefore be faster than a dense model with the same total parameter count. However, all weights must still fit in memory, so the capacity requirement does not decrease. This is easy to overlook.

    6. Effects of Context Length and Concurrency

    Context length is the variable people most often underestimate. KV Cache grows linearly with context length. Expanding from 4K to 32K multiplies that portion of memory by about 8. If you serve several requests at once, each request holds its own KV Cache, so the memory pressure adds up.

    We recommend the following:

    • Set a context limit based on your actual use case. Do not default to the maximum the model supports.
    • Evaluate long-document tasks separately. Split them into segments when necessary to avoid filling VRAM in one pass.
    • For concurrent requests, first measure the peak for a single request, then multiply by the number of concurrent requests to estimate total demand.

    7. Practical Recommendations

    1. Validate the driver, inference environment, and runtime parameters with a small model first, then scale up gradually.
    2. Keep about 15% to 20% VRAM headroom to prevent crashes when peaks occur.
    3. Stress-test with realistic input and output lengths, not just checking whether the model loads.
    4. Track both time to first token and sustained generation speed. The first affects how responsive the system feels, and the second affects the experience with long outputs.
    5. Record VRAM and memory usage over time. If usage nears the limit, capacity is the bottleneck. If usage is comfortable but speed is low, the bottleneck is usually bandwidth or compute.

    8. Common Misconceptions

    Misconception 1: If a model loads, it can be used normally. Loading is only the first step. During long-context inference and concurrent requests, peak…