LLM VRAM Requirements Guide: Parameters, Quantization, and Hardware Selection

    The model size listed in an LLM's official documentation is the size of the raw half-precision weights — it tells you how much space the weights take, not how much GPU memory inference actually needs. This guide breaks VRAM usage into its four real consumers: weights, the KV cache, runtime buffers, and framework overhead. It explains why nominal parameter counts can diverge from effective ones in parameter-sharing and mixture-of-experts designs, and how each affects memory footprint versus speed. You'll find lookup tables for weight memory by precision, KV cache calculations for long contexts, tiered capacity recommendations by model scale and by GPU VRAM, guidance for unified-memory devices, three fallback paths in ascending order of cost, and a validation checklist covering peak memory, real workloads, time-to-first-token versus decode throughput, endurance runs, and concurrency.

    1. Where the Problem Starts: Why the Official Weight Size Isn’t a Deployment Basis

    When you get a new model, the first thing you usually look for is the “model size” in the official documentation. That number is typically the size of the raw half-precision weights. It answers “how much space do I need to hold the weights” — not “how much memory does inference need to run.”

    Real runtime VRAM usage comes from at least four parts: weights, the KV cache, transient runtime buffers, and the framework’s own overhead. Of the first three, only weights are static and can be looked up. The other two vary dynamically with context length, batch size, and concurrency. So “treat the official number as a rough reference only” isn’t a brush-off — it’s the inevitable consequence of this cost structure.

    Another commonly overlooked point is the difference between nominal and effective parameter counts. Several model design trends have appeared in recent years. Some small models reduce parameter redundancy through techniques such as embedding matrix sharing and cross-layer parameter tying, which pushes the nominal parameter count noticeably above the number of parameters that actually participate in computation. Another approach is the mixture-of-experts structure: the total parameter count is very large, but generating each token activates only a small fraction of them.

    These two structures affect VRAM planning in completely different ways:

    • Memory capacity is determined by “all the weights that must stay resident” — that is, the total parameter count.
    • Inference speed is determined by “the parameters actually activated per token.”

    This is exactly why many mixture-of-experts models consume a lot of memory while still being reasonably fast, and it’s the single most misread aspect of model selection.

    2. What Actually Consumes the VRAM: Breaking Down the Four Costs

    2.1 Weights: Direct Conversion by Bytes per Parameter

    This is the easiest item to calculate:

    1. Weight VRAM ≈ parameter count (in B) × bytes per parameter
    Precision Bytes per parameter 4B-class model 12B-class model 30B-class model
    BF16 / FP16 2.0 8 GB 24 GB 60 GB
    INT8 ~1.03 4.1 GB 12.4 GB 31 GB
    INT4 (grouped quantization) ~0.55–0.65 2.2–2.6 GB 6.6–7.8 GB 16.5–19.5 GB

    Note that INT4 is not a clean 0.5 bytes per parameter. Grouped quantization requires storing a scale factor and a zero point for each group; smaller groups give better accuracy but more metadata. In practice, a 4-bit scheme lands at an effective 0.55–0.65 bytes per parameter — 10% to 30% above the theoretical value. When doing capacity planning, take the upper end of this range; it’s considerably safer than assuming 0.5.

    2.2 KV Cache: The Real Cost Center for Long Contexts

    Autoregressive generation has to cache the Keys and Values of past tokens to avoid recomputing them. Its size scales linearly with sequence length:

    1. KV VRAM ≈ 2 × layers × KV heads × head dim × sequence length × batch size × bytes per element

    Take a mid-sized model as an example (32 layers, 8 KV heads, head dim 128, FP16 cache):

    1. def kv_cache_gb(n_layers=32, n_kv_heads=8, head_dim=128,
    2. seq_len=8192, batch=1, bytes_per_elem=2):
    3. total = 2 * n_layers * n_kv_heads * head_dim * seq_len * batch * bytes_per_elem
    4. return total / (1024 ** 3)
    5. print(kv_cache_gb(seq_len=8192)) # ≈ 1.0 GB
    6. print(kv_cache_gb(seq_len=32768)) # ≈ 4.0 GB

    This example reveals a key fact: an 8K context is roughly 1 GB; a 32K context is 4 GB. If the model itself already occupies 17 GB, then pushing the context to 32K on a 24 GB card — plus runtime overhead — will almost certainly overflow.

    Two optimization directions worth attention, both standard practice in the industry:

    1. Lower the KV cache precision: storing the KV cache in 8 bits halves this cost outright, and the impact on output quality is usually smaller than reducing weight precision.
    2. Structures such as grouped-query attention: reducing the number of KV heads compresses cache size at the model architecture level — one reason many newer models can support very long contexts.

    2.3 Runtime Buffers and Framework Overhead

    This is the most commonly underestimated part, and it typically includes:

    • Transient activation buffers: the prefill phase processes the entire prompt at once, so peak memory is far higher than during decoding. It scales with batch size × sequence length, typically 0.5–2 GB.
    • Compute graph and kernel workspace: inference frameworks reserve working space, 0.3–1 GB.
    • Memory fragmentation and the reserved pool: after running for a long time, the allocator retains blocks it hasn’t returned, and in fragmented scenarios this can add 5%–15%.

    Stacking these together, a safe rule of thumb is: reserve 20%–25% headroom on top of weights plus KV cache. The result of configuring right at the limit is usually not that it won’t start, but that it OOMs after half an hour of running.

    3. Quick Reference by Tier: Parameter Scale and Capacity Ranges

    Combining the two main costs above gives a practical capacity reference (estimated with INT4 weights, FP16 KV cache, and a moderate context):

    Model scale Quantized weight footprint Typical total footprint (incl. context and overhead) Minimum viable VRAM Comfortable VRAM
    2B class (smaller effective params) 1.2–1.6 GB 2–4 GB 4 GB 6 GB
    4B class 2.2–2.6 GB 4–6 GB 6 GB 8–12 GB
    12–14B dense 6.6–9 GB 12–16 GB 16 GB 24 GB
    26–30B (large total, ~4B active) 14–18 GB 18–24 GB 24 GB 32 GB
    30B-class dense 16.5–19.5 GB 20–28 GB 24 GB (short context) 32 GB or more

    The “large total, small active” tier deserves separate explanation. Its VRAM threshold is close to that of a 30B dense model, but because it activates only about 4B parameters per token, decode speed is often close to a 4B model’s. If you want better content quality and are constrained by speed, this tier is usually the best value — the price is that you have to bring enough VRAM.

    4. Selection Strategy by Discrete GPU Tier

    VRAM capacity Recommended starting point Not recommended
    4 GB or less 2B-class INT4, only to validate the minimal runnable pipeline Any model above 7B
    6 GB 4B-class INT4 / mixed precision, context kept under 4K 12B and above, plus any long-context scenario
    8–12 GB 4B class runs smoothly; 12B-class INT4 is worth evaluating Running 14B at the limit while also opening a long context
    16 GB 12–14B-class INT4 is comfortable; 26B-class MoE worth trying 30B-class dense
    24 GB 30B-class INT4 is feasible, but context must be budgeted carefully 32K+ context combined with high concurrency
    32 GB and above / multi-GPU 30B class with room to spare; 8-bit schemes such as FP8 to buy quality Ignoring multi-GPU communication overhead and sharding blindly

    A few pragmatic additional judgments:

    • “It starts” is not the same as “it runs stably.” Starting only requires the weights to fit. Stable operation also requires peak memory — especially the prefill peak — to fit.
    • What determines real experience is bandwidth, not capacity. During decoding, every generated token in principle reads the entire set of active weights, so the throughput ceiling is approximately:

      1. Theoretical ceiling (tokens/s) ≈ memory bandwidth (GB/s) ÷ bytes read per token (GB)

      Take bandwidth in the 900 GB/s range, 4B active parameters, and INT4 (~2.5 GB): the theoretical ceiling is around 360 tokens/s, while a real single stream reaches only 40%–70% of that, depending on kernel efficiency and scheduling overhead. The value of this formula is this: when two options have enough VRAM but differ in speed by 2×, the reason almost always lives in the bandwidth column.

    • Don’t buy a card based on nominal specs. Prioritize measured sustained decode speed over peak compute figures in the hardware spec sheet.

    5. Unified Memory Devices: Ample Capacity, Limited Bandwidth

    Unified memory architecture (CPU and GPU sharing the same physical memory) has a very clear profile: large capacity, relatively low bandwidth. This directly changes the selection logic.

    Unified memory capacity Feasible range Real bottleneck
    16 GB Mostly 4B class Capacity is marginal; above 12B there’s essentially no room left for the OS and context
    24–32 GB 4B class smooth, 12–14B class worth trying Large-model decode speed is clearly limited by bandwidth
    48–64 GB 26–30B class (including MoE) can run Bandwidth becomes the only bottleneck; capacity isn’t tight
    96 GB and above 30B-class dense is feasible Same as above; watch context and concurrency

    When selecting on this kind of device, reverse the order: first estimate the speed ceiling by dividing bandwidth by the active weight size, then decide whether it’s worth running.

    As an example, if the device’s memory bandwidth is in the 200–400 GB/s range and the model’s per-token active weights are about 2.5 GB after quantization, the theoretical speed ceiling falls between 80 and 160 tokens/s, with real-world experience typically in the tens of tokens/s — perfectly acceptable for everyday conversation. Swap in a 30B-class dense model (INT4, ~17 GB) and the theoretical ceiling drops to only 12–23 tokens/s, possibly single digits in practice. Here, “the memory is big enough” can’t save you.

    So the practical advice for unified memory devices is: prefer mixture-of-experts models with large total parameter counts and small active parameter counts, and avoid heavier dense models of equivalent quality.

    6. Three Fallback Paths When VRAM Isn’t Enough

    Listed in ascending order of cost:

    1. Reduce bit width: BF16 → INT8 → INT4. Dropping weights from 8 bits to 4 saves roughly half the VRAM, but quality loss accelerates as bit width falls. Below 4 bits (3-bit, 2-bit) is generally no longer suitable for accuracy-sensitive tasks.
    2. Compress the KV cache: lower KV precision, or cap the maximum context length. The advantage of this path is that it costs almost nothing in the model’s own capability — you only sacrifice the range of context you can handle — which makes it the best value outside long-document scenarios.
    3. Layer offloading: move some layers to host memory and transfer them on demand. This will definitely get things running, but be clear-eyed about the cost — every generated token requires moving weights across the bus, and the one-way bandwidth of the bus between host and accelerator is typically only 16–32 GB/s, one to two orders of magnitude below VRAM bandwidth. Offloading suits the “does it even run” validation stage; it is not a proper setup for daily use.

    7. A Validation Checklist Before You Ship

    Don’t trust any static table, including the ones in this article. Before going live, run one real test following this process:

    • Measure peaks, not steady state. Monitor peak VRAM usage at runtime; the prefill peak is often much higher than the decode phase, and watching only steady state will miss it.
    • Stress test with real workloads. Fix a set of prompt lengths and generation lengths close to actual usage, rather than the shortest possible test input.
    • Record time-to-first-token and decode throughput separately. The former reflects prefill capability (heavily influenced by compute), the latter reflects decode capability (heavily influenced by bandwidth). They need to be evaluated separately.
    • Run long enough. A continuous session of 30 minutes or more, to surface memory fragmentation and allocator leak issues.
    • Test again with concurrency added. Raise concurrency from 1 to 2 and 4. The KV cache grows linearly, and in single-machine single-GPU scenarios it’s often concurrency that breaks first, not the model failing to fit.

    8. Summary

    The essence of VRAM planning is estimating “weights + KV cache + runtime overhead” separately and then making a decision with 20% headroom. Three of the easiest traps are worth remembering: nominal parameter count is not effective parameter count, total parameter count determines the VRAM threshold while active parameter count determines speed, and capacity determines whether it runs, while bandwidth determines how well it runs. Once you have these three points straight, you can give a reliable hardware judgment for any new model within an hour, instead of hitting OOM through trial and error.