LLM Inference Cost Evaluation: What to Look at Beyond Per-Token Pricing

    As LLM applications move into production, cost discussions shift from "how much does one call cost" to "how much does it cost to complete one business task." This article introduces a total cost of ownership model for measuring cost per unit of effective output, explains why output throughput and time-to-first-token affect the bill indirectly, and shows how first-pass yield acts as the denominator of cost. It also covers evaluation metrics, caching and peak-load considerations, and a practical action checklist for comparing model generations.

    1. Background: A Higher Unit Price Does Not Mean Higher Cost

    Once LLM applications enter production, teams stop asking “how much does a single call cost” and start asking “how much does it cost to complete one business task.” When a new flagship model’s published price is several times that of the previous flagship generation, the first reaction is usually that it is expensive. But if you switch the measurement from unit price to cost per unit of effective output, the conclusion can be the exact opposite.

    One useful point from the original discussion is that people who have actually used the new generation for a long time often feel it is more cost-effective. The reason is that improvements in output speed, long-context stability, and instruction following allow the same business workload to be completed with fewer calls and shorter retry chains. Arguing this rigorously requires a computable model rather than a subjective impression.

    2. Breaking “Expensive” Into Computable Terms: A Total Cost of Ownership Model

    Cost per unit of effective output can be described with the following abstract formula:

    1. Cost per unit of effective output =
    2. (input token cost + output token cost + retry cost + orchestration and storage cost + human review cost)
    3. ÷ effective output volume
    4. where:
    5. input token cost = input tokens × input unit price
    6. output token cost = output tokens × output unit price
    7. effective output volume = total requests × first-pass rate × (1 - business rework rate)

    The point of this model is that unit price only affects two terms in the numerator, while the denominator (effective output volume) is often where the real difference comes from. Raising the first-pass rate from 70% to 90% is equivalent to cutting unit cost by roughly 22%, which is usually enough to absorb a price increase.

    3. The Underrated Variable: Output Throughput and Waiting Time

    The original discussion emphasizes output speed, which maps to two engineering metrics: tokens output per second, and time to first token. Neither appears directly on a bill, yet both affect total cost through three paths.

    The first is timeouts and retries. The slower the output, the more likely a long answer triggers a gateway or client timeout, and a single failure wastes all input tokens plus everything already generated. Retry cost is pure loss.

    The second is concurrency capacity. When per-request throughput is higher, fewer concurrent replicas are needed to reach the same business throughput, which reduces elastic resource usage and the frequency of cold starts.

    The third is product experience and conversion. In highly interactive scenarios such as AI coding and conversational customer support, waiting time directly affects whether users continue, which is a real cost that is hard to price directly.

    A more reasonable way to compare two model generations, therefore, is to compare the new flagship’s unit price against the previous generation’s “high-speed tier” price. Align the capability tiers first, then compare prices, instead of comparing a new flagship directly with an old standard tier.

    4. The Quality Dimension: First-Pass Rate Is the Denominator

    Beyond speed, what determines the denominator is output usability. A practical approach is to sample business tasks into a fixed evaluation set and track these metrics:

    • Structural compliance rate: whether outputs can be parsed reliably by downstream parsers (for example, complete JSON fields with correct types);
    • Instruction-following rate: whether any constraints are missed under multiple conditions;
    • Long-context hit rate: whether key information placed in the middle of a long input is referenced correctly;
    • Factual consistency: whether conclusions stay stable across repeated samples of the same input.

    Illustrative evaluation and cost calculation code:

    1. def unit_cost(rows, price_in, price_out, retry_factor=0.0, review_cost=0.0):
    2. total_cost = 0.0
    3. valid_output = 0
    4. for r in rows:
    5. attempts = 1 + r["retries"] * retry_factor
    6. total_cost += (r["in_tokens"] * price_in
    7. + r["out_tokens"] * price_out) * attempts
    8. total_cost += r["need_human_review"] * review_cost
    9. if r["passed"]:
    10. valid_output += 1
    11. return total_cost / max(valid_output, 1)

    5. Peaks, Elasticity, and Engineering Support

    A production system’s bill is determined by peak load, not by the average. Evaluation should factor in general cloud capabilities such as caching (prefix caching and semantic caching), batching, asynchronous queues, result reuse in object storage, logging services, and monitoring and alerting. Every 10-percentage-point gain in hit rate reduces input-side cost by roughly the same proportion. If you use the relevant general capabilities from Baidu AI Cloud, you can build a cost dashboard on top of its monitoring, alerting, and logging services, group consumption by business line, and catch anomalies before month end instead of after.

    6. Conclusion and Action Checklist

    A multiple on the unit price is only the surface. Real cost is determined by effective output volume. Recommended steps:

    1. Build an evaluation set of 200–500 real business tasks and label the pass criteria;
    2. Load-test both model generations and record time to first token, tokens per second, and timeout rate;
    3. Align capability tiers under a consistent measurement before comparing prices;
    4. Use the formula above to compute cost per unit of effective output instead of comparing unit prices;
    5. After launch, keep monitoring first-pass rate and cache hit rate, and re-run the selection analysis dynamically.

    Following this process, most teams will find that even with a higher unit price, a new flagship model delivers a lower cost per unit of effective output, with the advantage most visible in long-output, highly interactive, and high-concurrency scenarios.