OptionaladvancedAdvanced sampling parameters
OptionalgrammarGBNF grammar string for constrained generation
OptionalminMinimum probability threshold
OptionalpenaltiesPenalty parameters for repetition control
OptionalseedRandom seed for reproducible generation (-1 = random)
OptionaltemperatureRandomness (0.0 = always most likely, 2.0 = very random)
OptionaltopOnly consider top K most likely tokens (0 = disabled)
OptionaltopNucleus sampling threshold (1.0 = disabled)
Sampling parameters for token generation
Configures the sampler chain — a pipeline of composable filters and transforms applied to raw logits before token selection. The chain is built once at branch creation and persists across decode steps (penalty state accumulates, PRNG advances).
Chain order: penalties → top_k → typical_p → top_p → min_p → temperature → dist (stochastic) or greedy (temperature ≤ 0).
For tree search, each Branch owns an independent clone of the chain.
reseedSampler()replaces the terminal dist sampler's PRNG seed so forked branches diverge. Greedy chains (temperature ≤ 0) are deterministic and unaffected by reseeding.Common presets:
{ temperature: 0.1 }{ temperature: 0.7 }{ temperature: 1.0 }{ temperature: 0, topK: 0, topP: 1.0, minP: 0 }