Estimate cost per request from input tokens, output tokens, retrieval work, tool calls, and retries. Measure tail latency as well as median latency because sequential model calls can make a small fraction of requests painfully slow. Set a quality floor first, then compare shorter context, fewer examples, caching, and staged routing against that floor. Use a cheaper route for simple, verified tasks only when its error rate is acceptable for the same slice. A budget should state what happens when it is exhausted: partial evidence, abstention, or human handoff.
Prompt budgets: trade output quality against cost and tail latency
Decision in practice
A catalog team processes 1,800 product-change requests each day. A four-call chain produces marginally better wording than a two-call path, but the extra stage rarely changes the approval decision. The team removes that stage after a held-out evaluation confirms the same factual pass rate. It retains the extra verification call for high-value changes with contradictory source records. The dashboard separates token spend, retrieval time, P95 latency, review rate, and critical errors rather than reducing the outcome to one cost-per-request figure.
Budget: 2 model calls for ordinary catalog changes; 1 extra check for conflicts.
Quality floor: no unsupported approval; required fields present.
Exhausted budget: report unresolved fields and route to review.Performance and operating cost
For N requests, K model calls per request make direct call volume O(NK); token length determines much of the bill and processing time. Caching repeated static context can help when the input remains stable, but stale policy text is worse than a cache miss. Compare total cost per accepted case, not cost per raw response, because cheap outputs that require human repair may be expensive overall. Segment by task difficulty so easy cases do not mask expensive failures.
Common Mistakes
- Do not optimize cost before defining a quality floor.
- Do not report only average latency.
- Do not cache policy text without an invalidation rule.
Connected lessons
- Prompt Engineering
- Production prompt engineering
- Prompt decomposition: split stages at verifiable handoffs
- Prompt releases: version the whole decision path and keep a rollback
- Prompt privacy: send only the fields needed for the task
- Project: defend a retrieval and action workflow
- Prompt production decisions
Further prompt decisions
Test the task on changed inputs and record what the application actually accepted or rejected.
Continue with: Output budgets: bound length without cutting required facts.
Continue with: Voice tool waits: report progress without inventing an outcome.
Continue with: Capacity prompts: check units, headroom, and a failed worker.
