Skip to main content

FieldIssue

Enum FieldIssue 

Source
pub enum FieldIssue {
    Normalised {
        field: &'static str,
        from: String,
        to: &'static str,
    },
    Rejected {
        field: &'static str,
        value: String,
        expected: &'static str,
    },
}
Expand description

What reading one client-supplied sampling field did, when it was not simply “read it”.

Carried out of InferenceConfig::extract_client_sampling so the caller can log or count it. A value gglib declines to use is a fact about a client worth surfacing — before this existed, the entire client sampling layer could vanish over one key with nothing recording that it had.

§An issue is a report, not by itself an instruction to the body

Recording that gglib could not use a value says nothing about whether the client’s own spelling should still be forwarded, and the answer is usually yes: llama-server rejects what these readers reject, so a forwarded bad value earns the client an honest HTTP 400 from the system that owns the field. One field escapes that rule — REASONING_EFFORT_KEY, which upstream does not validate at all — and it is the only one request_pipeline::sampling erases on the strength of an issue. See Rejected and that module’s erase_unadopted_client_keys.

Variants§

§

Normalised

Recognised, but not in the form this field takes. A documented equivalent was substituted and the value is in use.

The client’s own spelling stays in the forwarded body. Where the substitute is a value (top_k: 5.05) the resolved patch overwrites it; where it is “no opinion” (max_tokens: -1, seed: -1) the ladder emits nothing and the client’s sentinel rides through to llama-server, which reads it as the same absence this type does.

Fields

§field: &'static str

Wire key, as the client spelled it.

§from: String

What arrived, rendered for a log line.

§to: &'static str

What it was taken to mean.

§

Rejected

Not readable as this field’s type. This field alone is dropped; every other field the client sent is unaffected.

Dropped from the client’s sampling layer always. Whether the client’s own text is also removed from the forwarded body is one field’s exception, not the rule:

  • REASONING_EFFORT_KEY is deleted. Upstream validates it not at all, so a refused-but-forwarded "banana" is not answered with a 400 — it is rendered into the user’s prompt (ADR 0007 finding 7c). gglib’s refusal has to bite here because no other system’s will.
  • Every other field, including REASONING_BUDGET_TOKENS_KEY, is forwarded as sent. These readers reject what llama-server rejects, so the client gets upstream’s own 400 naming the field and its range — a better answer than a silent substitution, and it keeps gglib exactly as strict as upstream rather than stricter.

Fields

§field: &'static str

Wire key, as the client spelled it.

§value: String

What arrived, rendered for a log line.

§expected: &'static str

What the field accepts.

Implementations§

Source§

impl FieldIssue

Source

pub const fn field(&self) -> &'static str

The wire key this issue is about, exactly as it appears in the request body.

Every reader passes the literal key it read, including the one field with two accepted spellings: a budget sent as THINKING_BUDGET_TOKENS_KEY is reported under that name, not under the canonical one the client never used. So this is directly usable as a serde_json::Map key by the body cleanup in request_pipeline::sampling.

Trait Implementations§

Source§

impl Clone for FieldIssue

Source§

fn clone(&self) -> FieldIssue

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 FieldIssue

Source§

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

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

impl Display for FieldIssue

Source§

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

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

impl PartialEq for FieldIssue

Source§

fn eq(&self, other: &FieldIssue) -> 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 Eq for FieldIssue

Source§

impl StructuralPartialEq for FieldIssue

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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