LLM Inference Cost and Gross Margin Practices on Domestic AI Compute Clusters
This article breaks down the engineering economics of large language model inference on domestic AI accelerator clusters, focusing on cost structure, effective token output, and the paths that turn inference gross margin positive. It covers model routing, quantization, continuous batching, prefix caching, percentile-based capacity planning, hardware adaptation, and compliance-driven architecture decoupling.
1. From an Industry Thesis to an Engineering Problem
A recent research report maintained an overweight rating on a generative AI company. The core logic was not short-term market sentiment but three fundamental signals: smooth commercialization of the main model series, a healthy revenue-sharing structure with multiple cloud providers with margins improving quarter over quarter, and the early penetration stage of the domestic AI application market. The report also noted that the company runs large-scale, low-cost inference on a cluster of more than 100,000 domestic chips and has achieved positive inference gross margin on certain lightweight models.
Translated into engineering language, this comes down to three things: cost per token, revenue per token, and whether the gap between them stays positive as scale grows. This article evaluates no specific vendor or product. Instead, it abstracts the thesis into a reusable technical methodology for enterprises selecting domestic compute and building inference platforms.
2. Cost Structure: Where the Money Actually Goes
Inference cost is often simplified as “compute unit price × call volume,” an estimate that almost inevitably distorts reality in engineering practice. A more realistic model is:
cost per token = (compute depreciation + power and datacenter + network and storage + operations staff + software stack amortization) / effective output tokenseffective output tokens = nominal throughput × effective utilization × (1 - retry failure rate)
Three variables are the most commonly underestimated:
- Effective utilization. There is a significant gap between peak QPS, average QPS, and GPU/NPU occupancy. If resources are provisioned for peak load, utilization tends to stay low over the long term.
- Retry failure rate. Extra-long contexts, failed structured output validation, and timeouts all consume compute while producing unusable results.
- Software stack amortization. Operator adaptation, quantization toolchains, and monitoring systems are one-time investments that must be amortized over the lifecycle.
The conclusion: the first lever for cost reduction is not buying cheaper chips, but raising effective utilization and cutting wasted consumption.
3. Four Engineering Paths to Positive Gross Margin
3.1 Model Tiering and Routing
Route requests by difficulty: lightweight models handle high-frequency simple requests, and only complex requests are escalated to large-parameter models. This is the fastest path to positive gross margin because it directly changes the ratio of revenue to cost.
def route(prompt: str) -> str:# Illustrative: coarse-grained tiering by length and task typeif len(prompt) < 512 and not need_reasoning(prompt):return "small_model"return "large_model"
3.2 Quantization and Operator Adaptation
Low-bit quantization (such as INT8/INT4 weights and KV Cache compression) typically delivers dual gains in memory and bandwidth on domestic hardware. Note that accuracy regression testing is mandatory after quantization, especially for long-text and code generation scenarios. Output quality regression directly raises the retry rate and cancels out the gains.
3.3 Continuous Batching and Memory Management
Replace static batching with continuous batching, combined with paged KV Cache management, to significantly increase concurrency density. In practice, set a maximum queue wait time to avoid tail latency degradation that triggers client-side timeout retries.
3.4 Cache Reuse
Apply prefix caching and result caching to system prompts, long document prefixes, and high-frequency Q&A. Repeated prefixes often account for a large share of enterprise workloads, and the gains here are frequently underestimated.
4. Capacity Planning: From Peak Thinking to Percentile Thinking
Plan capacity backward from P95/P99 latency targets rather than from peak load:
required concurrency ≈ target QPS × P95 latencycluster size = required concurrency / (per-card concurrency × effective utilization)
Also build three tiers of elasticity: reserved resources for baseline traffic, elastic resources for daytime peaks, and an offline queue for deferrable batch jobs (such as batch summarization and offline labeling). Moving deferrable traffic off the online path is the single most effective way to raise overall utilization.
5. Key Practices for Domestic Hardware Adaptation
- Operator coverage first: before procurement, run operator coverage and accuracy alignment tests with real business samples to avoid being forced back to CPU after launch.
- Match communication topology to parallelism strategy: keep tensor parallelism within a single machine where possible, prefer pipeline parallelism across machines, and reduce cross-node bandwidth pressure.
- Build observability in: bring token-level usage, cache hit rate, retry rate, and per-card power into unified monitoring and alerting, and store logs and metrics separately to control cost.
- Canary release and rollback: new inference images must support percentage-based canary rollout and one-click rollback, so model iteration does not cause availability jitter.
6. Commercialization and Compliance Constraints
The report noted that rules on obtaining compute overseas are tightening, while companies that keep compute within the country and hold overseas compute assets through partners are less affected. The takeaway for technical teams: decouple compute location, data residency, and business distribution at the architecture level. Inference services where data does not leave the country, and tiered deployments with domestic training and overseas invocation, both reduce the rework cost caused by policy shifts.
Funding pace also shapes the technical roadmap. In well-funded periods, invest in long-cycle in-house operator and inference engine optimization. In tight periods, prioritize general-purpose cloud services (such as container platforms, object storage, message queues, and monitoring and alerting) to quickly build an elastic foundation and convert fixed investment into variable cost.
7. Risk Checklist
- Supply chain uncertainty from export controls and geopolitics;
- Downward price pressure from commoditized competition;
- Misalignment between execution and profitability pace under heavy R&D spending;
- Uncertain customer adoption speed, with domestic application penetration as the main growth variable;
- Over-reliance on compute infrastructure and external suppliers.
8. Conclusion
Positive inference gross margin is not an engineering accident but the combined result of tiered routing, quantization adaptation, batch scheduling, cache reuse, and capacity planning. If enterprises make “effective output tokens” a core metric in their monitoring system from the start, they can find a path to AI application deployment with controllable cost and sustainable margin under the dual constraints of limited compute and fluctuating demand.
