LLM Private Deployment Cost: GPU Memory and Cluster Budget Breakdown

    Private LLM deployment budgets are often underestimated when only model weights are counted. This article breaks GPU memory requirements into model weights, runtime overhead, KV cache, and headroom; explains why MoE models must be sized by total parameters rather than activated parameters; shows how long context and concurrency inflate KV cache; and provides a node-planning framework, a cost-estimation template, cost-reduction options, and a pre-budget checklist.

    1. Start with the Conclusion: Weights Are Only Part of the Cost

    Many teams estimate private deployment costs by calculating only how much GPU memory the model weights occupy. That estimate is usually too low. A inference system that can reliably serve external requests needs at least four categories of GPU memory: model weights, runtime overhead, KV cache, and headroom. The first two determine whether the system can start at all; the last two determine how many users it can serve and how long a context it can support.

    A budget should therefore be calculated at two levels: whether the model can run, and whether it can serve stably. The first is the entry threshold. The second determines the final hardware scale and capital investment.

    2. Why MoE Does Not Save GPU Memory as Much as Expected

    The core idea behind Mixture of Experts (MoE) is that each token activates only a subset of expert networks during forward computation. As a result, the per-step compute is much smaller than the model’s total parameter scale. This reduces inference compute cost, but it does not reduce the GPU memory occupied by weights.

    The reason is that during inference, the system cannot know in advance which experts a given token will be routed to. All expert weights must either reside in GPU memory or be available in memory that can be called quickly. This leads to a conclusion that is easy to overlook:

    • GPU memory capacity is mainly determined by the total parameter count.
    • Per-generation compute latency and throughput are partly determined by the activated parameter count.

    This means that a large MoE model may still require multiple GPUs or even multiple nodes to hold its weights, even if only a small fraction of parameters are activated per step. During model selection, storage requirements should be calculated from total parameters, while performance should be evaluated based on activated parameters and communication overhead.

    3. The Four Components of a GPU Memory Budget

    3.1 Model Weights

    The formula for weight memory is straightforward:

    Weight memory ≈ number of parameters × bytes per parameter

    Bytes per parameter under different precisions are roughly as follows:

    Precision Bytes per parameter Weight footprint for 700B parameters
    BF16 / FP16 2 About 1,400 GB
    FP8 / INT8 1 About 700 GB
    INT4 0.5 About 350 GB

    Actual usage also includes metadata such as quantization scaling factors, so the numbers in the table are lower-bound estimates. Low precision can significantly reduce GPU memory requirements, but accuracy loss must be validated through business evaluation. Do not make decisions based only on memory numbers.

    3.2 Runtime Overhead

    Beyond weights, the inference system needs additional space:

    • Context overhead from GPU drivers and low-level runtimes;
    • Memory pools and scheduling structures inside the inference framework;
    • Temporary activation tensors during forward computation;
    • Communication buffers for multi-GPU parallelism.

    This overhead depends heavily on framework implementation, batching strategy, and parallelism method. As an initial estimate, it is reasonable to reserve 10% to 20% of the total requirement, then correct the number with stress-test data.

    3.3 KV Cache

    KV cache stores the attention keys and values for historical tokens so that the full context does not need to be recomputed every time a new token is generated. Its footprint is proportional to sequence length and concurrency:

    KV memory ≈ 2 × layers × KV heads × head dimension × bytes per element × sequence length × concurrency

    Attention structures such as grouped-query attention or compressed attention significantly affect the number of KV heads, and therefore the size of this component. Calculations should use the real parameters from the specific model configuration file rather than generic values.

    3.4 Headroom

    In production, request-length fluctuations, memory fragmentation, and burst traffic all consume additional space. If hardware is provisioned at the theoretical minimum, the service can easily reject requests or reduce batch size during peak periods because of insufficient GPU memory. A reasonable approach is to leave a safety margin above the theoretical value and determine the final number after stress testing.

    4. Why Long Context Drives Up Costs

    Context length is the most sensitive variable in the cost model. KV cache grows linearly with sequence length, so expanding context from 128K to 1M increases the KV footprint of a single request by about 8x.

    The following calculation uses hypothetical parameters. Assume the model has 80 layers, 8 KV heads, head dimension 128, and KV stored in FP8:

    1. Per-token KV bytes = 2 × 80 × 8 × 128 × 1 = 163,840 bytes (about 160 KB)
    2. KV for one 1M-context request = 163,840 × 1,048,576 ≈ 160 GiB
    3. KV with 4 concurrent requests = 160 GiB × 4 = 640 GiB

    This example shows that even if the weights themselves fit into one node, KV cache can quickly exceed the weight footprint as concurrent 1M-context requests increase. This is the fundamental reason for the clear gap between “the model can be loaded” and “the model can serve full long-context traffic.”

    It is important to note that the layer count, head count, and other parameters above are used only to demonstrate the calculation method. They are not the real configuration of any specific model.

    5. Node Planning: Single Node or Dual Node

    Hardware planning usually needs to answer three questions.

    First, is total GPU memory sufficient? Total memory should at least satisfy: weights + KV cache + runtime overhead + headroom.

    Second, is inter-GPU and inter-node bandwidth sufficient? Expert parallelism and tensor parallelism both require frequent data exchange. If interconnect bandwidth is insufficient, compute units spend a large amount of time waiting for communication, and actual throughput falls far below the theoretical value. Cross-node deployment also introduces network latency, which has a clear impact on time to first token. A dual-node design is therefore not just a matter of doubling memory; the network topology and communication library configuration must be fully validated.

    Third, does the combination of concurrency and context match the business? The same hardware can have very different capabilities when supporting a few long-context requests versus many short-context requests. Planning should start by clarifying the request distribution, then determine the context limit and concurrency target.

    The original estimate mentioned that an entry-level single-node hardware investment is about RMB 3.5 million, while a dual-node design capable of supporting full long-context service has a budget of roughly RMB 7–8 million. These figures are only order-of-magnitude references, because hardware prices are affected by procurement channels, lead times, regional taxes, exchange rates, and time. The real budget should be based on actual quotations.

    6. Cost Estimation Template

    The sample code below shows the basic estimation flow so that teams can use a consistent approach. The code is only for illustrating the calculation logic; parameters must be replaced with actual model configurations and stress-test results.

    1. function estimate_memory_gb(params_b, bytes_per_param, layers, kv_heads,
    2. head_dim, kv_bytes, ctx_len, concurrency,
    3. overhead_ratio):
    4. weights = params_b * 1e9 * bytes_per_param
    5. kv_per_token = 2 * layers * kv_heads * head_dim * kv_bytes
    6. kv_total = kv_per_token * ctx_len * concurrency
    7. total = (weights + kv_total) * (1 + overhead_ratio)
    8. return total / 1e9
    9. function estimate_gpu_count(total_gb, per_gpu_gb, min_nodes_gpus):
    10. count = ceil(total_gb / per_gpu_gb)
    11. return max(count, min_nodes_gpus)
    12. total = estimate_memory_gb(
    13. params_b = 700, bytes_per_param = 1, layers = 80, kv_heads = 8,
    14. head_dim = 128, kv_bytes = 1, ctx_len = 1048576, concurrency = 4,
    15. overhead_ratio = 0.15)
    16. gpus = estimate_gpu_count(total, per_gpu_gb = 80, min_nodes_gpus = 8)

    After calculating total GPU memory and GPU count, you still need to calculate hardware cost. A budget should be structured as follows:

    • Compute hardware (accelerators and server hosts);
    • Racks, power, cooling, and data center modifications;
    • High-speed network and storage;
    • Software licenses and operations tools;
    • Labor costs for deployment, tuning, and on-call support;
    • Power and depreciation over three to five years.

    A budget that counts only procurement price usually underestimates total cost of ownership. Power and operations labor often account for a substantial share.

    7. Common Ways to Reduce Cost

    1. Quantization compression. Reducing precision from BF16 to FP8 or INT8 can directly halve the weight footprint. Before and after quantization, run comparative evaluations on the target business dataset, focusing on inference accuracy and stability with long text.

    2. Tiered context. Not every request needs a 1M context. Set different context limits by request type and route long-context requests to a dedicated resource pool to reduce overall GPU memory pressure.

    3. Request scheduling and rate limiting. Reasonable batching, priority queues, and concurrency limits can improve effective throughput on the same hardware and avoid GPU memory overflow caused by peak requests.

    4. Choose the deployment form based on load. For businesses with volatile traffic and unstable peaks, renting compute on demand may be more economical than long-term self-hosting. For scenarios with high data compliance requirements and stable call volume, self-hosting or dedicated deployment is more appropriate. Both approaches should be compared based on total cost of ownership.

    5. Validate at small scale first. Before investing in a full cluster, validate the inference pipeline, monitoring metrics, and performance curves with a smaller model or shorter context. This can significantly reduce the risk of rework later.

    8. Pre-Decision Checklist

    Before approving a budget, confirm the following questions:

    • Does the business really need full long context, and what is the distribution of target context lengths?
    • What is the target concurrency, and how large is the ratio between peak and average?
    • Has quantization accuracy been evaluated, and are the results acceptable to the business?
    • Does the memory estimate use the real model configuration and include headroom?
    • Do inter-node network bandwidth and latency meet the requirements of the parallel plan?
    • Does total cost of ownership include power, data center, operations, and labor?
    • Is there stress-test data to support the final GPU and node counts?

    The cost of private deployment depends on the combination of three variables: context, concurrency, and precision. Define these three variables clearly before comparing hardware quotations; only then does the budget have practical meaning.