LLM Inference Cost Benchmarking and Tiered Scheduling in Practice

    Abstract: Published per-million-token prices are a poor predictor of actual LLM bills. This article shows how to reverse-engineer per-tier consumption rates from real call logs using least squares, convert a fixed credit budget into usable token volume for different input/output mixes, and route tasks across four model tiers by cognitive difficulty. It also covers prefix stabilization for cache hits, observability, and weekly recalibration. The figures are order-of-magnitude estimates derived from personal measurements, not an official price list.

    1. Why a Low Unit Price Does Not Mean a Low Bill

    When building coding assistants, document understanding systems, or customer support Q&A applications, teams commonly budget from the published per-million-token price alone. Actual bills often deviate by several multiples. Three reasons stand out: input and output prices usually differ by an order of magnitude, while most workloads are either long-input/short-output or the reverse; cache hits, batching, and context reuse significantly reshape the effective billing structure; and capability gaps between model tiers mean they cannot be substituted interchangeably.

    A more reliable approach is reverse engineering. Take real call records over a period of time — input tokens, output tokens, cached tokens, and credit deductions — run a linear regression, and derive the per-credit consumption rate for each model tier. When the goodness of fit approaches 1 and residuals approach zero, the billing structure has been characterized accurately, and budgeting and scheduling finally have a mathematical basis.

    2. Method: Fitting Consumption Rates from Real Records

    For the i-th call in a given time window, let x_i be input tokens, y_i output tokens, h_i cached tokens, and c_i the credit deduction. The model is:

    1. c_i = a * x_i + b * y_i + d * h_i + e

    Here a, b, and d are the per-credit consumption rates for input, output, and cache hits, and e is the intercept (theoretically close to 0). Solving with least squares yields the coefficients for each tier. Practical recommendations: use at least several hundred calls; cover both long and short inputs across different output sizes; exclude failed retries and interrupted streaming samples; fit each model separately rather than pooling them.

    Fitting four typical tiers produces a representative set of magnitude relationships (the values below are order-of-magnitude estimates reverse-engineered from personal measurements, not any official price list, and the rules may change at any time):

    Tier Input (credits/1M) Output (credits/1M) Cache hit (credits/1M)
    Flagship reasoning ~80,000 ~400,000 Implementation-dependent
    High-capability general ~32,000 ~112,000 Implementation-dependent
    Cost-effective execution ~4,000 ~8,000 ~80
    Lightweight batch ~2,000 ~2,000 Lower still

    Two key conclusions: flagship output cost can reach roughly 200x the lightweight tier, and for the cost-effective execution tier, cache hits reduce input cost to about 2% of the normal rate. This explains a familiar pattern — with the same budget, different scheduling strategies can differ by two orders of magnitude in usable token volume.

    3. Budget Conversion: Tokens per Unit of Credit

    Assume an account rule of 60,000 credits per 5 hours and 600,000 credits per week, a workload mix of 80% input and 20% output, and no cache for now. The total token volume supported per unit of budget is approximately:

    1. Flagship reasoning: ~417K tokens / 5 hours
    2. High-capability general: ~1.25M tokens / 5 hours
    3. Cost-effective execution: ~12.5M tokens / 5 hours
    4. Lightweight batch: ~30M tokens / 5 hours

    The conversion is straightforward: split the budget into input and output allocations by the mix ratio, divide each by the corresponding consumption rate, then add them. For long-document summarization (over 90% input), the flagship tier’s usable volume drops further; for code generation (output-heavy), the gap widens even more. A budget table must therefore be tied to the workload mix rather than reusing generic values.

    4. Tiered Scheduling: Expensive Models Think, Cheap Models Execute

    The essence of cost optimization is not pushing unit prices down but routing tasks by cognitive difficulty:

    1. Flagship reasoning: requirement decomposition, solution design, final review, and root-cause analysis of difficult issues. Low call volume, high value per call.
    2. High-capability general: complex reasoning, cross-file refactoring, long tool-call chains.
    3. Cost-effective execution: the bulk of coding, unit test generation, and log analysis — high-frequency work that drops another order of magnitude with cache reuse.
    4. Lightweight batch: formatting, field extraction, and bulk rewriting with clearly defined rules.

    The routing layer can use a dual channel of rules plus confidence: the lightweight tier produces a draft and a confidence score first, low-confidence samples escalate to the execution tier, and anything touching architectural decisions escalates to the flagship tier. Sketch of the logic:

    1. def route(task):
    2. if task.kind in ("format", "extract", "rewrite"):
    3. return "light"
    4. draft, conf = light_model(task)
    5. if conf < 0.6:
    6. return "mid"
    7. if task.impact == "architecture" or task.risk == "high":
    8. return "flagship"
    9. return "mid"

    5. Cache and Context Governance

    Cache hit pricing is typically only a few percent of normal input pricing, which makes reusable prefixes the biggest lever. Engineering measures include: pinning the system prompt, tool definitions, and specification documents at the head of the context and keeping them byte-level stable; splitting long documents into stable chunks and reusing them; avoiding volatile content such as timestamps and random IDs inside a session; and using the batch API for batch workloads. A rough estimate: if the prefix accounts for 60% of input and all of it hits, input cost falls by more than half.

    6. Observability and Continuous Calibration

    A cost dashboard is mandatory: track input, output, and cached tokens plus credit consumption by model tier, business line, and call source; rerun the least squares fit weekly and watch for coefficient drift; set threshold alerts for anomalous calls such as oversized contexts and repeated retries. Also keep a fallback plan: when the high-tier quota is exhausted, switch automatically to the next tier down and annotate the result’s confidence.

    7. Conclusion

    The root of the cost difference is the tiered pricing structure, not “expensive versus cheap.” Fitting consumption rates from real records, converting budget by workload mix, routing by cognitive difficulty, and stabilizing prefixes to raise cache hit rates — combined, these four steps can increase usable token volume by one to two orders of magnitude on the same budget. To repeat: the numbers above are order-of-magnitude estimates reverse-engineered from personal measurements, not an official price list. Refer to the service provider’s latest published terms for the actual rules.