Skip to main content

SamplingOverride

Enum SamplingOverride 

Source
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.

Fields

§key: &'static str

The GGUF key carrying it.

§published: f64

What the model author published.

§

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.

Fields

§key: &'static str

The GGUF key carrying it.

§published: f64

The value both sides name.

§

Overridden

The model published a value and gglib sends a different one.

The state this whole comparison exists to surface.

Fields

§key: &'static str

The GGUF key carrying it.

§published: f64

What the model author published.

§sending: f64

What gglib puts on the wire instead.

§

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.

Fields

§key: &'static str

The GGUF key whose value could not be read.

§sending: Option<f64>

What gglib sends regardless, if anything. Its own value still reaches the sampler; what is unknown is what it displaced.

Implementations§

Source§

impl SamplingOverride

Source

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.

Source

pub const fn model_published(&self) -> bool

Whether the model published anything at all for this field.

Trait Implementations§

Source§

impl Clone for SamplingOverride

Source§

fn clone(&self) -> SamplingOverride

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SamplingOverride

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SamplingOverride

Source§

fn eq(&self, other: &SamplingOverride) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SamplingOverride

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more