Why LLM Inference Pricing Is Moving to Peak and Off-Peak Billing
This article explains why large language model inference is shifting from a flat per-token price to time-of-day pricing, and how engineering teams can respond. It covers the rapid drop in inference unit prices, the three multipliers behind a peak/off-peak bill (model tier, time window, and cache hit rate), a sample cost estimation function, four practical optimization techniques, a minimal deferrable-task scheduler, and common mistakes to avoid. Developers will learn which metrics to govern daily to keep inference spending observable, attributable, and controllable.
1. Industry Context: Inference Unit Prices Are Falling Fast
Over the past two years, the economics of large language model inference have changed structurally. An annual AI index-type report from a university showed that, using models that reach the level of early mainstream conversational models on general knowledge benchmarks as a reference, the price per million tokens fell from about $20 to less than $0.1 within two to three years, a drop of nearly two orders of magnitude. The key implication of this data is not that “models got cheaper,” but that inference has turned from a project-based budget item into a measurable, day-to-day operational one.
Once the unit price drops by two orders of magnitude, the dominant factor in the cost structure changes accordingly: the unit price, which used to account for the overwhelming majority of cost, is no longer the only variable. Call volume, input/output ratio, cache reuse rate, and the time distribution of requests now jointly determine the bill. This is the essence of “putting a power meter on intelligence”—metering granularity has been refined from “one total per month” to “per request, per time window, per token type.”
2. The Technical Logic of Peak and Off-Peak Pricing
A platform recently introduced time-of-day pricing, explicitly limiting peak hours to a few hours in the morning and afternoon on weekdays. All other times, weekends, and public holidays are charged at off-peak rates, with the off-peak price being roughly half of the peak price. Meanwhile, prices differ significantly across model tiers: the lightweight tier and the high-performance tier may differ by several times on both input and output, and the input side is further split into cache hits and misses.
Mapped to the system level, these rules can be abstracted into three multipliers:
cost ≈ token count × unit price(model tier) × time coefficient(peak/off-peak) × cache coefficient(hit/miss)
The three multipliers correspond to three engineering capabilities: model routing (choosing the right tier), job scheduling (choosing the right time window), and context reuse (improving the hit rate). Peak and off-peak pricing essentially transplants the load-regulation idea from power grids to compute supply: inference cluster capacity must be built for peak load, but real traffic has clear daytime peaks and nighttime troughs. Using price signals to push deferrable jobs toward the trough improves overall resource utilization and passes the savings on to customers.
3. Cost Modeling: Turn the Bill into Something Computable
Optimization starts with being able to calculate. Teams are advised to build a lightweight cost estimation function that maps business parameters directly to cost:
def estimate_cost(in_tokens, out_tokens,hit_ratio=0.0, peak=True, tier="flash"):price = {"flash": (0.04, 2.0, 8.0),"pro": (0.3, 9.0, 27.0)}[tier] # unit: CNY per million tokenshit_in, miss_in, out = pricein_cost = in_tokens * (hit_ratio * hit_in + (1 - hit_ratio) * miss_in) / 1e6out_cost = out_tokens * out / 1e6return (in_cost + out_cost) * (1.0 if peak else 0.5)
Three counterintuitive conclusions can be read from this formula. First, output tokens are usually several times more expensive than input tokens, so controlling generation length is often more effective than compressing prompts. Second, the price of an input cache miss may be dozens of times that of a hit, and the gain from raising the hit rate from 0.3 to 0.8 often exceeds switching to a cheaper model. Third, the time coefficient is a global multiplier, so moving deferrable traffic to off-peak hours as a whole is equivalent to halving prices across the entire pipeline.
4. Four Practical Optimization Techniques
Context and cache-friendly design. Placing stable, unchanging system instructions, tool definitions, and domain knowledge at the front of the prompt, and putting user input that varies per request at the end, is the basic practice for improving prefix cache hit rates. Avoid inserting volatile fields such as timestamps, random IDs, or request sequence numbers into the fixed prefix, otherwise the prefix will mismatch and the hit rate will plummet.
Tiered model routing. Use the lightweight tier for classification, extraction, rewriting, intent recognition, and similar tasks, and escalate to the high-performance tier only when complex reasoning is needed. The routing decision itself should rely on rules or a small model as much as possible, to avoid introducing new high-cost calls.
Batching and asynchronization. Tasks such as offline summarization, log analysis, batch labeling, and nighttime data cleaning have no real-time requirements and should be routed into a queue and consumed in bulk during off-peak hours. Combined with the elastic scaling of message queues and container platforms, this yields a better throughput-to-cost ratio in the trough.
Output length governance. Reduce output tokens through structured output constraints, explicit length limits, splitting long text into multiple short calls, and incrementally caching completed segments. At the same time, use monitoring and alerting to detect anomalies in the input/output distribution of individual requests, preventing prompt bloat or loop-like retries from driving up the bill.
5. A Scheduling Implementation Example
A minimal working time-of-day scheduler needs only two checks: whether a task is deferrable, and whether it is currently peak time.
import queue, datetimedef is_peak(now, tz_offset=8):if now.weekday() >= 5: # weekendreturn Falset = now.hour + now.minute / 60return (9 <= t < 12) or (14 <= t < 18) # weekday peak windowsdef submit(task, q: queue.Queue):if task.deferrable and not is_peak(datetime.datetime.now()):q.put(task) # run immediately during off-peakelif task.deferrable:q.put(task) # queue and wait during peakelse:run_now(task) # run real-time tasks now
Three additional things are needed in engineering practice: set timeouts and fallback policies for deferred tasks to avoid nighttime backlogs; set quotas and priorities for different tenants to prevent off-peak hours from being monopolized by a single job; and push token usage, cache hit rates, and time distribution to logging and monitoring/alerting services to produce daily or even hourly attribution reports.
6. Common Pitfalls
First, focusing only on unit price while ignoring hit rate and output length, so optimization gains are canceled out. Second, marking all tasks as deferrable, which breaks the interactive experience. Third, mixing volatile content into the cached prefix, keeping the hit rate persistently low. Fourth, lacking usage observability, so bill anomalies cannot be traced to a specific business owner. Fifth, over-provisioning capacity for peak load without using price signals to shave the peak.
7. Conclusion
Time-of-day billing turns inference cost from a vague expense item into an observable, attributable, and optimizable technical metric. For developers, the real competitive edge lies not in finding a cheaper API, but in bringing three metrics—cache hit rate, model routing accuracy, and task time distribution—into daily engineering governance. If an enterprise wants to achieve the same cost controllability in its own environment, it can build its own “smart power meter” on top of general-purpose capabilities such as container platforms, message queues, logging services, and monitoring/alerting offered by Baidu AI Cloud, so that every unit of compute spending has a clear source and destination.
