Skip to content

TokenBudget

TokenBudget = { kind: "tokens"; tokens: number; } | { fraction: number; kind: "fraction"; }

Defined in: packages/core/dist/config/tokenBudget.d.ts:40

A parsed token budget: either an absolute count, or a fraction of a context window that is not known until a model is resolved.

The two stay distinct through parsing and are collapsed to one number by resolveTokenBudget, because only the caller knows the window — and because a fraction whose window is unknown must resolve to “no threshold” rather than to a guess.