learning-it by example

Back to the video

Cost Control for AI Agents: A Budget for Each Agent

One agent in a loop used 88 percent of a made-up day's spend, and nothing stopped it.

Video #244 ยท Enterprise architecture and AI agents

Steps in the video

  1. 0:00 One agent in a loop used 88 percent of the day's spend
  2. 0:31 The idea
  3. 1:07 Setup
  4. 1:33 A day of calls
  5. 1:58 The budget
  6. 2:24 Three versions of the day
  7. 3:29 What this does not show
  8. 4:02 Mistakes to avoid
  9. 4:29 My take and next steps
  10. 4:59 Recap

Files

  • budget.py (27 lines)
  • compare.py (20 lines)
  • traffic.py (7 lines)

Download the code (zip)

Tested with

Python 3.12.15

What this does not show

Made-up prices, traffic and budgets on one laptop; the 88 percent and the 54 refusals follow from the loop length and the limits I chose; no real agent, model or router was run.

Sources

Learning IT by Example.