lloyal-agents API Reference
    Preparing search index...

    Interface SamplingParams

    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:

    • Factual/Precise: { temperature: 0.1 }
    • Balanced: { temperature: 0.7 }
    • Creative: { temperature: 1.0 }
    • Deterministic greedy: { temperature: 0, topK: 0, topP: 1.0, minP: 0 }
    interface SamplingParams {
        advanced?: AdvancedSamplingParams;
        grammar?: string;
        minP?: number;
        penalties?: PenaltyParams;
        seed?: number;
        temperature?: number;
        topK?: number;
        topP?: number;
    }
    Index

    Properties

    Advanced sampling parameters

    grammar?: string

    GBNF grammar string for constrained generation

    minP?: number

    Minimum probability threshold

    penalties?: PenaltyParams

    Penalty parameters for repetition control

    seed?: number

    Random seed for reproducible generation (-1 = random)

    temperature?: number

    Randomness (0.0 = always most likely, 2.0 = very random)

    topK?: number

    Only consider top K most likely tokens (0 = disabled)

    topP?: number

    Nucleus sampling threshold (1.0 = disabled)