Expand description
Thinking levels and output token budgets.
Constants§
- MIN_
ANSWER_ TOKENS - Output tokens kept for the answer when a thinking budget would consume all.
Functions§
- budget_
for_ level - The budget for budget-based thinking at
level.xhighandmaxusehigh. - budgeted
- Budget-based thinking at
levelon top of the output limitbase: the output limit capped to the context, and the budget leaving room to answer under it. Returns(max_tokens, budget). - clamp_
level - The nearest supported level: the requested one, else the next higher, else the next lower.
- clamp_
max_ tokens_ to_ context - Caps
max_tokensso the estimated context plus output fits the window. - effort
- The requested level clamped to the model, or
Nonewhen it is off. - requested_
max_ tokens - pi’s
streamSimpleoutput limit: the requested limit, else the model’s, capped to the context window. - supported_
levels - The levels a model accepts: only
offwithout reasoning,xhighandmaxonly when its thinking level map names them, and none the map marks unsupported.