All jobs / AI engineer / Production AI Engineering
AI engineer interview question · 5+ years
You moved your agent to a model that costs a third as much per token. The cost per request fell, yet the monthly bill went up.
What is going on, and what should you have measured?
The strongest answer
Cost per completed task, not per request: the cheaper model needs more turns, retries more and fails more often, so each finished task consumes more tokens — I compare models on success rate and total cost per success, and route easy work to the cheaper one only where the eval shows it holds
Why it works
Exactly — price per token is an input, not the outcome. An agent that takes twice the steps at a third of the price has not saved money, and the failures cost support time too.
What a good answer covers
- Measure cost per completed task.
- Count turns, retries and failures.
- Compare models on the same eval.
- Route by difficulty, with evidence.
Answers that fall short
- Close, but not the strongest: The cheaper model writes longer answers, so output tokens went up; I would cap the response length
Possibly part of it, but in an agent the multiplier is turns: every extra step re-sends the whole context. - Weak: Usage must have grown at the same time; I would wait a month and compare again
Check the traffic, by all means, but the mechanism is knowable today from the traces: turns and retries per task. - Red flag: Switch back — the more expensive model is always cheaper in the end
Sometimes true and sometimes not. Without a per-task measurement you are replacing one unexamined belief with another.
Who gets asked this
More Production AI Engineering questions
- Offline evals say a cheaper model is about as good as the current one for your support assistant. Product…
- Why does a call to a model need a timeout, and what should the user see when it fires?
- Many providers offer a moving alias that always points at their newest model, and fixed dated versions. Which…
- During a provider slowdown your model bill for the hour tripled. The SDK retries three times, your service…
- What is missing from your system, and what do you add?
- What pattern stops this, and what does the AI feature do while it is active?
- The monthly model bill doubled, and nobody can say which customers or which features caused it. What do you…
- Your provider announces that the model version you pinned will be retired in a few months. Forty prompts…