Local LLM GPU Selection: How to Balance VRAM, Bandwidth, and Compute

    This guide explains how to choose a GPU for running large language models locally by focusing on the three constraints that actually matter: VRAM capacity, memory bandwidth, and architectural generation. It shows why LLM inference is memory-bound rather than compute-bound, how to budget VRAM for model weights and KV Cache (with a runnable estimation script), and how to estimate decoding speed from bandwidth. It also covers low-precision and operator support, interconnect/ECC/cooling/power considerations, the risks of unofficial memory-expanded cards, a comparison of four hardware routes, software-stack tuning techniques, and a break-even method for deciding between local and cloud deployment—closing with a practical selection checklist.

    1. First, a Common Misconception: The Bottleneck in Inference Is Data Movement, Not Computation

    Most people configuring hardware for local LLMs for the first time judge GPUs the way they read benchmark scores: higher single-precision FLOPS and more cores must mean better. In large language model inference, this intuition is usually wrong.

    The reason is arithmetic intensity. During autoregressive decoding, generating every token requires reading the entire set of model weights, while each weight participates in only a tiny number of floating-point operations (matrix-vector multiplication rather than matrix-matrix multiplication). This makes decoding a thoroughly memory-bound task: the GPU spends most of its time waiting on VRAM, while its compute units sit largely idle.

    Prefill is the one phase that behaves differently, and understanding the distinction between these two phases is the foundation of the entire selection logic:

    Phase Characteristics Main bottleneck User-perceived metric
    Prefill (processing the input prompt) Large matrix multiplication, high arithmetic intensity Compute throughput Time to first token (TTFT)
    Decode (generating tokens one by one) Matrix-vector multiplication, extremely low arithmetic intensity VRAM bandwidth Output speed / TPOT / tokens/s

    So the three questions that truly determine the “local experience” are: can it fit (capacity), how fast can it be read (bandwidth), and can the new architectural features be leveraged (operator support). Let’s break these down one by one.

    2. Constraint 1: VRAM Capacity Determines Whether It Runs at All

    The VRAM budget consists of three parts: model weights + KV Cache + runtime overhead. The first two can be estimated fairly accurately; for the third, reserve 5%–10% for the framework, the CUDA context (the general-purpose parallel computing runtime), temporary buffers, and VRAM fragmentation.

    2.1 Model weights: parameter count × effective bit width

    The formula is simple: VRAM (bytes) = number of parameters × bytes per parameter. The key is the effective bit width after quantization—grouped quantization (e.g., 128 weights sharing one scale factor) introduces extra metadata overhead, so the actual effective bit width is usually 0.5–1 bit higher than the nominal value.

    Estimated weight footprints for different model scales (decimal GB):

    Parameter scale FP16 (16 bit) INT8 (8 bit) 4-bit group quantization (effective ~4.5–5 bit)
    7B ~14.0 GB ~7.0 GB ~3.9–4.4 GB
    13B ~26.0 GB ~13.0 GB ~7.3–8.1 GB
    33B ~66.0 GB ~33.0 GB ~18.6–20.6 GB

    The conclusion is obvious at a glance: a 20 GB VRAM card’s ceiling is roughly “a 13B-class model at INT8, or a 33B-class model at 4-bit quantization”. The 24 GB tier has noticeably more headroom in long-context scenarios, because context length directly consumes available VRAM.

    2.2 KV Cache: the most underestimated part

    The KV Cache stores the Key/Value of historical tokens to avoid recomputation. Its footprint scales linearly with context length and batch size:

    1. KV bytes = 2 (K and V) × num_layers × num_kv_heads × head_dim × seq_len × batch × bytes_per_element

    Take a 13B-class model with “40 layers, hidden dimension 5120, head dimension 128”. Using standard multi-head attention (num_kv_heads = 40):

    • Single token, single layer: K and V total 2 × 40 × 128 = 10240 elements → 20 KB in FP16
    • 40 layers combined: about 800 KB / token
    • 8192 context: about 6.4 GiB

    This number is critical: it means a 20 GB card, once loaded with a 4-bit quantized 33B model (~19 GB), has almost no room left for long context. By contrast, a model using grouped-query attention (GQA) might have only 8 KV heads, dropping the KV Cache to about 1.3 GiB for the same context and freeing up over 5 GB.

    Practical advice: When selecting hardware and models, treat the KV Cache as a first-class citizen in your budget. Prioritize whether the architecture supports GQA and whether it supports KV Cache quantization (FP8/INT8). If the framework supports it, VRAM efficiency for long-context serving can differ by an order of magnitude.

    2.3 A ready-to-run VRAM budgeting script

    1. def estimate_vram(
    2. n_params_b: float, # Number of parameters in billions (B)
    3. bits_per_weight: float, # Effective bits per weight; use 4.5-5 for grouped quantization
    4. n_layers: int,
    5. kv_heads: int,
    6. head_dim: int,
    7. max_seq: int,
    8. batch: int = 1,
    9. kv_bits: int = 16,
    10. overhead_ratio: float = 0.08,
    11. ) -> dict:
    12. """Estimate inference VRAM usage; returns each component in GiB."""
    13. gib = 1024 ** 3
    14. weights = n_params_b * 1e9 * bits_per_weight / 8 / gib
    15. kv = (2 * n_layers * kv_heads * head_dim
    16. * max_seq * batch * (kv_bits / 8) / gib)
    17. subtotal = weights + kv
    18. return {
    19. "weights_gib": round(weights, 2),
    20. "kv_cache_gib": round(kv, 2),
    21. "overhead_gib": round(subtotal * overhead_ratio, 2),
    22. "total_gib": round(subtotal * (1 + overhead_ratio), 2),
    23. }
    24. # A 33B-class model + 8K context on a 20 GB card (GQA, 8 KV heads)
    25. print(estimate_vram(33, 4.5, 60, 8, 128, 8192))
    26. # Comparison: same 20 GB card, but a 13B-class INT8 model + 32K long context
    27. print(estimate_vram(13, 8.5, 40, 40, 128, 32768))

    Embedding this script in your selection review process is more reliable than reading any benchmark leaderboard—because it computes your own model with your own context length.

    3. Constraint 2: Memory Bandwidth Determines How Fast It Runs

    3.1 Order-of-magnitude estimation of single-stream decoding speed

    With batch size 1, generating each token requires reading the weights at least once. The theoretical speed upper bound is:

    1. Theoretical tokens/s ≈ memory bandwidth ÷ (bytes read per token)
    2. Bytes read per token ≈ model weight size + current KV Cache size

    For the ~750 GB/s bandwidth tier and a 13B-class 4-bit quantized model (~7.3 GB): the theoretical upper bound is about 103 tokens/s; after subtracting losses from operator efficiency, scheduling overhead, sampling logic, and so on (measured efficiency typically falls in the 60%–85% range), a reasonable expectation is 70–90 tokens/s.

    Switch to a 33B-class 4-bit model (~18.6 GB): the theoretical upper bound drops to about 40 tokens/s, and the actual figure to around 25–35 tokens/s. Note that with the same bandwidth, doubling the model roughly halves the output speed—this is precisely “the cost of trading for VRAM capacity”.

    3.2 Long context causes a continuous slowdown

    Since bytes read per token = weights + current KV Cache, the longer the context, the more data must be moved at each decoding step. As the context grows from 1K to 32K, the KV Cache read volume may catch up to or even exceed the weight volume. This is why “smooth with short prompts, noticeably sluggish with long documents” is a typical local-deployment phenomenon, and why you can’t judge a GPU by peak bandwidth alone.

    3.3 Prefill is where compute comes into play

    Prefill must process the entire input, with compute roughly 2 × number of parameters × number of input tokens, plus attention overhead that grows with the square of the sequence length. Assume a 13B model processes 2000 input tokens: about 52 TFLOPs; if the effective compute is 15 TFLOPS (40%–50% of peak compute), it takes about 3–4 seconds.

    The conclusion: the longer the input, the more important TOPS / FP16 floating-point throughput and attention operator efficiency become; the longer the output, the more important memory bandwidth becomes. Before choosing a card, figure out whether your workload is “long-document summarization + short output” or “short prompt + long-form creation”—the optimal card for the two is completely different.

    4. Constraint 3: Generational Differences in Low-Precision Support and Operators

    This is the column most easily overlooked on a spec sheet yet most impactful in practice. With equal VRAM and bandwidth, architecture generation determines how much software-ecosystem benefit you can capture:

    • bf16 support: bf16 has the same dynamic range as FP32 and is the default precision for training and some fine-tuning workflows. Older architectures natively lack bf16 support and must substitute FP16, which easily leads to numerical overflow during fine-tuning.
    • Low-precision tensor operation paths: Hardware acceleration for INT8/FP8/INT4 directly determines whether a quantized model runs on a native low-precision path or degrades to “low-precision storage + dequantization to FP16 for compute”—the latter eats up a substantial portion of the performance gains.
    • IO-aware block attention operators: These operators use block computation plus online softmax to avoid writing the huge attention intermediate matrix back to VRAM. They require specific high-speed shared memory and synchronization instructions. Architectures lacking hardware support cannot enable them, and the longer the sequence and the larger the batch, the more dramatic the performance gap (for long sequences, VRAM usage can drop from quadratic to linear).
    • Decoding acceleration techniques: Speculative decoding (draft model + main model verification), continuous batching, and paged KV Cache management. These engineering capabilities don’t demand much of the hardware itself, but they depend on whether operator and runtime support is complete.

    A rule of thumb: If the budget is the same, between “same generation, slightly smaller VRAM” and “older generation, slightly larger VRAM”, prioritize whether VRAM capacity meets the model’s minimum requirement; if both can fit the model, then prefer the newer generation—continued software-ecosystem adaptation will amplify the generational advantage over the long term.

    5. Constraint 4: Interconnect, ECC, Cooling, and Power

    If a single card can fit it, there’s no need for multiple cards. The reason is that multi-card tensor parallelism introduces a cross-card communication at every layer, with two All-Reduce operations per layer. Consumer cards usually have no high-speed interconnect channel between them and can only use the general PCIe bus (both bandwidth and latency far below dedicated interconnect solutions), so multi-card throughput gains are often far from linear, and in small-batch scenarios communication overhead may dominate the total time.

    The other four engineering constraints are equally important to note:

    1. ECC VRAM: During long continuous inference or fine-tuning, once non-ECC VRAM makes an error, it manifests as silent wrong outputs or random crashes that are extremely hard to diagnose. Production environments or long-cycle training tasks should treat ECC as a hard requirement.
    2. Cooling form factor: Passively cooled (data-center form factor) cards rely on forced airflow in the chassis and cannot be installed in a standard tower case; actively cooled consumer form factors are plug-and-play.
    3. Power and chassis airflow: Sustained loads above 300 W require evaluating the PSU’s rated power, 12V transient capability, power cable specs, and chassis intake/exhaust design. Under full-load stress testing, throttling triggered by the temperature wall makes sustained throughput significantly lower than first-minute performance.
    4. Matching bit width with VRAM capacity: Doubling VRAM capacity while keeping bit width unchanged means bandwidth per GB of VRAM is diluted. Whether such “capacity-expanded variant” cards match their rated bandwidth under specific workloads must be confirmed through real testing, not just spec-sheet values.

    6. General Risk Assessment for Unofficial, Memory-Expanded GPUs

    The market circulates some products that expand capacity by replacing VRAM chips, rewriting firmware, and redefining the reported VRAM capacity. They push down the “cost per GB of VRAM” and are very attractive to budget-sensitive local enthusiasts, but risk and reward must be weighed equally. The following is a general risk checklist, unrelated to any specific brand:

    Risk item Specific manifestation Mitigation
    Firmware & driver compatibility Abnormal VRAM detection, throttling policy, and monitoring readings under generic drivers Prefer solutions with mature ecosystem support; avoid dedicated drivers of unknown origin
    VRAM timing & stability Bit width / chip mismatch causing errors under high temperature or prolonged load 48+ hours of full-load stress testing plus byte-by-byte VRAM validation
    Firmware verification & maintainability Cannot be flashed normally, cannot be recovered Confirm complete flashing and recovery capability
    Quality & warranty Salvaged/refurbished parts circulate, no valid warranty Clarify warranty scope and period, keep complete documentation
    Hidden costs A higher failure rate causing labor loss and business interruption Factor downtime cost into TCO, not just the purchase price

    A practical acceptance method: After getting the card, don’t put it into production right after a benchmark run. First run long-duration high-load cycles with matrix multiplication and VRAM read/write (at least 24–48 hours), while collecting VRAM temperature, hotspot temperature, actual frequency, power draw, and error counts; then run real business workloads and compare “first-minute throughput” against “2-hour sustained average throughput”. If the latter is more than 15% lower than the former, it indicates a thermal or power limit, and you need to adjust airflow, power limits, or your usage-time expectations.

    7. Comparing the Capabilities of Four Hardware Routes

    Setting aside specific models, local LLM hardware actually has only four routes, each with clearly defined strengths:

    Dimension Consumer large-VRAM single card Previous-gen flagship large-VRAM card Data-center compute card (high-bandwidth memory) On-demand cloud GPU compute
    VRAM capacity 20 GB tier / 24 GB tier 24 GB tier Large Elastic choice, rich specs
    Memory bandwidth Medium (~700–800 GB/s range) Medium-high (~900 GB/s range) High (1.5–3 TB/s range) Covers low/mid/high tiers
    Low precision & attention operators New generation, fully supported Depends on generation Fully supported, most complete precision formats Matches chosen instance specs
    ECC Usually not supported Usually not supported Supported Supported (depends on instance type)
    Cooling & deployment Plug-and-play in a tower case Same Requires a server chassis and dedicated airflow Maintenance-free, ready to use
    Interconnect scaling General bus, poor scalability General bus High-speed interconnect, efficient tensor parallelism Supports high-speed interconnect specs
    Main risk Low capacity ceiling, no ECC Older generation, incomplete operator support High procurement cost, high deployment barrier Higher cost at long-term high utilization
    Suitable scenarios Individual dev, prototype validation, offline/privacy-sensitive Long context and high utilization Multi-user concurrency, fine-tuning/training, SLA requirements Peak elasticity, rapid experimentation, frequent model changes

    Why so many people end up at the “20 GB single card” point: It simultaneously satisfies four conditions—enough capacity to run a 33B-class 4-bit quantized or a 13B-class high-precision model; a new architecture with a complete operator ecosystem; active cooling with zero assembly barrier; and power and noise within an acceptable range. When you keep increasing the budget beyond this, you encounter steeply rising marginal cost and diminishing marginal returns: the experience improvement the extra 4 GB of VRAM can buy is far smaller than the price increase, unless your scenario is clearly stuck at that 4 GB boundary (e.g., you must run context beyond 32K). This isn’t “sweet spot card” mysticism, but a natural result of the density of the demand distribution.

    8. Squeezing the Most Out of Your Hardware: Software Stack and Engineering Techniques

    Choosing the right hardware is just the starting point. On the same card, throughput can differ 2–5x before and after tuning. Priority from high to low:

    1. Weight low-precision quantization: The single biggest-gain step. 4-bit group quantization typically brings several-fold VRAM savings while pushing decoding speed toward the bandwidth ceiling (because less data is moved per step). If the task is precision-sensitive, 8-bit can serve as a compromise.
    2. Continuous batching (in-flight batching): Dynamically batch different requests at the token level. This is the most effective means of improving GPU utilization and total throughput—it turns “matrix-vector multiplication” into “matrix-matrix multiplication”, converting memory-bound computation back into compute-bound.
    3. Paged KV Cache management: Allocate KV blocks on demand, eliminating the waste of reserving VRAM for the maximum length. Concurrency improvement is usually most pronounced here.
    4. Speculative decoding: Use a small draft model to guess multiple tokens consecutively, then have the main model verify them in parallel in a single pass. In the bandwidth-bound decoding phase, it can significantly reduce the number of memory accesses per token.
    5. Operator and computation graph optimization: Operator fusion, FlashAttention-style block attention, and graph capture to eliminate kernel launch overhead.
    6. KV Cache quantization: The key patch for long-context scenarios, trading a little precision for considerable VRAM savings.

    Pair this with a lightweight continuous-monitoring script to regression-test your tuning results:

    1. import json, subprocess, time
    2. def snapshot(gpu_index: int = 0) -> dict:
    3. """Collect key GPU metrics for before/after tuning comparison."""
    4. # Note: this uses a generic monitoring interface to collect VRAM usage,
    5. # utilization, temperature, and power draw.
    6. # In production, connect directly to a monitoring system rather than
    7. # polling inside the business process.
    8. return {
    9. "timestamp": time.time(),
    10. "memory_used_mib": read_metric("memory.used", gpu_index),
    11. "utilization_pct": read_metric("utilization.gpu", gpu_index),
    12. "temperature_c": read_metric("temperature.gpu", gpu_index),
    13. "power_w": read_metric("power.draw", gpu_index),
    14. }
    15. def benchmark_record(samples: list[dict]) -> dict:
    16. """Extract service-quality metrics from load-test samples."""
    17. ttfts = [s["ttft_ms"] for s in samples]
    18. tpots = [s["tpot_ms"] for s in samples]
    19. ttfts.sort(); tpots.sort()
    20. p = lambda xs, q: xs[min(len(xs) - 1, int(len(xs) * q))]
    21. return {
    22. "throughput_tok_s": sum(s["out_tokens"] for s in samples)
    23. / (sum(s["latency_s"] for s in samples) / len(samples)),
    24. "ttft_p50_ms": p(ttfts, 0.50),
    25. "ttft_p95_ms": p(ttfts, 0.95),
    26. "tpot_p95_ms": p(tpots, 0.95),
    27. "peak_memory_mib": max(s["peak_memory_mib"] for s in samples),
    28. }
    29. if __name__ == "__main__":
    30. # Use a fixed prompt set and fixed sampling parameters to keep
    31. # different configurations comparable.
    32. samples = json.load(open("bench_result.json"))
    33. print(json.dumps(benchmark_record(samples), indent=2, ensure_ascii=False))

    Metric baseline advice: Fix a set of representative prompts (covering short Q&A, long-document summarization, and code completion) and fix the sampling parameters, then rerun after each change to the quantization scheme or runtime configuration, recording TTFT P95, TPOT P95, total throughput, peak VRAM, and sustained power draw. Tuning without a baseline is guessing.

    9. Local or Cloud: Deciding by Break-Even Hours

    In the cost structure of local deployment, fixed costs are high and marginal costs are low; the cloud is exactly the opposite. So the dividing line for the decision is the stability of usage intensity.

    Calculate the break-even point:

    1. Monthly fixed cost = hardware depreciation + electricity + hosting/network + amortized ops labor
    2. Break-even hours = monthly fixed cost ÷ monthly cost of equivalent cloud compute converted to an hourly rate

    For example (the numbers are purely illustrative of the method): assume a GPU plus the full system costs about $1,400, depreciated over three years → roughly $39/month in depreciation; add assumed electricity and ops of about $30 → roughly $70/month in fixed costs. If equivalent cloud compute works out to about $0.65/hour, the break-even point lands at roughly a bit over 100 hours per month. If expected monthly usage is significantly above this threshold, local is more economical; below it, cloud is more reasonable.

    Judging by scenario:

    • Toward local: data can’t leave the intranet (code, healthcare, legal, finance), offline or weak-network environments, needs to share hardware with graphics workstations or gaming as a mixed workload, single-machine low-latency interactive use, long batch tasks (training, large-scale data processing). In these scenarios, high local utilization amortizes the fixed cost.
    • Toward cloud: concurrency with peaks and valleys, team-shared use with isolation needs, frequent model and inference-framework iteration (hardware may fall a generation behind within half a year), needs an SLA and production-grade operations, or wants to convert hardware investment into on-demand spending. Public cloud providers such as Baidu AI Cloud offer general capabilities (on-demand GPU compute instances, containerized deployment, object storage, logging and monitoring alerts, elastic scaling) that can make the “validate first, then invest” path very low-cost—first use cloud elastic compute to run through the effect and performance baseline, then move stable, long-term, data-sensitive workloads down to local. This is a very common hybrid strategy.
    • Need both: use a unified service abstraction layer (a standard HTTP interface) to hide the underlying differences, have local and cloud share the same evaluation set and monitoring metrics, and route by workload type. This way, hardware selection isn’t a one-time bet but can be adjusted gradually as needs and cost structure evolve.

    10. Selection Checklist

    Before placing an order, walk through this checklist and you’ll basically avoid most rework:

    1. Calculate VRAM: Use the section 2 script with your own model + target context + target concurrency, and confirm total_gib is below 90% of the card’s capacity.
    2. Check bandwidth: Estimate single-stream tokens/s with bandwidth ÷ (weight size + expected KV Cache) and judge whether it meets the interactive-experience threshold (usually an output speed above 20 tokens/s feels acceptable).
    3. Confirm generation: Check for native support of bf16, low-precision tensor operations, and IO-aware block attention operators. This determines whether you’ll hit a performance wall with long context and high concurrency.
    4. Assess scaling: Is a single card enough? If multi-card is needed, confirm the interconnect channel specs and re-estimate scaling gains by “communication overhead ratio”.
    5. Engineering conditions: PSU rated power and transient capability, chassis airflow, noise tolerance, and whether ECC is needed.
    6. Risk mitigation: Unofficial-channel capacity-expanded products need 24–48 hours of full-load stress testing, a cold-vs-hot throughput comparison, and a clearly defined warranty scope.
    7. Set the cost line: Calculate the break-even hours and compare them with your real monthly usage to determine the local/cloud/hybrid boundary.

    One final sentence to sum up the essence of this selection: Deploying LLMs locally is not an arms race of compute, but a budget-allocation problem among capacity, bandwidth, and generation. Once you’ve computed these three numbers clearly, the value range of any candidate card immediately becomes apparent—the so-called “sweet spot choice” is merely the natural result of demand density falling exactly on a certain VRAM tier.