How do you keep agent costs bounded?
mediumAnswer
- (1) per task (10-50 typical).
- (2) per turn to prevent long ramblings.
- (3) 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
- How much does it cost to pretrain a modern LLM?
- How should max_tokens be set in production?
- What is prompt caching and when does it help?
- How do you use one prompt to extract multiple fields at once vs many separate prompts?
- What can you cache in a RAG pipeline?
- How do you pick a GPU for serving a 70B LLM?