Token Budget

Deciding what gets into the context window.

Read the blog →

The context window looks like a capacity. It behaves like a budget.

Everything competes for it: the system prompt, the tool definitions, the conversation so far, the passages you retrieved, and the answer the model still has to write. Add them up honestly and the number is usually larger than you thought — and the request that fails at the limit is the easy case. The hard case is the one that fits, costs three times as much, and answers worse than it did with half as much context.

Token Budget is about that allocation. Where the window is actually going, how to count it properly, what to cut first when it overflows, and why the same passage helps in one position and gets ignored in another.

Budget tables, not benchmarks. Formulas you fill in with your own numbers, because anything specific enough to quote is out of date by the next model release.

Latest posts

See all posts →