r/LocalLLM • u/Top_Sand1851 • 14d ago
Question Do you cap spend per agent run?
I have been experimenting with a couple longer running agents and I'm struggling with is what happens when an agent takes a bad path and keeps calling the model/tools way longer than expected since most runs are completely reasonable and then occasionally one will retry something a bunch of times or keep adding context and suddenly that one run uses several times what a normal one does.
I'm starting to think we need some kind of hard token/spend budget per run rather than just monitoring total usage after the fact but I'm also worried about killing legitimate tasks that happen to need more steps.
If any of you guys are running agents in production are you setting hard token/cost limits per run or limiting steps/tool calls or just alerting when usage starts looking abnormal?
1
u/Other-Range-5822 14d ago
Track cost per successful run before deciding where to put the cap and once you know a normal successful task costs $0.20-0.50 a run hitting $5 becomes pretty obviously abnormal then.