Local LLM VRAM Planning and Hardware Selection Guide

    This article explains how to plan VRAM for local LLM deployment by modeling weights, KV cache, runtime buffers, and headroom rather than relying on parameter count alone. It provides a simplified estimation method, hardware guidance for discrete GPUs and unified-memory devices, a deployment workflow, and common pitfalls to avoid.

    Local LLM VRAM Planning and Hardware Selection Guide

    A common mistake when deploying LLMs locally is equating parameter count directly with VRAM requirements. In practice, VRAM usage is made up of several parts: quantized weights, context cache, inference runtime buffers, batch concurrency, framework reservations, and graphics or display overhead. Published figures for “how much VRAM model X needs” are only empirical starting points, not guarantees of stable operation. This article presents a reproducible method for VRAM estimation and hardware selection from a general technical perspective.

    1. What VRAM Usage Consists Of

    When deploying a model, at least the following VRAM costs should be considered:

    1. Weight VRAM: Determined by parameter count and quantization bit width. 4-bit quantization usually saves about half the weight VRAM compared with 8-bit, but lower quantization increases quality loss and compatibility risk.
    2. KV cache: Related to context length, batch size, layer count, hidden dimension, and attention head configuration. In long-context scenarios, KV cache can approach or even exceed weight VRAM.
    3. Runtime buffers: Inference engines need temporary tensors, operator workspaces, graph optimization buffers, and similar allocations, which are usually implementation- and hardware-dependent.
    4. System reservation: Discrete GPUs need space reserved for display output, drivers, and other processes; unified-memory devices need memory reserved for the operating system and background applications.
    5. Concurrency overhead: Batching improves throughput but increases KV cache and intermediate activation usage linearly or near-linearly.

    Therefore, VRAM planning should follow the principle of “weights + cache + buffers + headroom,” rather than relying on a single weight table.

    2. A Simplified VRAM Estimation Method

    The following illustrative estimation code is intended only to build capacity-planning awareness. It is not a precise performance model:

    1. def weight_gib(params_b, bits_per_weight):
    2. bytes_per_param = bits_per_weight / 8
    3. return params_b * 1e9 * bytes_per_param / (1024 ** 3)
    4. def rough_plan(params_b, bits_per_weight, ctx_factor=0.25, runtime_factor=0.15):
    5. weight = weight_gib(params_b, bits_per_weight)
    6. kv_and_activation = weight * ctx_factor
    7. runtime = weight * runtime_factor
    8. return weight, kv_and_activation, runtime, weight + kv_and_activation + runtime

    The ctx_factor and runtime_factor values must be calibrated through actual load testing. The longer the context and the larger the batch, the less ctx_factor can be ignored. A practical recommendation is to reserve 20%–30% headroom based on the estimate, then measure peak VRAM with real requests.

    3. Model Scale and Quantized Weight VRAM

    The table below abstracts the original empirical data into general scale tiers. Weight VRAM is a rough estimate after 4-bit quantization and does not include long-context or runtime overhead:

    Scale tier Rough quantized weight VRAM Recommended hardware starting point Intended goal
    ~2B-class lightweight model ~2–4 GB 4 GB-class lightweight device Validate the minimum runnable path
    ~4B-class lightweight model ~4–6 GB 6 GB-class discrete GPU or 16 GB-class unified-memory device First local experience for most users
    ~26B total-parameter / ~4B active-parameter sparse model ~12–16 GB 16 GB-class VRAM is more comfortable Stronger local inference without moving to the heaviest models
    ~31B-class model ~20–24 GB 24 GB-class or above Priority on quality, code, and long context

    It is important to emphasize that the “weight VRAM” in this table is only a lower-bound reference. If context is extended to tens of thousands of tokens, or if there are many concurrent requests, actual peak usage will be significantly higher than the table values.

    4. Choosing by Discrete GPU Tier

    6 GB-class entry discrete GPU

    At this tier, prioritize the 4-bit quantized version of a ~4B-class lightweight model. A ~26B total-parameter / ~4B active-parameter sparse model or a ~31B-class model is not strictly impossible to try, but starting with a large model by default is likely to exhaust VRAM. Set the goal as “stable conversation + moderate context,” and do not chase extreme quantization and ultra-long context from the start.

    8–12 GB-class mainstream discrete GPU

    A ~4B-class model is more stable, and lower-bit quantized versions of larger models can also be evaluated. At this point, pay close attention to context length, extra runtime overhead, and display usage. Do not select hardware right at the VRAM limit, or a single long-document request may trigger out-of-memory errors. It is advisable to keep at least 1–2 GB of headroom.

    12–16 GB-class high-end discrete GPU

    A ~26B total-parameter / ~4B active-parameter sparse model enters the range where serious attempts are reasonable. Being able to start does not mean it can run stably. Focus on actual inference speed, first-token latency, and peak VRAM under long context, rather than only looking at nominal specifications. If code and long context are the main use cases, run a small-scale load test first.

    24 GB-class and above flagship discrete GPU

    A ~31B-class model is more worth trying. However, VRAM tables are references, not guarantees, and long context will still significantly increase memory usage. In multi-concurrency scenarios, KV cache accumulates quickly. Stability should be gained by limiting concurrency, shortening context, or enabling more aggressive quantization.

    5. Choosing Unified-Memory Devices

    For unified-memory devices, the key is not discrete VRAM but total unified memory and memory bandwidth. The system itself, background applications, and the graphical interface all consume part of the memory, so actual available capacity is lower than the nominal value. The following mapping can be used as a reference:

    Unified-memory tier Recommended model tier Notes
    16 GB-class unified memory Start at ~4B-class; ~26B total / ~4B active can barely run but is slow Sufficient for daily chat; large models are mainly limited by memory bandwidth
    32 GB-class unified memory ~4B-class runs smoothly; ~26B total / ~4B active can be tried Clearly better experience than 16 GB
    64 GB-class unified memory Both ~26B and ~31B-class models can run Suitable for users who need quality but do not want a discrete GPU
    18 GB-class new-generation unified memory Prefer ~4B-class; ~26B total / ~4B active depending on the situation New-generation chips are more efficient but still require reserved system memory
    64 GB+ new-generation unified memory ~26B and ~31B-class models run relatively smoothly A strong configuration among mobile unified-memory workstations
    128 GB-class top unified memory ~31B-class comfortably; more stable under concurrency The advantage range of top workstation configurations

    The key bottleneck for unified-memory devices is usually not “whether the model fits,” but memory bandwidth and sustained throughput. The larger the model, the more obvious the bandwidth pressure; the higher the concurrency, the more obvious the latency jitter.

    6. Deployment Workflow

    A practical deployment process should follow these steps:

    1. Define the task and quality threshold: First determine whether the use case is conversation, summarization, code, or long-document Q&A, then decide the acceptable quantization tier.
    2. Choose a quantization tier: Start with 8-bit or 4-bit comparisons, and record quality changes and peak VRAM.
    3. Set median and maximum context lengths: Do not use the maximum value for daily configuration; plan according to P95 request length.
    4. Load-test concurrency: Start with single concurrency, then gradually increase concurrency while observing peak VRAM, P95 latency, and throughput.
    5. Establish monitoring: Monitor peak VRAM, OOM count, swap behavior, power and temperature, and request queuing time.
    6. Scale elastically: If local capacity is insufficient, deploy elastically by VRAM tier on general-purpose cloud hosts, container platforms, or GPU instances. Specific capacity should still be based on real load tests.

    7. Common Pitfalls

    • Looking only at parameter count: Long context and concurrency can make KV cache the main cost.
    • Selecting hardware at the limit: Nominal fit does not equal stable operation; system and runtime headroom must be reserved.
    • Ignoring memory bandwidth: This is especially obvious on unified-memory devices; insufficient bandwidth appears as “it runs but is very slow.”
    • Ignoring quantization quality: Low-bit quantization can affect code, math, and long-document reasoning quality, so task-level evaluation is necessary.
    • Ignoring cooling and power: Sustained inference exposes power and thermal bottlenecks, which in turn affect frequency and stability.
    • Treating weight tables as guarantees: Weight tables are only lower bounds; actual deployment must be load-tested.

    8. Conclusion

    VRAM planning for local LLM deployment should model four parts: weights + KV cache + runtime buffers + headroom. ~4B-class lightweight models are suitable starting points for 6 GB-class discrete GPUs and 16 GB-class unified-memory devices; ~26B total-parameter / ~4B active-parameter sparse models are worth serious attempts at 12–16 GB-class VRAM; ~31B-class models are better suited to 24 GB-class and above discrete GPUs or 64 GB-class and above unified-memory devices. Final selection should be based on real task load tests, balancing quality, speed, concurrency, and cost.