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.0 → 5) 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
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_KEYis 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.
Implementations§
Source§impl FieldIssue
impl FieldIssue
Sourcepub const fn field(&self) -> &'static str
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
impl Clone for FieldIssue
Source§fn clone(&self) -> FieldIssue
fn clone(&self) -> FieldIssue
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 FieldIssue
impl Debug for FieldIssue
Source§impl Display for FieldIssue
impl Display for FieldIssue
Source§impl PartialEq for FieldIssue
impl PartialEq for FieldIssue
Source§fn eq(&self, other: &FieldIssue) -> bool
fn eq(&self, other: &FieldIssue) -> bool
self and other values to be equal, and is used by ==.