pub enum ReasoningEffort {
Minimal,
Low,
Medium,
High,
XHigh,
Max,
}Expand description
A reasoning-effort level gglib is willing to put on the wire.
§This enum is where gglib is deliberately stricter than upstream
InferenceConfig::extract_client_sampling’s coercion doctrine is “accept
what upstream accepts and reject what upstream rejects, so gglib never
becomes the stricter of the two”. A closed enum breaks that rule for this
one field, on purpose, and the exception is argued rather than assumed —
see InferenceConfig::reasoning_effort, which carries the argument.
§The levels
The six are llama-server’s own documented set, taken from its
--reasoning-effort help text on the pinned build. They are offered
levels, not honoured ones: a template that never branches on the variable
ignores every one of them, and even a template that reads it may only act
on some (upstream’s own tests show DeepSeek-V4 rendering something special
for "max" and nothing at all for "high" or "low" — ADR 0007
finding 3).
§"none" is not here, and its absence is the decision
llama-server accepts reasoning_effort: "none" and treats it specially: it
erases the kwarg rather than passing it through. On gpt-oss the
template’s own {%- set reasoning_effort = "medium" %} fallback then
fills the hole, so "none" yields medium thinking — confirmed live
against the pinned binary, not inferred. Offering it as a level would ship
a control whose most obvious value does the opposite of what it reads as.
“Stop thinking” is
reasoning_budget_tokens: 0,
which is sampler-enforced and range-validated upstream. See ADR 0007
finding 4 and decision 4.
Variants§
Minimal
The least thinking the template offers.
Low
Below the template’s own middle setting.
Medium
The middle setting, and the value gpt-oss’s template falls back to on
its own when no kwarg arrives.
High
Above the middle setting.
XHigh
Serialises as xhigh, one word — not x_high. The wire spelling is
llama-server’s, and serde(rename_all = "lowercase") lower-cases the
variant name whole rather than splitting on the case boundary the way
snake_case would. the_wire_spelling_of_every_level_is_pinned fails
if that ever changes.
Max
The most thinking the template offers.
Implementations§
Source§impl ReasoningEffort
impl ReasoningEffort
Sourcepub const ALL: [Self; 6]
pub const ALL: [Self; 6]
Every level, weakest first.
The order is the --reasoning-effort help text’s, which is also the
only ordering the levels have — nothing in llama.cpp compares them, and
a template is free to treat low and high identically.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The wire spelling, identical to what serde emits.
Both spellings exist because both are needed — serde writes the
request body, and this reads a client’s string without a round trip
through serde_json — and they are pinned equal by test rather than by
hope.
Sourcepub fn from_wire(s: &str) -> Option<Self>
pub fn from_wire(s: &str) -> Option<Self>
Read a level from a client’s string, or None if it is not one.
Case-insensitive, because the levels are a closed vocabulary and
"HIGH" can only have meant one thing. Note what is not here:
"none" is not a level (see the type docs), so it lands in the None
arm along with "banana" and is reported as a rejection by the caller.
Sourcepub fn wire_vocabulary() -> String
pub fn wire_vocabulary() -> String
The accepted levels, rendered for an error message.
Trait Implementations§
Source§impl Clone for ReasoningEffort
impl Clone for ReasoningEffort
Source§fn clone(&self) -> ReasoningEffort
fn clone(&self) -> ReasoningEffort
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 ReasoningEffort
impl Debug for ReasoningEffort
Source§impl<'de> Deserialize<'de> for ReasoningEffort
impl<'de> Deserialize<'de> for ReasoningEffort
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ReasoningEffort
impl Display for ReasoningEffort
Source§impl Hash for ReasoningEffort
impl Hash for ReasoningEffort
Source§impl PartialEq for ReasoningEffort
impl PartialEq for ReasoningEffort
Source§fn eq(&self, other: &ReasoningEffort) -> bool
fn eq(&self, other: &ReasoningEffort) -> bool
self and other values to be equal, and is used by ==.