Why LLM Inference Costs Keep Falling: Peak Pricing, Caching, and Model Routing
This article explains why large language model inference prices have dropped so sharply and what developers can do to control spending. It breaks down the four variables behind an inference bill, then covers three practical cost levers: time-based peak and off-peak pricing for deferrable workloads, prompt prefix design that improves cache hit rates, and model tiering with routing. It also outlines a five-step cost governance loop and shows how object storage, message queues, container platforms, and monitoring can support it. Readers will learn how to schedule workloads, structure prompts, and track cost per unit of business output rather than chasing the lowest price.
1. Introduction: When Intelligence Starts Charging by the Meter
Over the past two years, the unit price of large language model inference has followed a curve that looks almost implausible. An annual AI index-type report from a university research group shows that, taking as a reference the models that reached the level of early mainstream conversational models on general knowledge benchmarks, the price per million tokens fell from roughly $20 at the end of 2022 to about $0.07 by October 2024 — a drop of around 286x. This is not a promotion from a single vendor but the combined result of the whole supply chain: more efficient attention implementations, more aggressive quantization and sparsification, more mature inference serving and scheduling, and a substantial increase in hardware utilization.
The signal that really matters to developers is that the billing model itself is evolving. The industry has recently seen the practice of “peak and off-peak time-of-day pricing” — one platform began enforcing two price tiers, peak and idle, in mid-August 2026, then launched a lighter model version in September and cut API prices further. Under its published standard, the lighter tier charges per million input tokens during peak hours about ¥0.04 on a cache hit and about ¥2 on a cache miss, with output at about ¥8; the more capable tier corresponds to about ¥0.3, ¥9, and ¥27; and idle periods are uniformly half the peak price. Peak hours are explicitly defined as Beijing time weekdays from 9 a.m. to 12 p.m. and 2 p.m. to 6 p.m., with all other hours, weekends, and public holidays billed at the idle rate.
Put in one sentence: intelligence has been fitted with an electricity meter. And once there is a meter, the goal of engineering optimization shifts entirely from “can it run” to “is every unit of power well spent.”
2. The Cost Model: Start by Dissecting the Bill
To cut costs, you first have to be able to do the math. A large model inference bill is typically determined by four variables, none of which can be ignored:
- Input token volume: includes system prompts, conversation history, retrieved context, and tool return values.
- Output token volume: usually carries several times the cost weight of input and cannot be predicted.
- Cache hit status: whether the same prefix is reused on the server side.
- Time tier and model tier: peak/idle, lightweight/high-capability.
A rough function can express this:
def estimate_cost(in_tokens, out_tokens, cache_hit_ratio,in_price, out_price, peak=True):# Input tokens that hit the cache are billed at the cache price; misses at the standard input pricehit = in_tokens * cache_hit_ratiomiss = in_tokens - hitprice_in = in_price["cache_hit"] * hit + in_price["cache_miss"] * missprice_out = out_price * out_tokensfactor = 1.0 if peak else 0.5 # Off-peak is usually half of peakreturn (price_in + price_out) * factor
This function reveals three counterintuitive conclusions. First, the output side is often where the bulk of the cost lies, so controlling response length is more effective than compressing the prompt. Second, the cache hit rate has a nonlinear effect on the total bill, because it simultaneously reduces the majority of input-side spending. Third, the time tier is a pure “scheduling dividend” — moving the same request to an idle period cuts the cost in half directly, with no compromise in model capability.
3. Mechanism One: Time-of-Day Pricing and Deferrable Workloads
The essence of peak and off-peak pricing is bringing the grid’s peak-shaving and valley-filling logic into compute supply. Inference cluster load naturally has peaks and valleys: resources are tight during peak hours with high marginal cost, while during idle hours resources sit unused with marginal cost close to zero. Using price signals to steer deferrable tasks off-peak is a win-win.
Which workloads can be shifted off-peak? There is only one criterion: is the user waiting in real time?
- Deferrable: batch document summarization, offline data labeling and cleaning, automatic categorization of logs and tickets, overnight report generation, incremental knowledge base rebuilding, model evaluation and regression batch runs.
- Not deferrable: first-round responses in online customer service, code completion, real-time risk-control decisions.
From an engineering standpoint, it is advisable to introduce a unified task scheduling layer that tags each request with a latency tolerance label, with the scheduler deciding whether to run immediately or queue until an idle window:
def schedule(request, now, peak_hours):if request.latency_sensitive or not peak_hours(now):return run_now(request)return enqueue_until_offpeak(request, now)
Combined with a message queue for peak shaving and object storage to hold intermediate artifacts, the whole pipeline can run at full throughput during idle periods, pushing the average unit price down to half the peak rate. One engineering detail to watch: timeout settings for deferred tasks should be relaxed, retry strategies must be idempotent, and queue backlog needs alerting — otherwise the money saved will be paid back in the form of missed deadlines.
4. Mechanism Two: Cache Hits and Prompt Prefix Design
Cache-based pricing turns “prompt engineering” from guesswork into measurable cost engineering. Its core premise is prefix stability: the server typically reuses computed results based on the longest common prefix, so any change to content earlier in the prompt invalidates the entire prefix.
This leads to a few hard rules:
- Structure prompts as a “stable layer + variable layer.” Put system instructions, tool definitions, output format constraints, and a few examples at the front and keep them unchanged over the long term; put user input, retrieved snippets, and timestamps at the end.
- Do not inject dynamic content at the head of the prompt. Fields like the current time, random IDs, and request sequence numbers, once placed at the front, will drive the hit rate to zero.
- In retrieval-augmented scenarios, control context ordering. Keep the most frequently reused background documents fixed, and place query-specific snippets at the end.
- In multi-turn conversations, keep the history prefix append-only and avoid modifications, since rewriting a summary can break the prefix.
A sketch of stable/variable layering:
[Stable prefix · reusable via cache]System role definitionTool and function signaturesOutput JSON SchemaFixed few-shot examples[Variable suffix · different each time]Retrieved relevant snippetsUser's current question
The price table makes the benefit clear: a cache-miss input costs ¥2 and a hit ¥0.04, a 50x difference. In agent-style applications with long system prompts, fixed tool sets, and high-frequency similar requests, achieving a high hit rate can typically reduce input-side cost by an order of magnitude.
5. Mechanism Three: Model Tiering and Routing
The ¥2/¥8 and ¥9/¥27 in the price table reflect a gradient of capability and cost. The mature approach is to build a routing layer that splits traffic by task difficulty rather than using the strongest model for everything.
- Intent recognition, classification and tagging, format extraction, keyword rewriting: lightweight tier.
- Routine Q&A, summarization, translation, simple code generation: lightweight tier with stricter output length constraints.
- Complex reasoning, multi-step tool calls, long-chain code refactoring: high-capability tier.
Routing can be rule-based, model-based (using a small model to judge whether an upgrade is needed), or feedback-based (automatically retrying and upgrading low-confidence outputs). A sketch:
def route(task):if task.difficulty <= 2 and task.max_tokens <= 512:return "lite"if task.needs_tool_chain or task.difficulty >= 4:return "pro"return "lite"
Companion guardrails are equally important: set an output cap for each call, compress and summarize overly long context, apply result-level caching (semantic caching) for repeated requests, and degrade rather than escalate on failed requests, to keep costs from spiraling on exceptional paths.
6. Putting It into Practice: A Five-Step Cost Governance Loop
- Instrument and measure. Tag by business line, scenario, model tier, and time tier; record input/output tokens, cache hits, and per-call cost, feeding into logging services and monitoring/alerting systems.
- Set budgets and quotas. Define daily/monthly budgets and rate-limit thresholds per scenario; auto-degrade to the lightweight tier or queue off-peak once thresholds are exceeded.
- Refactor prompts. Rework all templates to the stable-prefix standard and quantify the change in hit rate before and after.
- Schedule off-peak. Move deferrable tasks into idle windows, carried by queues and batch processing.
- Review and iterate. Use “cost per unit of business output” (such as per thousand tickets or per ten thousand lines of code) as the core metric for weekly reviews, rather than looking only at unit price.
A reminder: a falling unit price does not mean falling total spend. When call volume grows tenfold with the business, the bill can still rise even if the unit price drops a hundredfold. The key to cost governance has never been chasing the lowest unit price, but ensuring every dollar spent corresponds to measurable business value.
7. Conclusion
From $20 to $0.07, the industry has proven in two years how far inference costs can fall; and peak and off-peak pricing, cache-based pricing, and model tiering hand control over cost reduction back to developers. Once intelligence has been fitted with a meter, the outcome no longer depends on who can afford to call the strongest model, but on who schedules load more intelligently, writes more stable prompt structures, and instruments cost metrics more finely. On top of the general capabilities offered by platforms like Baidu AI Cloud, teams can build their own cost loop using object storage, message queues, container platforms, and monitoring and alerting, putting every unit of “intelligence power” to the best use.
