Expand description
The sampling recipe a model author publishes in generation_config.json.
§Why gglib goes looking for this
crate::domain::model_sampling reads general.sampling.* out of a GGUF,
which llama.cpp applies directly. That is the ideal source and it is almost
never present: the keys landed upstream in PR #17120 (2025-11-25) and most
converters predate them or simply drop what they do not recognise. The
author’s numbers exist — they are in generation_config.json in the base
repo, which is what every transformers user gets by default — they just do
not survive the trip into a quantised GGUF.
So gglib fetches them at import instead, and ranks them where an unreviewed recipe belongs. Same argument ADR 0004’s follow-up makes:
gglib currently writes its own
reasoning_profile()recipe forreasoning-tagged models; a model author’s published recommendation is better evidence than gglib’s guess.
§This is not ModelSamplingDefaults, and must not become it
The obvious place to put these values is ModelSamplingDefaults, and it
is the wrong one. That type means “what this GGUF declares, which
llama.cpp has already applied to default_generation_settings”, and
gglib_proxy::props reads it to decide whether a /props value is
attributable to the model rather than to the build.
A value fetched from HuggingFace has been applied by nobody. Writing it
there would make the baseline check report ModelSupplied for a number
llama-server never saw — an instrument reporting an attribution that cannot
be wrong because it was invented, which is ADR 0004 finding 1’s trap
wearing a new hat. These stay in the inference hierarchy, where a value
only takes effect because gglib sends it.
Structs§
- Published
Generation Config - What one
generation_config.jsonyielded.
Constants§
- FIELD_
MAP 🔒 - The
transformersspelling of each field gglib models, paired with its own.
Functions§
- apply 🔒
- Write one validated value onto the config by gglib’s field name.
- generation_
config_ candidates - Where to look for a
generation_config.json, best candidate first. - in_
range 🔒 - Accepted range for each field, matching
docs/sampling.md. - parse_
generation_ config - Read a model author’s
generation_config.json. - strip_
quant_ 🔒suffix - Strip a trailing quantisation marker from a repo name.