← All field notes
FIELD NOTES

LLM input token prices are not cheap

When you do the math, or let others do the math, LLM input costs overtake output costs in long coding sessions

I was on a plane yesterday and was thinking about my new obsession, figuring out how to apply low cost decision models to coding workflows. I've had good success using jev to find bugs instantly over the last few weeks. At my current confidence threshold there are maybe 50% false positives, but I'm confident I can find a threshold that works more reguarly. The most important part is it's finding real bugs, instantly!

While thinking a bit about how to make agents cheaper with Jev, I got to the realization that over long context windows, input costs, which appear low cost, $3 input vs $15 output for Claude Sonnet for example, actually start to grow bigger than the cost of the output even with cache pricing. I won't go through all the specific math, first because that's not my specialty, but secondly because it's covered well at exe.dev.

This actually changes a lot for me, I always thought that small tool calls were harmless but over 300,000 token context window with the input at an 80% cache input discount, the input costs more than the output tokens at 1,000 tokens output, and usually the output is a lot less. That's a bit terrifying, because people are paying API pricing on up to 1 million tokens. If I were running a AI company, I would definitely be trying to increase context windows as much as possible. It's free money! (There are technical challenges to serve bigger context from what I understand, but still!). For me however, big context windows seem like a trap!

Claude lets you auto compact at lower thresholds, I would recommend setting this, I pick the minimum 200,000 as I am not a huge believer in long context effectiveness for coding, but I would do smaller if I could! Codex doesn't support this! There is a lot of opportunity to load less context for a coding session, I have some ideas I want to try and I'll share the results soon.

← More field notesSubscribe via RSS →