Engineering

Forecasting inference cost

Tokens, retries, context length and the multipliers that turn a cheap pilot bill into an awkward production invoice three months later.

14 June 20266 min readKrip Artificial Intelligence Tech

The pilot bill was small enough that nobody queried it. The production bill is the same work multiplied by traffic, by retries, and by the length of the prompts — and it arrives in month two, after the architecture has hardened and the feature has users.

Four multipliers

  • Context length: a retrieval system that stuffs ten passages into every prompt pays for them every time
  • Retries: a validation step that rejects and re-asks doubles cost on the cases that fail
  • Escalation: routing hard cases to a larger model is right, and it must be budgeted
  • Growth: successful features get used more, often faster than forecast

Estimate from the pilot

Take the actual tokens per request from the pilot, split by input and output, and multiply by the requests per day you expect at six and twelve months. Add the retry rate you measured, not the one you hoped for. If the number is uncomfortable, the architecture is still cheap to change.

  • Cache retrieval results where the corpus is stable
  • Cap context with a passage budget rather than "top ten"
  • Batch non-urgent work
  • Set a per-tenant budget and alert at 80 percent

Price the alternative

The honest comparison is not the model bill against zero. It is the model bill against the hours currently spent on the task, at the grade of person who spends them. That comparison usually favours the system, and where it does not, you have learned something worth more than the saving.

Where the estimate breaks

Two things move the number after launch: passage count and escalation. Teams add passages to fix quality, and each addition is paid on every request forever. Escalation creeps as users learn to phrase questions that trigger the larger model. Both are worth a monthly glance at tokens per resolved task, not tokens per call, because the second number hides the retries.

Where forecasts go wrong

Teams forecast the cost of a request and forget the cost of the ones that fail. A validation step that rejects and re-asks doubles the bill on exactly the cases that are hardest, which are also the cases that arrive more often as the corpus grows.

The second omission is context. A retrieval system that stuffs ten passages into every prompt pays for all ten every time, and the tenth passage is usually noise. A passage budget of three, chosen by score, is cheaper and often more accurate.

Controls that hold

Set a per-tenant budget with an alert at eighty percent and a hard cap that degrades to a smaller model or to human review, rather than failing. A cap that switches the feature off is a cap nobody configures.

Cache aggressively where the corpus is stable. Three colleagues asking the same question in a week is normal in an institution, and paying three times for it is a choice.

The number to ask for

Ask for cost per resolved task, not cost per token. Per-token pricing is easy to quote and impossible to compare across systems; per-task cost tells you what the thing is worth.

Before the first invoice, write down the requests per day you expect at six and twelve months and the retry rate you measured in the pilot, then check both against the bill in month two. That comparison is what turns a forecast into a control.

Before the architecture freezes, multiply the pilot’s token counts by the traffic you expect at twelve months, add the measured retry rate, and look at the total.

Questions this answers

Is a smaller model always cheaper?
Not if it needs more retries or longer prompts to reach the same quality.
How do we control runaway costs?
Per-tenant budgets with alerts, and a hard cap that degrades to a fallback rather than failing.
Where this connects
On-premises AI
The deployment option that changes the bill.
Hybrid AI
Splitting workload by sensitivity and cost.
Cloud solutions
Hosting and residency as scoped decisions.

Written by the team at Krip Artificial Intelligence Tech. If something here is wrong, write to info@kripaitech.com.np and it will be corrected with the date noted.

Talk through your case
On this page
Working with KRIP

Engagements start with a written problem definition and an agreed error budget.

Engagement models