pub struct SamplingLayers {
pub cli_override: Option<InferenceConfig>,
pub profile: Option<InferenceConfig>,
pub global: Option<InferenceConfig>,
pub trust_client_sampling: bool,
}Expand description
The sampling layers that sit below the client’s own request parameters.
Grouped because they are only ever used together, at the single point where
resolve_sampling folds them through InferenceConfig::resolve_layers.
The per-model layer is deliberately absent: it arrives with the rest of the
per-model facts, as
ModelContext::inference_defaults,
so no caller has to look the model up twice. The client’s own parameters are
absent for a different reason — they are read back out of the request body
itself, which is what lets one function serve a proxy forwarding an
arbitrary client payload and an adapter that built the body from a typed
config.
Fields§
§cli_override: Option<InferenceConfig>Operator-supplied overrides from the process’s own command line
(gglib proxy --temperature …), applied above the client’s request
parameters.
Above the client deliberately: this is the person running the server
stating what the server does, which cannot be true if any client can
silently outrank it. These previously merged into Self::global,
which sits below the per-model layer — so on any model with stored
inference_defaults the flags did nothing at all.
profile: Option<InferenceConfig>The profile the request selected via {model}:{profile}, if any.
Sparse — see crate::domain::inference_profile.
global: Option<InferenceConfig>Global defaults from settings.
trust_client_sampling: boolWhether the client’s own sampling parameters are honoured at all.
From Settings.trust_client_sampling. false (the default) drops
everything the client sent except max_tokens — see the field doc on
Settings for why. This is read from the same settings snapshot as
Self::global, which is why it lives here rather than as a
separate parameter threaded through every caller.
Trait Implementations§
Source§impl Clone for SamplingLayers
impl Clone for SamplingLayers
Source§fn clone(&self) -> SamplingLayers
fn clone(&self) -> SamplingLayers
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 SamplingLayers
impl Debug for SamplingLayers
Source§impl Default for SamplingLayers
impl Default for SamplingLayers
Source§fn default() -> SamplingLayers
fn default() -> SamplingLayers
Source§impl PartialEq for SamplingLayers
impl PartialEq for SamplingLayers
Source§fn eq(&self, other: &SamplingLayers) -> bool
fn eq(&self, other: &SamplingLayers) -> bool
self and other values to be equal, and is used by ==.