Skip to content

resolveTokenBudget

resolveTokenBudget(budget, window): number | null

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/config/tokenBudget.ts:178

Collapse a parsed budget to the absolute token count it means for one model.

Returns null when the budget is a fraction and the window is unknown — the same “unknown means no trigger” contract contextWindow.ts holds, and for the same reason: a percentage of a window nobody could resolve is not a number, and inventing one is the failure this whole feature exists to avoid. An absolute count needs no window and is returned as written.

TokenBudget

number | null

number | null