LLM Inference Cost: Benchmarking Consumption Rates and Tiered Scheduling in Practice

    This article explains why a lower per-token price does not always lead to a lower bill, and how to measure actual LLM inference cost from real usage logs. It covers a linear fitting method for deriving input, output, and cache-hit consumption rates, representative benchmark results across model tiers, budget-to-token conversion, and a tiered scheduling architecture that routes tasks by complexity to control spending. Readers will learn how to build a routing layer, improve cache hit rates, and recalibrate cost models over time.

    1. Background: Why a Lower Unit Price Doesn’t Mean a Lower Bill

    When integrating LLM capabilities into a production system, teams often run into the same puzzle: they pick a model with a lower unit price, yet the monthly bill barely drops. There are usually three reasons.

    First, billing is not based on a single dimension. Most mainstream platforms measure usage across three categories at once: input, output, and cache hits. Output tokens are typically priced significantly higher than input tokens, so long-form generation workloads get amplified on the output side.

    Second, the usage mix gets ignored. Most applications are read-heavy, with input often accounting for more than 70% of tokens. But in generation-heavy scenarios, the output share rises quickly and the cost model flips entirely.

    Third, caching changes the marginal cost. When system prompts, knowledge base snippets, and tool definitions are carried repeatedly, the cached portion of the input may be billed at only a small fraction of the normal input price, which can substantially reduce actual spending.

    So the right starting point for cost evaluation is not the price list, but your own real call logs.

    2. Method: Backing Out Unit Consumption Rates from Real Usage

    When no official billing details are available to reference, you can use repeated observation plus linear fitting to back out the consumption rate per million tokens. The core assumption is that the credits consumed within a given time window equal a linear combination of input, output, and cache-hit usage.

    Let C be the credits consumed in the window, x1 the input tokens, x2 the output tokens, and x3 the cache-hit tokens:

    1. C = a*x1 + b*x2 + c*x3 + d

    Here a, b, and c are the consumption rates to solve for (credits per 1M tokens), and d is a constant term used to absorb things like minimum billing units and rounding errors. As long as you collect three or more sets of linearly independent window data, you can solve for the parameters.

    Illustrative implementation (demonstrating the idea only, not targeting any specific platform API):

    1. import numpy as np
    2. # rows: [input M, output M, cache hit M, 1]
    3. X = np.array([
    4. [12.0, 3.0, 8.0, 1.0],
    5. [30.0, 5.0, 20.0, 1.0],
    6. [5.0, 1.0, 2.0, 1.0],
    7. [18.0, 9.0, 4.0, 1.0],
    8. ])
    9. y = np.array([520.0, 980.0, 120.0, 760.0])
    10. coef, *_ = np.linalg.lstsq(X, y, rcond=None)
    11. pred = X @ coef
    12. ss_res = ((y - pred) ** 2).sum()
    13. ss_tot = ((y - y.mean()) ** 2).sum()
    14. r2 = 1 - ss_res / ss_tot
    15. print(coef, r2)

    To judge whether the fit is trustworthy, look at two metrics: whether the coefficient of determination is close to 1, and whether the residuals are close to 0. If the model reproduces stably across multiple independent windows, the linear model has captured the main structure of the billing. If the residuals are clearly large, it usually means there is tiered pricing, a minimum billing duration, or concurrency surcharges, and you need to split the windows and resample.

    3. Benchmark Results: Consumption Rate Differences Across Model Tiers

    After fitting on several sets of real records, you get a representative set of consumption rates (in credits per 1M tokens) that illustrates the order-of-magnitude relationships:

    • Flagship reasoning tier: input around 80,000, output around 400,000;
    • Upper-mid general-purpose tier: input around 32,000, output around 112,000;
    • Cost-effective execution tier: input around 4,000, output around 8,000, cache hit around 80;
    • Lightweight batch tier: input and output both around 2,000.

    Two key conclusions are worth remembering. First, the flagship tier’s output cost is about 200 times that of the lightweight tier, so output-intensive tasks that mistakenly use the flagship tier will blow up the bill. Second, for the execution tier, once a cache hit occurs, the input-side cost drops to only about 2% of the normal input price, which makes “repeatedly carrying long context” scenarios very economical.

    4. Budget Conversion: How Many Tokens a Quota Supports

    Let B be the quota for the time window, p the input share, and q the output share (p + q = 1). Ignoring caching for now, the total tokens you can process is:

    1. T = B / (a*p + b*q)

    With 60,000 credits per 5 hours and 600,000 credits per week, taking p = 0.8 and q = 0.2 and plugging in the consumption rates above gives an order-of-magnitude comparison: about 417,000 tokens per 5 hours for the flagship tier, about 1.25 million for the upper-mid tier, about 12.5 million for the execution tier, and about 30 million for the lightweight tier. The gap between adjacent tiers is generally 3 to 10 times, and that is the payoff space for tiered scheduling.

    5. Tiered Scheduling: Let Expensive Models “Think” and Cheap Models “Do”

    Given the order-of-magnitude cost differences, you can layer tasks by cognitive complexity rather than assigning them by “which model is strongest”:

    1. Flagship tier: task decomposition, solution design, final code review, and risk backstop;
    2. Upper-mid tier: complex reasoning, tricky defect localization, cross-module refactoring suggestions;
    3. Execution tier: main coding work, routine changes, test completion, combined with caching to reuse system prompts and repository context;
    4. Lightweight tier: batch formatting, comment generation, log classification, simple retrieval Q&A.

    For implementation, it is recommended to introduce a routing layer that uses rules or a lightweight classifier to decide the task tier, and to write the decision, token usage, and credit consumption into a logging service, with monitoring alerts set to daily quota thresholds. A schematic structure looks like this:

    1. request -> routing decision (complexity / expected output length)
    2. |- high -> flagship tier (planning + review)
    3. |- mid -> upper-mid tier (reasoning)
    4. |- low -> execution tier (coding, cache on)
    5. \- batch -> lightweight tier (concurrent queue)

    Supporting engineering measures include: stabilizing system prompts and tool definitions to improve cache hit rates; splitting long documents into reusable snippets; capping output length to avoid overly long generations on the flagship tier; and placing batch jobs into a message queue to run off-peak.

    6. Conclusion and Cautions

    The essence of cost governance is matching “model capability” to “task complexity” and continuously calibrating with data. The consumption rates above are results I derived from personal benchmarking, not an official price list. Platform rules and pricing methods can change at any time, so it is advisable to re-fit once a month with new window data and keep residual monitoring in place; once fitting quality degrades, resample.