pub struct ModelSamplingContext {
pub is_reasoning: bool,
pub defaults_origin: Option<DefaultsOrigin>,
}Expand description
Everything about the target model that changes how sampling resolves, independent of any specific request.
Bundled rather than passed as separate parameters because both
InferenceConfig::resolve_with_profile and
crate::request_pipeline::sampling::resolve_sampling need the same two
facts about the same model, and the list has already grown once (see
#685) — a named struct reads at call sites instead of two easily
transposed booleans.
Fields§
§is_reasoning: boolWhether the model carries gglib’s reasoning capability tag. Selects
the coupled-trio floor — see InferenceConfig::reasoning_floor.
defaults_origin: Option<DefaultsOrigin>Whether the model’s inference_defaults were user-set or
auto-detected. None when the model has no stored
inference_defaults at all, in which case it has no effect either
way. See DefaultsOrigin.
Implementations§
Source§impl ModelSamplingContext
impl ModelSamplingContext
Sourcepub fn for_model(model: &Model) -> Self
pub fn for_model(model: &Model) -> Self
Read both facts off a catalog row.
Four call sites across three crates built this struct field-by-field
from a Model, each re-deriving is_reasoning
from the tag list inline. Two fields is exactly the size at which
hand-construction looks harmless and stops being so: the pair travels
together, both are read by the same fold, and a call site that filled
one and defaulted the other would resolve against the wrong floor or
mis-rank the model’s own defaults against global settings — silently,
in both cases.
Trait Implementations§
Source§impl Clone for ModelSamplingContext
impl Clone for ModelSamplingContext
Source§fn clone(&self) -> ModelSamplingContext
fn clone(&self) -> ModelSamplingContext
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 ModelSamplingContext
impl Debug for ModelSamplingContext
Source§impl Default for ModelSamplingContext
impl Default for ModelSamplingContext
Source§fn default() -> ModelSamplingContext
fn default() -> ModelSamplingContext
Source§impl PartialEq for ModelSamplingContext
impl PartialEq for ModelSamplingContext
Source§fn eq(&self, other: &ModelSamplingContext) -> bool
fn eq(&self, other: &ModelSamplingContext) -> bool
self and other values to be equal, and is used by ==.