Local LLM VRAM Configuration Guide: Match Model Size to Hardware

    This guide explains how to size local LLM deployments by starting from available VRAM or unified memory. It covers parameter count, precision, quantization, discrete GPU VRAM versus unified memory, reference requirements for different model tiers, runtime overhead such as KV cache, and cloud options when local hardware is not enough.

    1. Why VRAM configuration is the first hurdle for local LLMs

    When deploying a large language model locally, the first obstacle is often not speed or model quality, but a familiar error: out of memory. Model weights must remain resident in VRAM or unified memory, and consumer-grade hardware usually provides only a few GB to a few dozen GB of this resource as a hard limit. If model parameters plus runtime overhead exceed the physically available capacity, the application may crash or fall back to system memory, with a severe drop in speed that makes it unusable.

    The right selection order is therefore not “Which is the strongest model I want?” but “Which parameter size can my hardware reliably support?” The sections below start with the core concepts and then provide practical tiered recommendations.

    2. Three core concepts that determine memory usage

    1. Parameter count and weight size

    The largest part of model memory usage is the weights themselves. A rough formula is:

    1. Weight memory ≈ parameter count × bytes per parameter

    The number of bytes per parameter depends on precision: FP16 is about 2 bytes, INT8 is about 1 byte, and INT4 is about 0.5 byte. For example, a 7B model loaded in 16-bit precision requires about 14GB for weights alone, before accounting for runtime overhead. This also explains a common misunderstanding: a model with a small nominal parameter count does not necessarily have low memory usage, because precision also matters.

    2. Quantization: the most direct lever for memory optimization

    Quantization represents weights with fewer bits, substantially reducing memory usage while preserving usability in most cases. Compared with 16-bit precision, INT8 can roughly halve the weight footprint, and INT4 can reduce it to about one quarter. This is why consumer GPUs often can only run quantized versions of larger models—quantization is a core technique for bringing LLMs to local devices. Lower quantization bits may affect precision and generation quality, so model selection must balance memory usage and output quality.

    3. Discrete VRAM vs unified memory

    A traditional discrete GPU has dedicated VRAM with a fixed capacity. Some mobile computing platforms that use shared memory design do not have a separate “VRAM” concept; the model can directly use a large block of system memory. The advantage of such platforms is that memory capacity can be configured much higher, and the bottleneck is often memory bandwidth rather than capacity. For selection, discrete GPUs require attention to the VRAM tier, while unified-memory platforms require attention to total unified memory and memory bandwidth.

    3. Memory reference for different model sizes

    The following table provides general reference ranges for quantized deployments. Actual values vary with precision, context length, and implementation.

    Model size tier Approx. memory usage after quantization Recommended hardware starting point Suitable users
    Lightweight (about 2~4B) About 2~4GB Lightweight devices with less than 4GB Users who only want to validate the minimum runnable path
    Small model (about 4B) About 4~6GB 6GB GPU or at least 16GB unified memory Most users’ first local experience
    Mid-size (about 26B, sparse activation architecture) About 12~16GB 16GB tier is more comfortable Users who want stronger inference without the heaviest model
    Heavyweight (about 31B) About 20~24GB 24GB or above Users who prioritize quality, coding, and long context

    The “about 26B sparse activation architecture” here refers to a class of Mixture-of-Experts (MoE) designs: the total parameter count is relatively large, but only a small part is activated for each inference pass, so the actual compute requirement is closer to that of a small model and memory usage is relatively manageable. Such models are a compromise between effectiveness and local feasibility.

    4. Choosing models by VRAM tier (discrete GPUs)

    6GB VRAM tier (entry-level GPUs)

    Start by running small models (about 4B) stably and validating the inference path, toolchain, and quantization format. Mid-size or heavyweight models are not impossible to try, but starting directly with them often causes out-of-memory errors during loading.

    8GB to 12GB VRAM tier (mainstream GPUs)

    Small models will run more comfortably, and users can begin evaluating quantized versions of mid-size models. The key at this stage is not to “choose at the limit”—be sure to leave headroom for context cache and runtime overhead.

    12GB to 16GB VRAM tier (upper-middle GPUs)

    Mid-size sparse-activation models enter a range where they are worth trying seriously. It is important to note that successful loading and startup do not equal stable, smooth operation. Actual inference speed, such as generated tokens per second, should be the focus, not merely whether the model can light up.

    24GB or above (flagship GPUs)

    Heavyweight models (about 31B) become more worth investing in. However, the VRAM table is always a reference, not a guarantee: once long context is enabled, memory usage can rise significantly, so a safety margin is still needed.

    5. Choosing models on unified-memory platforms

    These platforms do not focus on discrete VRAM; they focus on total unified memory and bandwidth. The following table provides a general comparison using common mobile processor tiers.

    Platform/unified memory configuration Recommended model tier Notes
    Entry-level mobile chip (16GB) Start with small models; mid-size models can barely run but are slow Sufficient for daily conversation; larger models are mainly limited by memory bandwidth
    Same-tier chip (32GB) Small models run smoothly; mid-size models can be tried Noticeable improvement over 16GB
    High-performance mobile chip (64GB) Both mid-size and heavyweight models can run Suitable for users who want quality without a discrete GPU
    New-generation mid-range chip (18GB memory) Prioritize small models; mid-size depending on the situation More efficient than the previous generation at the same memory size
    Top-tier mobile chip (64GB+) Mid-size and heavyweight models run relatively smoothly The strongest inference experience among mobile platforms
    Flagship workstation chip (128GB) Heavyweight models run without pressure, and multi-concurrency is more stable The advantage range of large unified memory

    The conclusion is clear: the larger the unified memory capacity, the larger the model scale that can be supported. However, bandwidth should also be considered, as it often determines actual generation speed.

    6. Do not ignore context length and runtime overhead

    Many startup failures are not caused by the model being too large to load, but by runtime consuming too much memory. In addition to weights, inference has two hidden overheads:

    • KV cache: It grows approximately linearly with context length. Increasing context from a few thousand tokens to tens of thousands of tokens can add several GB of memory usage.
    • Runtime and batching overhead: Concurrent requests, batch size, and temporary buffers in the framework all consume memory.

    A practical recommendation is to reserve 20% to 30% headroom beyond the weights, start with a small context, and gradually extend it after confirming stability. This can significantly reduce the probability of “parameters are enough but it still cannot run.”

    7. Another path when local hardware is insufficient: cloud deployment

    When local hardware cannot support the target model size, or when higher stability and concurrency are required, cloud deployment is a natural choice. General cloud capabilities can be combined to complete the deployment, for example:

    • Use a container platform to quickly launch and elastically scale inference services;
    • Use object storage to store model weights and datasets;
    • Use monitoring and alerting to continuously track memory usage, throughput, and latency metrics;
    • Use logging services to retain call traces and make troubleshooting easier.

    For example, Baidu AI Cloud’s general capabilities in containerized deployment, object storage, monitoring and alerting, and logging can help teams move large model inference from “runnable on a single machine” to “stable and operable.” Specific resource specifications and configurations should be based on the actual use case.

    8. Practical selection checklist

    1. Decide model size first, then hardware: Work backward from the memory or VRAM limit to determine the supported model tier, rather than the other way around.
    2. Prefer quantized versions: Use INT8 or INT4 to balance quality and memory usage.
    3. Leave sufficient runtime headroom: Reserve 20% to 30% for context KV cache and concurrency.
    4. Starting up is not the same as running stably: Use actual generation speed and long-term stability as acceptance criteria.
    5. Move to the cloud when local resources are limited: Use general capabilities such as container platforms, object storage, monitoring and alerting to complete production-grade deployment.

    Following this approach allows you to move from “blindly choosing a model” to “matching hardware to actual needs,” reducing detours whether for local validation or cloud deployment.