A Practical Cost Guide to Deploying Large Language Models On-Premises

    Open weights do not automatically mean low deployment costs. Using a sample MoE model with roughly 743B total parameters, about 39B activated parameters per token, and native 1M context support, this guide breaks down the real cost structure of local LLM deployment: the VRAM ledger beyond weights, three budget tiers, hidden costs that teams often underestimate, and a practical optimization checklist. It also explains when on-premises deployment makes more sense than cloud API calls, and why calculating KV Cache, interconnect, and operations costs first should come before hardware selection and procurement.

    1. First, the Math: Why “Open Source” Does Not Mean “Low Cost”

    When many teams see a model with open weights, their first instinct is “just download it and run it.” In reality, weights are only one item in the cost structure, and often not the most expensive one. Take the sample model in this article: it uses a Mixture-of-Experts (MoE) architecture with roughly 743B total parameters, activates about 39B parameters per generated token, and natively supports a 1M context.

    These three numbers determine three separate budgets:

    • Total parameters set the “can it fit” threshold, meaning the minimum VRAM capacity.
    • Activated parameters set the “can it run fast” threshold, meaning compute and memory access pressure.
    • Context length sets the “can it stay stable” threshold, meaning the ongoing consumption of KV Cache and VRAM bandwidth.

    MoE characteristics easily lead to misjudgment: since activated parameters are only about 5% of total parameters, some conclude that “compute requirements are very low.” But note that MoE reduces the number of multiply-accumulate operations per forward pass; it does not reduce the weight residency requirement—all expert weights must either stay resident in VRAM or be rapidly swapped in and out between nodes. So the capacity threshold has not dropped; the pressure has simply shifted from compute to VRAM capacity and interconnect bandwidth.

    2. The VRAM Ledger: Weights Are Never the Only Occupant

    For local deployment, VRAM is claimed by at least four parties:

    1. Model weights: strongly tied to precision format; FP8 roughly halves the footprint compared to BF16.
    2. Runtime overhead: the inference framework, operator libraries, communication buffers, CUDA context, and so on, typically amounting to a few GiB to over ten GiB.
    3. KV Cache: grows linearly with concurrency and context length, and is the largest consumer in long-context scenarios.
    4. Fragmentation and reserved headroom: margins introduced by VRAM pooling, paged attention, and similar mechanisms.

    An illustrative capacity estimate (for order-of-magnitude illustration only, not measured values from any specific product):

    1. # Rough capacity estimate, unit: GB
    2. def estimate(total_params_b, precision_bytes, kv_per_token_gb,
    3. ctx_len, concurrency, runtime_overhead_gb=12):
    4. weights = total_params_b * precision_bytes # weight residency
    5. kv = kv_per_token_gb * ctx_len * concurrency # KV Cache pool
    6. return weights + kv + runtime_overhead_gb
    7. # Minimum residency order of magnitude with FP8 weights (1 byte/param)
    8. print(estimate(743, 1, 0, 1024, 1)) # weights + runtime only

    The conclusion is straightforward: FP8 weights alone are already on the order of 743GB, and once runtime overhead is added, a single 8-card high-end accelerator server (141GB VRAM per card, roughly 1.1TB total per machine) is only just “enough to look at” in terms of capacity, leaving very little room for KV Cache.

    3. Three Budget Tiers: From Entry Ticket to High-Concurrency Long Context

    Building on the ledger above, budgets can be discussed in three tiers (amounts are order-of-magnitude illustrations and fluctuate with supply chains and configurations):

    • Entry tier (on the order of RMB 3.5 million): one 8-card high-VRAM accelerator server running FP8 can produce results and validate effectiveness, suitable for small-scale coding assistance and internal evaluation. The risk is that the KV Cache pool is very small, making 1M context and high concurrency essentially out of the question.
    • Stable tier (on the order of RMB 7.3–8 million): dual-node deployment, forming a unified VRAM pool over high-speed interconnect, stably supporting the full 1M context under FP8 with concurrency headroom. This is the realistic starting point for “offering a service externally.”
    • Optimized tier (significantly lower cost): adopting a lower-bit quantization scheme (such as a W4A8 combination of 4-bit weights and 8-bit activations), paired with 1TB of VRAM per machine and a KV Cache pool approaching 4M, can stably serve small-scale coding scenarios through reasonable batch size and count settings.

    The third tier is the path many teams should actually take: instead of forcing the original precision through, accept verifiable precision loss in exchange for an order-of-magnitude cost reduction.

    4. Three Underestimated Hidden Costs

    • Networking: in multi-node deployments, expert parallelism and pipeline parallelism generate heavy communication; ordinary Ethernet becomes a bottleneck, and high-speed interconnect is almost mandatory. This budget is often missed.
    • Operations: long-context services face VRAM fragmentation, request queuing, and timeout retries, requiring monitoring and alerting, logging services, and capacity dashboards. Labor costs often exceed hardware depreciation.
    • Iteration: recompilation and re-tuning brought by model and framework version upgrades are an ongoing investment.

    5. Optimization Checklist: Spend the Budget Where It Counts

    1. Precision tiering: run weights at low-bit quantization while keeping activations at higher precision, prioritizing code and structured output quality.
    2. Context tiering: treat 1M context as a “priority lane” for a few requests, and cap normal requests at 32K–128K, which can greatly shrink the KV Cache pool.
    3. Batch tuning: target throughput rather than single-request latency, dynamically adjusting batch size and wait windows.
    4. Cache reuse: reuse KV for prefixes such as system prompts and repository context to reduce repeated computation.
    5. Elastic fallback: run normal loads on the local cluster and spill peak overflow to general-purpose cloud on a pay-as-you-go basis, avoiding paying for peak capacity year-round.

    6. How It Differs from Calling a Cloud API

    The differences concentrate in three points: data boundary (data stays on-premises), cost curve (local is fixed investment, cloud is pay-as-you-go spending), and controllability (versions, context policies, and batch parameters are all under your own control). When call volume is stable and data is sensitive, the marginal cost of local deployment approaches electricity and operations; when call volume is sparse or highly volatile, pay-as-you-go is more economical. Many mature teams ultimately choose a hybrid form: sensitive and high-frequency workloads stay local, while long-tail and peak loads go to the cloud.

    7. Conclusion

    “Open source” solves the licensing problem; it does not solve capacity, bandwidth, or operations problems. For the sample model in this article, RMB 3.5 million is only an entry ticket, and stably supporting 1M context requires a dual-node budget; meanwhile, through low-bit quantization and batch tuning, a small-scale usable solution can see significantly lower costs. The truly professional approach is to first factor the three hidden costs—KV Cache, interconnect, and operations—into the model, then decide the tier: calculate first, select second, and only then procure.