Why LLM Inference Costs Keep Falling: A Practical Guide to Token Pricing, Caching, and Scheduling
This article explains why large language model inference has become dramatically cheaper, breaking down the variables behind a typical bill: model tier, time-of-use pricing, and effective input volume. It shows how shared-prefix caching, off-peak scheduling, and model routing with cascading fallbacks can reduce unit costs without sacrificing perceived quality, and why observability metrics such as cache hit rate, off-peak share, and model-tier distribution turn cost control into an ongoing engineering practice.
1. The Cost Curve: From Paying Per Token to Paying Like Electricity
Public industry research offers a representative data point: for models reaching a given level of capability on general knowledge benchmarks, the price per million tokens fell from the $20 range to the $0.07 range in roughly two years, a drop of about 286x. The significance of this curve is not any single number but the fact it reveals: LLM inference is shifting from a scarce research resource to a metered, schedulable, optimizable utility.
The evolution of pricing models illustrates the trend even more clearly. Time-of-use pricing has already appeared in the industry: higher prices during peak hours and half price during off-peak hours. Inputs are also priced separately depending on whether they hit a cache, with cached inputs costing as little as a fraction of uncached ones. In one platform’s published pricing structure, for example, a lightweight model’s per-million-token input price differs substantially between cache hits and misses during peak hours, output is priced higher than input, and a more capable flagship model costs several times more than the lightweight tier.
For developers, the direct implication is that the bill is no longer determined solely by how many tokens you call. It is determined jointly by when you call, how much of the input hits the cache, and which model tier you select. Cost governance has become an architecture problem rather than a finance problem.
2. What Actually Drives the Cost
Breaking the bill apart yields a simple formula that is easy to reason about:
cost per request ≈ input tokens × input unit price (cache hit/miss, peak/off-peak)+ output tokens × output unit price (peak/off-peak)
Each of the three variables maps to a class of optimization techniques:
- Unit price tier: determined by model capability levels. Use lightweight models for simple tasks and flagship models for complex reasoning.
- Time coefficient: determined by scheduling policy. Move deferrable batch jobs to off-peak hours.
- Effective input volume: determined by context engineering and cache reuse. Repeated prefixes should not be billed repeatedly.
It is worth stressing that output tokens are usually more expensive than input tokens, and output length is often driven by both the length of business copy and the length of the reasoning chain, making it the main source of long-tail bills.
3. Technique 1: Stable Prefixes and Cache Hits
Most platforms’ caching mechanisms are built on the general idea of shared prefix reuse: when multiple requests share an identical context prefix, the computation for that prefix can be reused and billed at a lower price. Engineering this requires three things:
- Prefix stability: place the system prompt, tool definitions, and knowledge snippets at the front and keep them unchanged across requests.
- Fixed ordering: the concatenation order of the context must not be randomized; put volatile content such as timestamps and random IDs at the end.
- Controlled invalidation: any change to the prefix invalidates the entire cache, so push volatile content to the tail.
def build_messages(system_prompt, stable_context, user_input, volatile):# Keep the stable prefix first and volatile content last to improve prefix reusereturn [{"role": "system", "content": system_prompt},{"role": "system", "content": stable_context},{"role": "user", "content": f"{user_input}\n[meta]{volatile}"},]
4. Technique 2: Time-of-Use Scheduling
Since off-peak prices are half of peak prices, tasks should be tiered by tolerable latency:
- Real-time tier: online Q&A and interactive completion, kept during peak hours.
- Near-real-time tier: asynchronous summarization and tagging, tolerating delays of a few minutes.
- Offline tier: batch cleaning, offline evaluation, and data synthesis, all moved to off-peak hours.
Implementation requires only a queue and a scheduling switch, combined with retry and idempotency design. There is no need to build a full cost center.
if task.deadline_slack > 300s and is_off_peak(now):submit(task, tier="light")else:submit(task, tier="pro")
5. Technique 3: Model Tiering and Routing
Routing requests to different model tiers by difficulty is one of the highest-value changes. Start with a lightweight model, and escalate to the flagship model when confidence is low or structured validation fails, forming a cascade. The decision signals can be simple: a confidence threshold for classification tasks, whether JSON parsing succeeds, or whether unit tests pass.
def cascade(prompt):r = light_model(prompt)if r.confidence < 0.8 or not r.valid_schema:return pro_model(prompt)return r
Combined with output length limits, structured output constraints, and result caching, this typically compresses unit cost significantly without sacrificing perceived quality.
6. Observability and the Governance Loop
Cost optimization must be measurable. Collect the model tier, input and output tokens, whether the prefix cache was hit, the request time window, and a business identifier for every call. Build a cost dashboard sliced by business line, and set budget alerts and circuit breakers for anomalous calls. If you rely on general cloud capabilities, you can build the collection and archival pipeline on log services, monitoring and alerting, message queues, and object storage, keeping the stack vendor-neutral and interfaces replaceable.
7. Conclusion
When inference is metered like electricity, competitiveness shifts to scheduling capability. Operate continuously on three core metrics: cache hit rate, off-peak share, and model-tier distribution. Cost reduction then becomes a sustainable engineering gain rather than a one-time negotiation.
