From Running to Operating: A Technical and Economic Analysis of Production-Grade Inference on Domestic AI Compute
Debunking the gap between "the model runs" and "the service sustains production workloads," this article breaks down domestic AI compute inference capability into three maturity levels—functional usability, resource efficiency, and scale operations. It explains how to interpret latency, throughput, and cache-hit metrics correctly, why raw performance gaps don't translate directly into profitability gaps, and how enterprises should design production validation for large language model inference.
From “It Runs” to “It Operates Sustainably”
Discussions about progress in large language model (LLM) inference on domestic AI hardware often fall into two extremes. One focuses only on peak-performance gaps versus other hardware, concluding that any lag means no commercial value. The other equates a successful model deployment with mature production capability.
Neither judgment is complete.
Inference serving is not an isolated chip benchmark. It is a system composed of the model, operators, memory management, communication, request scheduling, caching, and operations. A chip with strong theoretical compute doesn’t necessarily deliver lower costs in real workloads; a pipeline that returns correct answers isn’t automatically able to sustain a high volume of user requests.
The significance of open-sourced, production-grade inference code should therefore be understood in the context of the full serving chain: it has the potential to turn raw hardware capability into reusable, verifiable, and maintainable engineering capability. That said, whether code is open and whether a service meets high standards are two different questions. Openness lowers the barrier for technical validation and engineering adaptation; meeting the standard still requires real traffic, long-term operating records, and explicit acceptance criteria.
Three Levels of Maturity for Inference Capability
1. Functional usability: can the model run correctly?
The first level is completing deployment and correctness verification, including loading model weights, executing the computation graph, adapting basic operators, and validating results.
The problems at this stage are nontrivial. For example, numerical behavior can differ across hardware, and mixed-precision execution can change the distribution of numerical errors. Teams shouldn’t just confirm that the service outputs text—they should also verify that model quality on representative tasks remains within an acceptable range.
Functional validation should at minimum cover:
- Different input and output lengths;
- Different concurrency levels;
- Typical requests and edge-case requests;
- Behavior under numerical anomalies and resource exhaustion;
- Model loading and recovery after service restarts.
This level proves the technical path is feasible—not that performance or cost is competitive.
2. Resource efficiency: turning hardware capability into effective throughput
The second level is optimizing resource utilization. Bottlenecks in inference may come from compute, but also from memory bandwidth, data movement, inter-device communication, or scheduling overhead.
For example, during autoregressive decoding, the system repeatedly reads model weights and prior state. If data access is inefficient, compute units with high peak capability can still spend much of their time idle.
Optimization therefore shouldn’t target individual operators only—it should address the end-to-end pipeline:
- Operator fusion to reduce intermediate reads and writes;
- Data layouts chosen to match hardware characteristics;
- Improved cache allocation to reduce fragmentation and redundant data movement;
- Parallelism tuning to cut communication waits;
- Dynamic scheduling to increase effective batch sizes;
- Lower-precision execution, where quality permits.
The goal is not simply to maximize device utilization. If high utilization comes with heavy queuing, degraded latency, or failed requests, “running full” does not mean the service is more efficient.
The more sensible objective: increase effective output while satisfying service-quality constraints.
3. Scale operations: stable delivery under real traffic
The third level is running the optimized inference system continuously.
Real traffic is inherently unpredictable: inputs vary in length, output length can’t be known in advance, hot requests appear suddenly, and different users have different latency expectations. Results from fixed-input, fixed-concurrency experiments rarely reflect production behavior.
Production-grade systems must provide traffic control, fault isolation, failure recovery, and continuous observability. Evaluation should shift from “it was fast once” to “it consistently meets targets over long periods.”
At scale, performance, reliability, and cost must all hold at the same time.
Interpreting Latency and Throughput Metrics Correctly
Time to first token shapes the interactive experience
Time to first token (TTFT) is how long a user waits after sending a request before receiving the first output unit.
It is affected by queuing, input preprocessing, prefill computation, cache lookup, and network transmission. For interactive applications, excessive TTFT makes the service feel unresponsive.
Don’t evaluate TTFT by the median alone—also look at high percentiles. The median reflects the typical experience; high percentiles reveal latency problems during peak hours or with complex requests.
Also note that different tests may define the TTFT timing boundary differently: some start from when the server receives the request, others from when the client sends it. Numbers aren’t directly comparable when boundaries differ.
Per-request output speed shapes the reading experience
Per-request output speed is usually measured in tokens generated per second. A token is the basic unit the model processes and is not strictly equivalent to a Chinese character or an English word.
This metric describes how quickly content is generated once a request starts producing output. For long-form generation and code analysis, it directly determines how long users wait for the full result.
But per-request speed is not the same as the device’s production capacity. One system may generate output very fast for a small number of requests while failing to handle high concurrency efficiently; another may raise total throughput through larger batches, at the cost of slower generation per request.
Per-request speed and total throughput must therefore be evaluated together.
Per-device throughput measures resource output
Per-device decode throughput is the total number of tokens the device generates per unit of time across all requests. It is closer to a resource-productivity metric, but it still cannot be divorced from service-quality constraints.
If throughput is raised by accumulating requests while queue times keeps growing, then even an impressive throughput number may be unsuitable for interactive workloads.
A more useful metric is:
Effective throughput that meets latency and quality requirements.
In other words, only outputs that meet agreed quality, are delivered successfully, and satisfy latency requirements should count as business-relevant output.
Why Long Context and Cache Hit Rate Change Evaluation Results
Long-context inference typically involves two main stages:
- Prefill: processing the input text and building the state needed for generation;
- Decode: generating new content step by step from that state.
When inputs are long, prefill can consume substantial compute and storage. To reduce the cost of repeated processing, inference systems can reuse computed state associated with identical prefixes.
However, cache hit rate is a metric that must be interpreted carefully.
First, hit rate may be counted per request or per reusable token—two different meanings. Many short requests hitting the cache doesn’t necessarily mean large compute savings.
Second, cache reuse doesn’t eliminate long-context costs entirely. Cached state still needs to be stored and accessed, which can incur device memory occupation, data movement, and cross-device transfer overhead.
Third, cache behavior depends heavily on request structure. Applications where many requests share fixed prefixes can differ dramatically in resource consumption from applications where every input is unique.
When evaluating, at minimum record the input-length distribution, output-length distribution, shared-prefix ratio, cache accounting method, and latency differences between hits and misses. Comparing throughput or revenue in isolation, without these conditions, easily produces distorted conclusions.
A Performance Gap Is Not Automatically a Profitability Gap
Revenue-based comparisons reflect a way of measuring hardware value through commercial output. But without knowing the test methodology, billing rules, device configuration, and cost structure, specific numbers should not be treated as universally applicable conclusions.
A device with lower hourly revenue cannot be concluded to be unprofitable; conversely, higher revenue doesn’t guarantee higher profit.
A simplified model helps:
Contribution per unit of time = actual revenue − direct operating cost per unit of time.
Actual revenue depends on effective request volume, billing method, pricing, and settlement rules. Direct operating costs may include equipment depreciation or leasing, power, infrastructure, networking, and related operations spending.
A complete assessment should also factor in software adaptation, R&D and maintenance, capacity headroom, and losses from failures.
For output-billed services, a rough estimate is:
Revenue per unit of time ≈ effective output throughput × price per unit of output.
But this is not a complete profit formula. Real businesses may also involve input-based billing, cache-related pricing, discounts, and failure-handling rules, and not all generated content converts into billable revenue.
Another key factor is demand volume. If demand is insufficient, a device with high peak throughput may still struggle to amortize costs due to long idle periods. Commercial judgment should compare total cost of ownership under equal service quality—not theoretical fully-loaded conditions.
The Engineering Value and Limits of Open Production-Grade Code
The value of production-grade code lies not just in showcasing a technique, but in exposing a complete engineering path that can be studied.
For developers, it can clarify:
- How operators are organized and invoked;
- How compute, communication, and data movement connect;
- How requests enter the scheduling queue;
- How cache and memory are allocated and reclaimed;
- How to limit blast radius when failures occur;
- How performance metrics are collected and attributed.
This information reduces repeated trial-and-error when moving from basic deployment to an operable system.
That said, publicly viewable code doesn’t mean any team can directly reproduce the original results. Hardware configuration, build environment, model architecture, network conditions, and request distribution all affect outcomes. Before using such code, check the license scope, dependencies, documentation completeness, and maintenance status.
A mature ecosystem isn’t built by a single repository, either. It requires compilers and runtimes, core operators, debugging and analysis tooling, deployment standards, testing practices, and accumulated developer experience.
A truly valuable ecosystem ultimately lets developers locate problems, validate improvements, and sustainably maintain systems at controllable cost.
How Enterprises Should Run Production Validation
1. Define business objectives first
Before launch, clarify which requests must be prioritized, which can tolerate longer waits, and what quality and reliability requirements the service must meet.
At minimum, define TTFT, overall response time, request success rate, concurrency capacity, quality acceptance criteria, and cost ceilings. Without these constraints, performance optimization easily drifts away from business needs.
2. Build a reproducible workload set
Test requests should approximate real business traffic—not fixed lengths and repeated prefixes.
The workload set should cover short and long inputs, short and long outputs, cache hits and misses, bursty traffic, and sustained high load. When real data is involved, apply appropriate anonymization and access controls.
Also record the model version, numerical precision, parallelism scheme, device count, and timing boundaries so results are comparable across tests.
3. Locate bottlenecks with observability data
At minimum, monitor request queue time, prefill time, decode time, memory usage, cache hits, communication time, failure rate, and resource utilization.
Optimization should be evidence-based. If the bottleneck is memory access, adding compute parallelism may not help; if the main problem is queuing, optimizing operators alone may not improve user experience.
4. Ramp up traffic gradually with rollback capability
After offline validation, introduce a small fraction of traffic first, then scale up based on changes in quality, latency, and cost. Define stop conditions at every stage to avoid amplifying traffic under anomalous conditions.
Where necessary, split resource pools by request length or business priority to reduce the impact of long requests on short ones. But isolation can also lower overall utilization—test and trade off accordingly.
5. Accept based on sustained operation, not a single peak
Production acceptance should cover cache evolution, traffic peaks, memory fragmentation, device failures, and service recovery.
Only a system that maintains acceptable performance through these variations has true sustained delivery capability.
Conclusion: Earning a Seat at the Table Requires Quality, Stability, and Economic Viability at the Same Time
The sign that domestic AI hardware has entered production-grade inference is not a single successful deployment, nor a single performance number approaching the leaders. It is the ability to serve continuously under explicit business constraints, with an explainable and reproducible cost structure.
Open production-grade inference code is an important engineering lever for this transition: it lowers validation barriers, promotes reuse of experience, and turns optimization from individual teams’ practices into broader technical accumulation.
But “high standards” should not be a vague label. It requires concrete answers: Is service quality stable? Does latency meet business requirements? Is throughput actually valuable? Is cost controllable? Can failures be recovered? Can the system be maintained over time?
When these questions all have verifiable answers, domestic AI compute will truly move from “a usable technical option” to “a sustainable production capability.”
