Skip to main content

UNMODELLED_SAMPLER_KEYS

Constant UNMODELLED_SAMPLER_KEYS 

Source
const UNMODELLED_SAMPLER_KEYS: &[&str];
Expand description

Sampler-taste keys llama-server reads that InferenceConfig does not model, stripped from an untrusted body by strip_unmodelled_sampler_keys.

The trust gate discards the client’s sampling layer, but the resolved patch is only ever inserted into the body — nothing removed the keys the ladder has no field for. So every key here was a way for an untrusted client to steer sampling past the gate: gglib’s own values arrived intact, the readback saw no divergence (/slots.params echoes what was parsed, not what the chain did — ADR 0003 finding 7), and the applied chain was something nobody configured. mirostat alone replaces the entire truncation stack.

Scope: taste, not function. Budgets (max_tokens), stops, constraint machinery (grammar, json_schema, response_format) and observation (n_probs, logprobs) stay client-authoritative — they say what the request is, not how it should sample. logit_bias stays too, a deliberate edge: it is per-token surgery with legitimate functional uses (banning a token), and a dedicated decision should move it, not a sweep.

A modelled key must never appear here — the gate already governs those, and stripping one would delete the client’s value before the trusted path could read it. no_modelled_key_is_listed_as_unmodelled pins this, so modelling a new parameter (as frequency_penalty just was) forces its removal from this list.