LLM Cost Optimization with Time-Based Pricing: A Practical Guide
This article explains how time-based (peak and off-peak) pricing for large language model inference works and why it matters for cost optimization. It covers the token-based cost model, a comparison of peak versus off-peak bills across model tiers and input/output ratios, three patterns for shifting workloads, the often-overlooked impact of prompt cache hit rate, and a practical cost governance checklist. Engineers will learn when to call the model matters as much as which model they choose.
1. What Time-Based Pricing Actually Solves
A cloud provider recently revised the pricing for its LLM inference service: on weekdays, requests are split into peak and off-peak windows, while weekends are billed at the off-peak rate all day. The change looks like two lines on a price sheet, but it exposes a long-overlooked fact—the previous time windows did not match real human work rhythms.
Traditional peak/off-peak pricing borrows from the power industry: electricity demand concentrates during the day, so prices are high; demand drops at night, so prices are low. But inference load is not driven by the position of the sun—it is driven by developers’ submission habits. Most interactive calls cluster on weekday daytime, and total weekend volume drops significantly. Keeping weekend daytime in the peak window creates a mismatch between pricing windows and real load: users pay for idle compute, and the peak/off-peak labels lose their steering value.
The real point of this adjustment is not a price cut but realigning the price signal with actual load. For consumers, the engineering takeaway is clear: the first lever for cost optimization is not model selection but when you call.
2. Do the Math: Token Structure and the Cost Delta Model
Before deciding whether off-peak scheduling is worth it, you need a reusable estimation model. Let total daily consumption be T, cache hit rate h, input share α, and output share β (α + β = 1). The three billing quantities are:
cache-hit input = T × h × αcache-miss input = T × (1-h) × αoutput = T × β
For 10 billion tokens per day at a 95% cache hit rate, the cost comparison under two typical input/output structures is below (figures are illustrative estimates to show orders of magnitude, not any specific quote):
| Model tier | Input/Output | Off-peak all day | Peak all day | Delta |
|---|---|---|---|---|
| Lightweight | 95% / 5% | ≈3,414 CNY | ≈6,828 CNY | ≈3,414 CNY |
| Lightweight | 80% / 20% | ≈9,980 CNY | ≈19,960 CNY | ≈9,980 CNY |
| High-capability | 95% / 5% | ≈10,241 CNY | ≈20,483 CNY | ≈10,242 CNY |
| High-capability | 80% / 20% | ≈29,940 CNY | ≈59,880 CNY | ≈29,940 CNY |
Two key conclusions:
- Output share is a cost amplifier. Output tokens typically cost about 3× input tokens. When output share rises from 5% to 20%, the total bill nearly triples, and the absolute savings from off-peak scheduling scale with it.
- Off-peak gains scale with model tier. The more expensive the tier, the larger the per-token peak/off-peak spread, and the better the return on scheduling effort.
3. Three Ways to Put Off-Peak Scheduling into Practice
1. Push batch jobs to nights and weekends
Offline tasks (log summarization, batch labeling, code scanning, regression test generation, report interpretation) are latency-insensitive and can shift wholesale into off-peak windows. In practice, add an “earliest runnable time” field to the task queue and let the scheduler decide whether to dequeue based on the current window’s price.
def next_run_at(now, policy):if now.weekday() >= 5: # Weekend: off-peak all dayreturn nowif policy.is_peak(now): # Weekday peak: deferreturn policy.peak_end(now)return now
2. Throttle during peak instead of blocking
Turn “no calls allowed” into “quota downgrade”: keep quota for interactive paths during peak hours and automatically slow down batch paths. This controls cost without hurting the live experience.
3. Be careful about swapping weekday and weekend load
One idea is to swap weekday and weekend schedules and move heavy load to weekends. This works on cost, but introduces two risks: first, operations and on-call costs rise and may offset the compute savings; second, if the platform tightens quotas during peak, you can get secondary congestion—“limited on weekdays, backlogged on weekends.” A safer approach is tiered off-peak scheduling by task priority, not moving everything by date.
4. The Underrated Lever: Cache Hit Rate
In the table above, cache-hit input accounts for more than 90% of total input, and its unit price is only 1/10 to 1/30 of a cache miss. This means raising the hit rate often pays more than off-peak scheduling. Practical measures include:
- Keep the prompt prefix stable; fix system instructions, tool descriptions, and few-shot examples at the very front;
- Avoid inserting volatile content such as timestamps or random IDs near the front of the context;
- For long documents, use segmented summarization plus summary reuse to reduce repeated prefixes;
- Standardize template versions so frequent changes do not invalidate the cache wholesale.
5. Cost Governance Checklist
- Build a token usage dashboard by model, business line, and time window—measure before optimizing;
- Tag each task type with latency tolerance and generate off-peak policies automatically;
- Route with a lightweight tier first and escalate only complex requests to the high-capability tier;
- Control output length—output compression has the highest marginal return on the bill;
- Review monthly whether the peak/off-peak spread still matches the business load curve.
The deeper value of time-based pricing is that it makes explicit that compute is a resource with time-dependent value. Whoever can smooth their load curve, stabilize prompts, and tighten outputs will get a lower bill for the same business output.
