pub struct ConfigSnapshot {
pub temperature: f64,
pub top_p: f64,
pub top_k: f64,
pub frequency_penalty: f64,
pub presence_penalty: f64,
pub retrieval_top_k: f64,
pub similarity_threshold: f64,
pub temporal_decay: f64,
}Expand description
Snapshot of all tunable parameters for a single experiment arm.
ConfigSnapshot is the bridge between Zeph’s runtime Config and the
variation engine. Each experiment arm is defined by a snapshot derived from
the baseline config with exactly one parameter changed.
Fields§
§temperature: f64§top_p: f64§top_k: f64§frequency_penalty: f64§presence_penalty: f64§retrieval_top_k: f64§similarity_threshold: f64§temporal_decay: f64Implementations§
Source§impl ConfigSnapshot
impl ConfigSnapshot
Sourcepub fn from_config(config: &Config) -> Self
pub fn from_config(config: &Config) -> Self
Create a snapshot from the current runtime config.
LLM generation parameters come from config.llm.candle.generation when
a Candle provider is configured. All other providers do not expose
generation params in config — defaults are used for the experiment baseline.
Memory parameters are read from config.memory.semantic.
Sourcepub fn apply(&self, variation: &Variation) -> Self
pub fn apply(&self, variation: &Variation) -> Self
Apply a single variation and return a new snapshot with that parameter changed.
Sourcepub fn diff(&self, other: &ConfigSnapshot) -> Option<Variation>
pub fn diff(&self, other: &ConfigSnapshot) -> Option<Variation>
Return the single Variation that differs between self and other, or None
if zero or more than one parameter differs.
Integer parameters (TopK, RetrievalTopK) produce a VariationValue::Int variant.
Sourcepub fn get(&self, kind: ParameterKind) -> f64
pub fn get(&self, kind: ParameterKind) -> f64
Get the value of a parameter by kind.
Sourcepub fn set(&mut self, kind: ParameterKind, value: f64)
pub fn set(&mut self, kind: ParameterKind, value: f64)
Set the value of a parameter by kind.
Sourcepub fn to_generation_overrides(&self) -> GenerationOverrides
pub fn to_generation_overrides(&self) -> GenerationOverrides
Extract LLM-relevant parameter overrides for use by the experiment engine.
Uses .round() as usize for top_k to avoid truncation from floating-point noise.
Trait Implementations§
Source§impl Clone for ConfigSnapshot
impl Clone for ConfigSnapshot
Source§fn clone(&self) -> ConfigSnapshot
fn clone(&self) -> ConfigSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigSnapshot
impl Debug for ConfigSnapshot
Source§impl Default for ConfigSnapshot
impl Default for ConfigSnapshot
Source§impl<'de> Deserialize<'de> for ConfigSnapshot
impl<'de> Deserialize<'de> for ConfigSnapshot
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>,
Auto Trait Implementations§
impl Freeze for ConfigSnapshot
impl RefUnwindSafe for ConfigSnapshot
impl Send for ConfigSnapshot
impl Sync for ConfigSnapshot
impl Unpin for ConfigSnapshot
impl UnsafeUnpin for ConfigSnapshot
impl UnwindSafe for ConfigSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request