pub struct RoutingConfig {
pub local_threshold: f64,
pub cloud_threshold: f64,
pub local_cost_per_1k_tokens: f64,
pub cloud_cost_per_1k_tokens: f64,
pub adaptive: AdaptiveConfig,
pub domain_terms: Vec<String>,
}Expand description
Configuration for the model routing layer.
Controls how the super::ComplexityScorer output maps to a
super::RoutingDecision and how per-token costs are tracked.
§Panics
This type never panics.
Fields§
§local_threshold: f64Complexity score below which requests route to the local model.
Range: 0.0..=1.0. Default: 0.4.
cloud_threshold: f64Complexity score above which requests route directly to the cloud model.
Range: 0.0..=1.0, must be >= local_threshold. Default: 0.7.
local_cost_per_1k_tokens: f64Estimated cost per 1 000 input tokens for the local worker.
cloud_cost_per_1k_tokens: f64Estimated cost per 1 000 input tokens for the cloud worker.
adaptive: AdaptiveConfigAdaptive threshold tuning settings.
domain_terms: Vec<String>Domain-specific terminology used by the complexity scorer.
Any prompt containing two or more of these terms (case-insensitive)
receives the +0.15 domain-term complexity bonus.
Defaults to a built-in list of Rust and financial terms.
Trait Implementations§
Source§impl Clone for RoutingConfig
impl Clone for RoutingConfig
Source§fn clone(&self) -> RoutingConfig
fn clone(&self) -> RoutingConfig
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 RoutingConfig
impl Debug for RoutingConfig
Source§impl Default for RoutingConfig
impl Default for RoutingConfig
Source§impl<'de> Deserialize<'de> for RoutingConfig
impl<'de> Deserialize<'de> for RoutingConfig
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 PartialEq for RoutingConfig
impl PartialEq for RoutingConfig
Source§fn eq(&self, other: &RoutingConfig) -> bool
fn eq(&self, other: &RoutingConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RoutingConfig
impl Serialize for RoutingConfig
impl StructuralPartialEq for RoutingConfig
Auto Trait Implementations§
impl Freeze for RoutingConfig
impl RefUnwindSafe for RoutingConfig
impl Send for RoutingConfig
impl Sync for RoutingConfig
impl Unpin for RoutingConfig
impl UnsafeUnpin for RoutingConfig
impl UnwindSafe for RoutingConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§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