How to Choose GPUs and Configuration for Local LLM Deployment

    This article explains how to plan local deployment of large language models by focusing on capacity rather than GPU count. It breaks down VRAM usage into weights, KV Cache, runtime overhead, and safety margin, provides a Python estimation script, and discusses the four key variables: context length, concurrency, request type, and response targets. It also outlines a single-node reference path, scaling strategy, a practical workflow from estimation to load testing, and common pitfalls.

    1. Start with Requirements, Not GPU Count

    When evaluating local deployment for a large-parameter model, the most common opening question is how many accelerators fit in a single machine. In real engineering environments, that number alone rarely determines the final configuration. A more reliable approach is to define three things first: the precision used to load weights, the context length you need to support, and the concurrency and response targets you must meet. Once these are quantified, the GPU count and node topology become much clearer.

    A reusable rule of thumb: with native low-precision weights (such as FP8), a single node with 8 accelerators, each with about 141GB of VRAM, is a clear single-node starting point. If extremely long context (million-level tokens) is a hard requirement, prioritize options with higher per-GPU VRAM and memory bandwidth. The point is not the model name, but whether the combination of per-GPU VRAM capacity, inter-GPU interconnect bandwidth, and total node VRAM matches the workload.

    2. Account for VRAM Properly: Weights Are Only One Part

    Local deployment VRAM usage typically comes from four parts, and weights are the easiest to estimate:

    1. Model weights: roughly “parameter count × bytes per parameter.” For models ranging from tens of billions to hundreds of billions of parameters loaded in low precision, weights alone can reach hundreds of GB.
    2. KV Cache: directly related to context length, concurrent requests, layer count, and attention head count. It is the main variable in long-context scenarios.
    3. Runtime and framework overhead: temporary activations, communication buffers, VRAM fragmentation, and framework reservations.
    4. Safety margin: space reserved for peak fluctuations and failover, which should not be squeezed to the limit.

    The following illustrative estimation script makes these variables explicit for quick comparison during selection:

    1. def estimate_vram(num_params_b, bytes_per_param,
    2. layers, kv_heads, head_dim,
    3. ctx_len, concurrency, overhead_ratio=0.15):
    4. weights = num_params_b * 1e9 * bytes_per_param
    5. # KV Cache estimate: 2(K/V) * layers * kv_heads * head_dim * context * concurrency * bytes
    6. kv = 2 * layers * kv_heads * head_dim * ctx_len * concurrency * 2
    7. total = (weights + kv) * (1 + overhead_ratio)
    8. return total / (1024 ** 3) # GB
    9. print(estimate_vram(600, 1.0, 80, 8, 128, 1_000_000, 1))

    This formula reveals a key pattern: with concurrency of 1, long context mainly amplifies KV Cache; as concurrency rises, KV Cache grows almost linearly and quickly exceeds the weights themselves. The combination of context and concurrency is therefore the dividing line for VRAM planning.

    3. Four Variables That Actually Determine Configuration

    3.1 Context Length

    Context determines the upper bound of KV Cache. Short context (thousands of tokens) and extremely long context (million-level tokens) can differ by an order of magnitude in VRAM demand. If the business genuinely needs long-document understanding, cross-session memory, or large-scale code repository retrieval, prioritize options with larger per-GPU VRAM, combined with paged cache management, context compression, or tiered caching to reduce peaks.

    3.2 Concurrency and Request Patterns

    Offline batch processing and online interaction are two completely different workloads. The former pursues throughput and can tolerate higher latency; the latter is sensitive to time-to-first-token and output token rate. Rising concurrency amplifies both KV Cache and scheduling pressure, at which point the benefits of inter-GPU interconnect bandwidth and parallelism strategies (tensor parallelism, pipeline parallelism) become evident.

    3.3 Request Type

    Long-text summarization, structured extraction, code completion, and multi-turn dialogue have different preferences for VRAM and compute. Code completion requests usually have short context and bursty traffic, favoring preemptive scheduling and cache reuse; long-form generation continuously occupies large VRAM blocks and requires stricter admission control.

    3.4 Response Targets

    Goals need to be described with quantifiable metrics, such as time-to-first-token limits, output tokens per second, maximum context per request, and peak concurrency. Without these numbers, “is it enough” can never be answered.

    4. Single-Node Reference Path and Scaling Strategy

    • Prefer single node: as long as total node VRAM covers “weights + peak KV Cache + margin,” prefer a single-node approach, because inter-GPU interconnect is usually more efficient inside a node and communication overhead is more controllable.
    • Prioritize per-GPU VRAM over stacking GPUs: for extremely long context, the gains from adding GPUs may be offset by communication overhead, while larger per-GPU VRAM directly relieves KV Cache pressure.
    • Scale horizontally with scheduling: multi-node deployment requires request routing, session stickiness, and cache affinity strategies; otherwise cross-node migration significantly increases time-to-first-token.
    • Validate precision and quantization: low-precision loading can significantly reduce VRAM and bandwidth pressure, but output quality must be validated on business datasets to avoid sacrificing usability for VRAM savings.

    5. Implementation Workflow: From Estimation to Load Testing

    1. Define metrics: write down context length, peak concurrency, time-to-first-token, and throughput targets.
    2. Estimate VRAM: use the script above to calculate peak weights and KV Cache, and reserve margin.
    3. Choose a parallelism strategy: prefer intra-node tensor parallelism, adding pipeline parallelism when necessary.
    4. Validate with small traffic: run a canary with real request distributions, observing VRAM levels and latency distributions rather than only averages.
    5. Load test and tune: gradually increase concurrency to locate whether the bottleneck is VRAM, bandwidth, or scheduling; build a capacity baseline with monitoring, alerting, and logging.
    6. Solidify the capacity model: write load test results back into the capacity formula to form a reusable selection template.

    6. Common Pitfalls

    • Looking only at GPU count without per-GPU VRAM, which easily exposes shortfalls during load testing in long-context scenarios.
    • Counting only weights and not KV Cache, causing paging or request rejection once concurrency rises after launch.
    • Evaluating interactive services with average latency while ignoring the experience impact of long-tail requests.
    • Ignoring inter-GPU interconnect and parallelism strategies, mistaking intra-node issues for insufficient compute.

    7. Conclusion

    Back to the original question: whether a few GPUs are enough is essentially a capacity planning problem, not a numbers problem. Writing precision, context, concurrency, request type, and response targets as computable inputs, then validating with estimation plus load testing, yields a configuration that is both reliable and not wasteful. If you need to support extremely long context, prioritize a single-node path with more generous per-GPU VRAM and bandwidth; if context and concurrency are within a controllable range, a single-node low-precision setup usually covers most online and offline scenarios.