Cost Optimization and Architecture Practices for Large-Scale LLM Inference Serving

    What a large language model can answer is determined by its weights, but how much a token costs and whether the service is profitable is determined by the inference system. Drawing on publicly disclosed figures from a leading inference service—a single cluster processing 155 trillion tokens per day at roughly $38 per GPU-hour in revenue—this article breaks down the engineering behind such systems. It examines three core questions: what each design choice saves, what it costs, and which metrics you can use as benchmarks when replicating the architecture on your own cluster. Topics include service throughput accounting, multi-vendor chip compatibility, Prefill/Decode disaggregation, a 72-hour tiered KVCache system, time-budget-based scheduling, and max-minimizing load balancing, concluding with a practical checklist of benchmark metrics. Cost Optimization and Architecture Practices for Large-Scale LLM Inference Serving

    Cost Optimization and Architecture Practices for Large-Scale LLM Inference Serving

    Introduction: A Model’s Limits Live in Its Parameters; Its Price Limits Live in the System

    What a large language model can answer is determined by its weights. But how much a token sells for, and whether the service turns a profit, is determined by the inference system. When a leading inference provider publicly reports figures like “a single cluster processing 155 trillion tokens per day, with overall revenue equivalent to $38 per GPU-hour,” the scale itself is not the most interesting part. The real question behind those numbers is: given the same hardware, can you serve more requests at lower cost?

    This article does not restate any vendor’s official documentation. Instead, it takes apart this class of large-scale inference systems to answer three engineering questions: what does each design save, what does it cost, and if you want to replicate it on your own cluster, which numbers can serve as benchmarks?

    1. Start with the Math: Does Throughput Match the Economics?

    The simplest sanity check is a single division. 155 trillion tokens per day converts to per-second throughput as follows:

    1. 155 × 10^12 ÷ 86400 ≈ 1.79 × 10^9 tokens/s

    That’s roughly 1.79 billion tokens per second. Spread across an estimated 7,300 accelerator cards:

    1. 1.79 × 10^9 ÷ 7300 ≈ 245,700 tokens/s/card
    2. 245,700 × 3600 ≈ 8.85 × 10^8 tokens/card·hour

    It’s important to note that this 885 million figure is serving throughput (billed output tokens), not compute throughput (the hardware’s theoretical ceiling). The gap between the two is exactly what KVCache hit rates, request scheduling, and load balancing—the systems engineering work—must close. The officially disclosed figures also mention a KVCache hit rate of about 85% and online efficiency at roughly 80% of offline inference, which means the system wastes almost no compute under real traffic.

    2. Three Design Goals and Their Cost-Reduction Strategies

    2.1 Multi-Vendor Chip Compatibility: Supply Elasticity Is Also a Cost Lever

    Supporting both NVIDIA accelerators and domestic chips such as Ascend—and running them all near capacity—essentially converts “single-supply-chain risk” into “procurement bargaining power.” The engineering cost is real: the operator layer needs two or more hardware-specific optimization passes, and the communication library must adapt to different interconnect topologies. The benchmark is straightforward: the ratio of effective throughput for the same model across different chips—the closer to 1, the better the abstraction layer.

    2.2 Hardware Organized by Phase: The Natural Division Between Prefill and Decode

    Prefill is compute-bound; Decode is memory-bandwidth-bound. Running both on the same machine leaves both underutilized. A typical approach:

    • General-purpose 8-GPU servers handle Prefill with small-scale expert parallelism (EP 2–8), maximizing compute density within each chunk;
    • 64–128 GPU supernodes handle Decode with wide expert parallelism (Wide-EP 64–128), using massive parallelism to amortize per-step memory reads and communication overhead;
    • Tensor parallelism and context parallelism are deliberately not introduced, avoiding extra communication-link complexity.

    This separation enables independent scaling: during traffic spikes, you scale Prefill and Decode capacity separately based on their respective queue lengths.

    2.3 Retaining KVCache for 72+ Hours: Absorbing Repeated Prefill Through a Reuse Window

    This is the most critical lever for unit economics. The three-tier cache hierarchy looks roughly like this:

    • HBM: stores the hottest data for direct read/write by active requests;
    • Host memory: stores sliding window attention (SWA) window data, about 1.4 MB per sequence;
    • Distributed file cache: stores block-level KV at roughly 528 bytes per token, supporting reuse windows of 72 hours or more.

    The trade-off is recomputation complexity. SWA data never enters the remote cache; when missing, bounded replay rebuilds only the last 128 tokens. If exact reconstruction is required, 2,560 tokens must be replayed. The trade is clear: a small amount of recomputation in exchange for an order-of-magnitude reduction in storage cost.

    3. The Scheduling Layer: Flattening Uneven Traffic

    Prefill Side: Solving for Chunk Size from a Time Budget

    Rather than fixing chunk size, the system is given a per-step latency budget and solves backward for how many tokens can currently fit. Long requests can’t monopolize the device, and short requests aren’t slowed down by long chunks.

    Decode Side: Two-Dimensional Load Balancing

    Decode balances load across both the expert dimension and the request dimension. The Expert Parallelism Load Balancer (EPLB) minimizes the maximum load across cards rather than the average—because a pipeline step completes when the slowest card finishes, so compressing the max directly shortens step latency.

    4. A Replicable Benchmarking Checklist

    To replicate this on your own cluster, verify metrics in the following order:

    1. Serving throughput per card-hour: is it in the hundreds of millions of tokens?
    2. KVCache hit rate: 85% is a strong reference level;
    3. Online/offline efficiency ratio: 80% indicates scheduling overhead is under control;
    4. Post-disaggregation utilization: compute utilization for Prefill, memory bandwidth utilization for Decode;
    5. Tail latency: the effect of max-minimizing load balancing shows up directly in P99.

    For implementation, you can use a general-purpose container platform for heterogeneous compute orchestration, object storage or a distributed file system for cold KVCache data, and a monitoring and alerting stack to watch drift in these five metrics. Cloud providers such as Baidu AI Cloud offer general product categories in heterogeneous compute scheduling, distributed caching, and observability, which can supplement a self-built system or serve as reference baselines.

    5. Conclusion

    The real value of the 155-trillion and $38 figures is not proving how strong one particular system is—it’s giving the entire industry a ruler. Competition in inference serving has moved from “can it run” to “how much economic value can each card produce per hour.” P/D disaggregation, wide expert parallelism, tiered KVCache, max-minimizing load balancing—none of these techniques are mysterious. The hard part is getting all of them right simultaneously in the same cluster. Benchmarking, decomposing, and filling gaps one by one is the only path to low-cost inference.