Peak and Off-Peak Pricing for LLMs: How It Works and How to Implement It
This article explains how peak and off-peak pricing changes LLM inference billing compared with flat rates, why asynchronous batch discounts often deliver a poor experience, and how to model the delay decision mathematically. It covers task tiering by deferability, key scheduler design constraints, observability and cost attribution metrics, common anti-patterns, and a four-step rollout path.
1. From Flat Rates to Peak and Off-Peak Pricing
Most traditional LLM inference services use a single flat rate: the price per token stays the same whether a request arrives during business peak hours or in the low-load hours before dawn. This is friendly to users, but for the provider it means the resource pool must be provisioned for peak capacity, leaving compute idle during troughs.
Peak and off-peak pricing borrows from load scheduling practices that are already mature in the power and cloud computing industries: divide the day into peak and off-peak windows, offer a clear discount during off-peak hours, and use the price signal to shift deferrable workloads. For developers, this is not a simple “sale.” It is a scheduling contract that requires active cooperation: you must make some tasks “waitable” before you can actually capture the discount.
Note that the specific discount ratios, window boundaries, and scope are defined by each provider and adjusted according to resource conditions. Systems should not hardcode any particular set of values; treat the “window-to-price” mapping as configuration that can be fetched dynamically.
2. Why Asynchronous Half-Price Options Feel Bad
The more common cost-reduction approach in the industry is an asynchronous batch API: you submit a batch of tasks, the provider queues them on non-real-time capacity and promises to return within a relatively long window, at roughly half the price of real-time calls.
The problem is not the price but the lack of determinism:
- Return time is unpredictable; actual latency may be far shorter than the promised window or right up against its upper bound.
- The client must poll or maintain a callback endpoint, adding state management and retry logic.
- It is hard to orchestrate alongside a synchronous path; mixing both modes in one business flow significantly increases complexity.
- The result freshness cannot serve scenarios with a hard deadline.
Peak and off-peak pricing feels more comfortable because it does not change call semantics: requests are still synchronous, and only the price varies with system time. Migration cost is close to zero, and the tradeoff moves to the layer that decides when to issue a request.
3. Cost Model: Turning the Decision into a Calculation
Let the peak price per token for a task class be P_peak, the off-peak price be P_off, and the discount factor be d = P_off / P_peak. Let D be the maximum delay the task tolerates, t the current time, and W(t) the wait until the next off-peak window starts.
The decision to defer simplifies to:
Defer if: W(t) <= D and d * P_peak * (1 + λ * W(t)) < P_peakThat is: d * (1 + λ * W(t)) < 1
Here λ converts waiting time into cost (capital tied up, SLA risk, retry probability, and so on). The formula makes three points: the deeper the discount, the more worthwhile the wait; the longer the wait, the less attractive it becomes; and when d approaches 1, the mechanism offers almost no optimization value.
In practice, d, D, and λ should be configurable policies per business line rather than global constants.
4. Task Tiering: Which Workloads Can Move
Not every request can wait. Deferability depends on business semantics, not technical difficulty:
| Tier | Typical Tasks | Deferability | Recommended Strategy |
|---|---|---|---|
| L0 Real-time interaction | Chat, completion, search query rewriting | Very low | Always run at peak; no scheduling |
| L1 Near real-time | Document summarization, ticket classification | Minutes | Short delay; shift only when off-peak is close |
| L2 Offline batch | Data cleaning, bulk labeling, offline evaluation | Hours | Primary migration target |
| L3 Archival | Historical backfills, model comparison experiments | Days | Fully bound to off-peak windows |
A common mistake is sending L1 to the off-peak queue as well, which causes a backlog at peak and a flood at trough, triggering rate limits instead. The sensible approach is to give each tier its own concurrency quota and timeout budget.
5. Scheduler Implementation
The scheduler needs three capabilities: a price calendar, task queues, and observability.
class OffPeakScheduler:def __init__(self, price_calendar, policy):self.calendar = price_calendar # dynamically fetched window-price configself.policy = policy # per-tier D / λ / concurrency limitsdef submit(self, task):now = self.calendar.now()wait = self.calendar.wait_until_cheaper(now)if task.level == 0 or wait > self.policy[task.level].max_delay:return self.dispatch(task, now) # run immediatelyscore = self.policy[task.level].discount * (1 + self.policy[task.level].lam * wait)if score < 1.0:self.enqueue(task, run_at=now + wait) # defer to the cheaper windowelse:self.dispatch(task, now)def dispatch(self, task, ts):# single entry point: telemetry, rate limiting, retries, results to object storage...
Key design constraints:
- The price calendar must support hot updates so system behavior does not drift after the provider changes windows.
- Queues need priority preemption so L0/L1 bursts can take quota from L2.
- Every task needs an absolute deadline; past it, execution is forced regardless of price, preventing “saving money by breaking the contract.”
- Write results to object storage and notify downstream via a message queue to avoid holding long-lived connections.
6. Observability and Cost Attribution
Without measurement, peak and off-peak pricing easily becomes a feeling that money was saved. At minimum, track three metric groups:
- Cost: token consumption by window, discount coverage (share of off-peak tokens), average cost per task.
- Timeliness: queue time distribution, timeout rate, P95 completion time.
- Stability: rate-limit hits, retry rate, backlog depth of failed tasks.
Tag metrics by business line for cost attribution, and set separate alert thresholds for “off-peak window underutilized” and “timeout rate rising.” The first means scheduling is too conservative; the second means the delay budget is too loose.
7. Common Anti-Patterns
- Hardcoding discount values, so the cost model breaks once the provider adjusts them.
- Checking only time and not capacity, saturating off-peak concurrency and getting rate limited.
- Missing idempotency, so retries bill the same task twice.
- Using one global queue for all tiers, which cannot balance timeliness and cost.
- Ignoring the cost difference between prompt and output length and estimating by request count alone, which skews the budget.
8. Rollout Path
First, put a unified calling gateway in place and make the window-price configuration external; observe only, without changing behavior, and collect a load profile for one to two weeks. Second, run a canary on one L2 path with the delay budget set at the lower bound of a business-perceptible threshold. Third, add idempotency keys, absolute deadlines, and result persistence, then expand tier coverage gradually. Fourth, tune continuously using discount coverage and P95 timeliness together.
The real value of peak and off-peak pricing is not a particular discount number but that it forces teams to model workload deferability explicitly. Once this tiering and scheduling capability exists, later price strategy changes or new cost-reduction mechanisms can plug into the same framework smoothly. For teams that want to balance cost and experience, this pays off more in the long run than chasing any single promotion.
