The True Cost of Self-Hosting a Large Language Model On-Premises

    A detailed breakdown of the real costs of deploying a large language model on-premises, covering GPU memory budgeting, KV cache scaling, the difference between running a model and serving it reliably at 1M context, and the long-term TCO factors such as power, operations, and utilization.

    1. Start Here: What You Are Actually Paying For

    When teams first evaluate moving a large language model into their own data center, they tend to fixate on a single number: the size of the weight files. In a real inference service, however, memory consumption goes well beyond the weights themselves. At a minimum, it includes:

    • Model weights: determined by parameter count and numerical precision;
    • Runtime overhead: the inference framework, operator libraries, communication libraries, CUDA contexts, and so on;
    • KV Cache: roughly proportional to context length and the number of concurrent requests, and the main variable in long-context scenarios;
    • Redundancy and fault-tolerance headroom: sharding fragmentation in multi-GPU parallelism, reserved capacity for failover, and the resources consumed by monitoring and logging components.

    Take the sample model in this article: roughly 743B total parameters, a typical sparse Mixture-of-Experts (MoE) architecture that activates about 39B parameters per generated token and natively supports a 1M context. Here is a key point to understand: MoE’s “fewer activated parameters” only reduces computation, not memory usage, because all expert weights must remain resident in GPU memory.

    2. GPU Memory Budget: Precision Sets the Entry Bar

    Weight memory can be roughly estimated as “parameter count × bytes per parameter.” At FP8 precision, each parameter takes about 1 byte, so 743B weights theoretically require around 743GB of GPU memory. The weights alone already exceed half of a single 8-GPU server with 141GB-class accelerators (about 1128GB combined), and once KV Cache and runtime overhead are added, the remaining headroom is very tight.

    This is why the common industry conclusion is that an FP8 version needs at least one 8-GPU high-memory accelerator server, with a whole-machine budget of roughly RMB 3.5 million. But that is only the threshold for “getting it to run.” It typically supports limited concurrency and moderate context, and struggles to reliably deliver million-token context service at high concurrency.

    An illustrative memory accounting logic (pseudocode):

    1. total_memory = weight_bytes + kv_cache + runtime_overhead
    2. kv_cache ≈ 2 * layers * kv_heads * head_dim * ctx_len * batch * bytes_per_elem

    Raising ctx_len from 4K to 1M inflates the KV Cache by roughly 256x; doubling batch again adds pressure linearly. This is why “being able to load the model” and “being able to serve it externally” are two completely different budget tiers.

    3. From Usable to Stable: The Real Cost of 1M Context and High Concurrency

    To maintain stable service under a full 1M context, you typically need:

    1. Two nodes with multi-machine, multi-GPU parallelism to avoid a single point of failure;
    2. Sharding strategies such as context parallelism or sequence parallelism to spread the KV Cache of long sequences across more GPUs;
    3. More than 30% reserved headroom to handle burst concurrency and fragmentation;
    4. High-bandwidth interconnect and high-speed storage to reduce cross-machine communication and weight-loading bottlenecks.

    Under this design, preparing two nodes of high-memory accelerators puts the budget in the range of roughly RMB 7.3 million to RMB 8 million. This figure covers one-time investments such as servers, accelerators, networking, and storage, and does not yet include the data center, power, and operations.

    4. Don’t Overlook Long-Term Spending: Power, Operations, and Utilization

    The one-time purchase is only the starting point on paper. Continuous operation also requires considering:

    • Power and cooling: a fully loaded 8-GPU machine typically draws several kilowatts, and the electricity and cooling costs of running two nodes long-term are not negligible;
    • Operations staff: drivers, frameworks, monitoring and alerting, logging services, and incident handling all require dedicated personnel or platform-level capabilities;
    • Utilization: if a private cluster averages under 30% utilization, the cost per token will be significantly higher than an on-demand cloud option;
    • Iteration cost: compatibility validation and regression testing brought by model and framework upgrades.

    5. Decision Guidance: Which Scenarios Suit On-Premises

    • Scenarios with extremely high data-compliance requirements that mandate physical isolation, where on-premises deployment is a hard requirement;
    • Inference workloads that are stable and fully loaded long-term, where hardware amortization is more cost-effective;
    • Small- and mid-scale trials, where it is advisable to first run elastic validation on a general-purpose cloud container platform with object storage before deciding whether to purchase;
    • Cost-sensitive cases that still need long-context capability, where a hybrid architecture of “distilled/quantized small model + cloud large model fallback” can be evaluated.

    The conclusion is straightforward: open source does not equal low cost. RMB 3.5 million is only the entry ticket. To reliably support a 1M context and high concurrency, the budget should be planned at RMB 7.3 million to RMB 8 million, with power and operations folded into the total cost of ownership (TCO).