Skip to main content

ReasoningEffort

Enum ReasoningEffort 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn wire_vocabulary() -> String

The accepted levels, rendered for an error message.

Trait Implementations§

Source§

impl Clone for ReasoningEffort

Source§

fn clone(&self) -> ReasoningEffort

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 ReasoningEffort

Source§

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

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

impl<'de> Deserialize<'de> for ReasoningEffort

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ReasoningEffort

Source§

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

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

impl Hash for ReasoningEffort

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ReasoningEffort

Source§

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

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for ReasoningEffort

Source§

impl Eq for ReasoningEffort

Source§

impl StructuralPartialEq for ReasoningEffort

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,