pub enum SamplingOverride {
NotPublished,
Deferred {
key: &'static str,
published: f64,
},
Restated {
key: &'static str,
published: f64,
},
Overridden {
key: &'static str,
published: f64,
sending: f64,
},
Unreadable {
key: &'static str,
sending: Option<f64>,
},
}Expand description
What gglib is doing with one field’s published recommendation.
§Why this is a configuration question, not an observation
gglib_proxy::props’s baseline check asks “has this build’s default
table moved?” and answers it from /props. This asks a different question
with a different failure mode: “is gglib sending something other than what
the model author published?” — which is decidable from stored
configuration alone, with no server running and no request in flight.
Keeping them apart matters. The baseline check must abstain wherever
attribution fails, because a wrong verdict there re-opens or falsely
satisfies ADR 0003’s deletion criterion. This comparison has no such
hazard: both sides are known exactly, so every field reaches a verdict and
none of them is Indeterminate.
§The wire rule this encodes
A sampling value gglib resolves is sent in the request body, and the body
wins over default_generation_settings. A value gglib leaves unresolved is
sent as nothing at all, and llama.cpp then applies the model’s own
general.sampling.* key (ADR 0004 finding 7). So the question “does the
model’s published value survive to the sampler?” is answered entirely by
whether gglib names the field, not by which rung named it — which is
why this keys on Option<f64> rather than on ParamSource.
Variants§
NotPublished
The model published nothing gglib could act against — either it names no value for this field, or the field has no GGUF key at all.
The two are collapsed deliberately: both mean there is no published
recommendation to override, which is the only thing a surface needs in
order to stay quiet. ModelSamplingDefaults::gguf_key tells the two
apart where it matters.
Deferred
The model published a value and gglib names nothing, so llama.cpp applies the model author’s number.
This is the state ADR 0003’s deferral was aiming at, and the one a
bare — in an explain table renders indistinguishably from a gap.
Restated
The model published a value and gglib sends the same number.
Not an override in effect, and reporting it as one would cry wolf. Kept
distinct from Self::Deferred anyway, because gglib asserting a
value it happens to agree with is exactly the redundant restatement
ADR 0003 argues against — it silently overrides whatever the model
author chooses next.
Overridden
The model published a value and gglib sends a different one.
The state this whole comparison exists to surface.
Fields
Unreadable
The model names the key and gglib could not read its value.
Carried through rather than folded into Self::NotPublished for the
reason ModelSamplingDefault::Unreadable exists: llama.cpp’s strtof
and Rust’s f64::from_str need not agree on every string, so gglib
cannot say whether a recommendation was applied here or not.
Implementations§
Source§impl SamplingOverride
impl SamplingOverride
Sourcepub const fn is_override(&self) -> bool
pub const fn is_override(&self) -> bool
Whether gglib is putting a different number on the wire than the model author published.
The one predicate a surface should branch on to decide whether to warn.
Self::Unreadable is deliberately not included: gglib cannot tell
whether it is overriding anything there, and a warning that might be
about nothing is the Indeterminate-rendered-as-Differs mistake
ADR 0004 decision 3 forbids one layer up.
Sourcepub const fn model_published(&self) -> bool
pub const fn model_published(&self) -> bool
Whether the model published anything at all for this field.
Trait Implementations§
Source§impl Clone for SamplingOverride
impl Clone for SamplingOverride
Source§fn clone(&self) -> SamplingOverride
fn clone(&self) -> SamplingOverride
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SamplingOverride
impl Debug for SamplingOverride
Source§impl PartialEq for SamplingOverride
impl PartialEq for SamplingOverride
Source§fn eq(&self, other: &SamplingOverride) -> bool
fn eq(&self, other: &SamplingOverride) -> bool
self and other values to be equal, and is used by ==.