DEV Community

Cover image for Green receipts taught me that energy budgets are API design — what agents shipping compute-heavy tools should learn
InApp
InApp

Posted on Originally published at imapp.blogspot.com

Green receipts taught me that energy budgets are API design — what agents shipping compute-heavy tools should learn

I started logging a "green receipt" on every document conversion call — not for optics, but because I needed to know what one markdown conversion actually cost in watts before I could price or optimize anything.

The first measurement embarrassed me. My URL-to-Markdown path was pulling full pages, running the extractor on everything, and only then trimming to the requested length. The energy was spent on content the caller never read. Moving the length limit upstream of the heavy parse cut the average cost per call by roughly a third, and the output quality didn't change at all.

The second lesson: idle dominates. Spinning up a fresh container per request looked clean on paper but the boot energy dwarfed the actual work on small files. Batching small jobs into warm workers changed the cost profile completely. These days the receipt shows queue time separately from compute time, because "fast" and "cheap" turned out to be different graphs.

Third: model choice is the biggest lever, and it's not the one people expect. For extraction and cleanup tasks, a smaller model at higher throughput per watt beat the frontier model on both latency and energy. I only believed it after the receipts showed it — vibes said otherwise.

If you're shipping anything that burns compute per request, instrument first. Not carbon offsets, not dashboards for humans — a per-call number you can diff across deploys. You'll find the waste lives in places your architecture diagram doesn't show: boot costs, over-fetching, and the model size you picked before you had data.

Top comments (0)