Expand description
Stage 4–5: resolving what the model is asked to sample with.
Unlike super::messages, nothing here reads messages — these transforms
only ever touch top-level keys.
Tier B — Policy (ADR 0001). llama-server is one process serving one
model with no catalog, no profiles and no view of the client, so it cannot
arbitrate between a :coding profile and a per-model default. The ladder,
the trust gate and the provenance are permanently gglib’s, and nothing here
gates on RuntimeCapabilities.
The floor beneath the ladder is a separate question with a different answer: six of its seven values were measured to restate llama.cpp’s own defaults, which makes them compensation rather than policy. See ADR 0003, which decides they are deferred.
Structs§
- Sampling
Decision - Everything
resolve_samplingdecided, and why. - Sampling
Layers - The sampling layers that sit below the client’s own request parameters.
Enums§
- Floor
Class - Which class floor sat beneath the ladder.
Constants§
- CLIENT_
AUTHORITATIVE_ KEYS - The client’s own fields that survive an untrusted request.
- DISABLE_
AGENTIC_ SAMPLING_ ENV - Environment kill switch for the agentic-turn adjustments.
- LADDER_
RUNGS - Rungs in the pipeline’s ladder:
cli,client,profile,model,global,model (auto-detected). - UNMODELLED_
SAMPLER_ 🔒KEYS - Sampler-taste keys llama-server reads that
InferenceConfigdoes not model, stripped from an untrusted body bystrip_unmodelled_sampler_keys.
Functions§
- agentic_
sampling_ 🔒disabled_ via_ env - Whether
DISABLE_AGENTIC_SAMPLING_ENVis set to a truthy value. - erase_
unadopted_ 🔒client_ keys - Remove from the body the client keys gglib must not forward: what the trust gate binned, the budget alias gglib never emits, and one refused field.
- model_
rung 🔒 - Which rung the model’s stored defaults occupy, and the name that rung
carries — both decided by
DefaultsOriginin one place, so resolution and its labelling cannot disagree. - read_
client_ 🔒layer - Read the client’s own sampling parameters and apply the trust gate.
- resolve_
sampling - Resolve the sampling hierarchy into
body, then pincache_prompt. - strip_
unmodelled_ 🔒sampler_ keys - Remove
UNMODELLED_SAMPLER_KEYSfrom an untrusted body, returning what was removed so it joins the discard record.