ThinkingBudget class

Limits the generated tokens within a model's reasoning block.

This maps to llama.cpp's reasoning-budget sampler. A budget of zero closes the next reasoning block immediately; a positive value permits that many generated reasoning tokens before the sampler forces endTag. llama.cpp accepts values from zero through 2,147,483,647.

LlamaEngine.create resolves omitted startTag and endTag from the rendered chat template. Callers using raw generation should supply both tags explicitly because models do not share a universal reasoning syntax.

Constructors

ThinkingBudget({required int maxTokens, String? startTag, String? endTag, String? forcedMessage})
Creates a thinking-token budget.
const

Properties

endTag → String?
Reasoning-block closing delimiter forced when maxTokens is exhausted.
final
forcedMessage → String?
Optional text forced immediately before endTag after exhaustion.
final
hashCode → int
The hash code for this object.
no setterinherited
maxTokens → int
Maximum generated tokens allowed inside each reasoning block.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startTag → String?
Reasoning-block opening delimiter.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited