EasyDeepLearn

How do you keep agent costs bounded?

medium

Answer

  • (1) Maxsteps\mathrm{Max}_{\mathrm{steps}} per task (10-50 typical).
  • (2) Maxtokens\mathrm{Max}_{\mathrm{tokens}} per turn to prevent long ramblings.
  • (3) Maxcost\mathrm{Max}_{\mathrm{cost}} per task with a hard circuit-breaker.
  • (4) Per-tool budgets ('search may be called at most 5 times').
  • (5) Model routing: use cheap model for tool selection, frontier model for final answer.
  • (6) Prompt caching for the system prompt + tools schema — huge win for repetitive workflows.
  • (7) Cheaper models for internal reasoning steps, frontier for final synthesis.
  • Log cost per trace to identify runaway prompts.
Check yourself — multiple choice
  • No cost control
  • Max steps + max tokens + max cost + per-tool budgets + model routing + prompt caching + cost per trace logging
  • Only rate limit
  • Impossible

Agent cost control: caps + routing + caching + logging — multi-layered.

#agents#cost#production

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions