pub struct RoutingRules {
pub enabled: Option<bool>,
pub aliases: BTreeMap<String, String>,
pub tiers: BTreeMap<String, String>,
}Expand description
[proxy.routing] — the active router’s rule set (enterprise#13).
Two mechanisms, both within-shape in M1 (the target must speak the same wire dialect as the request; N×M shape translation is M2):
- Aliases: exact requested-model → target. Lets an org expose stable
names (
acme/fast) or transparently swap one concrete model for another. - Tiers: intent-based downgrade. The request’s last user message is
classified (
intent_router); the resulting tier (fast|standard|premium) picks a target from this table. An absent tier key (or"") keeps the requested model — premium work is never silently downgraded unless the operator says so.
A target is "model" (swap the model, keep the upstream) or
"provider:model" where provider is a [[proxy.providers]] registry id
or a built-in (anthropic|openai|gemini) — then the request is also
re-targeted to that provider’s upstream.
Fail-open by construction: any lookup/classification/validation miss routes nothing and forwards the request unchanged.
Fields§
§enabled: Option<bool>Master switch; false/absent = passthrough (no body rewrite at all).
aliases: BTreeMap<String, String>Exact model-name aliases: requested model → "provider:model" | "model".
BTreeMap for deterministic iteration/serialization (#498).
tiers: BTreeMap<String, String>Intent-tier targets: fast|standard|premium → "provider:model" |
"model" | "" (= keep requested model).
Implementations§
Trait Implementations§
Source§impl Clone for RoutingRules
impl Clone for RoutingRules
Source§fn clone(&self) -> RoutingRules
fn clone(&self) -> RoutingRules
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 RoutingRules
impl Debug for RoutingRules
Source§impl Default for RoutingRules
impl Default for RoutingRules
Source§fn default() -> RoutingRules
fn default() -> RoutingRules
Source§impl<'de> Deserialize<'de> for RoutingRuleswhere
RoutingRules: Default,
impl<'de> Deserialize<'de> for RoutingRuleswhere
RoutingRules: Default,
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>,
impl Eq for RoutingRules
Source§impl PartialEq for RoutingRules
impl PartialEq for RoutingRules
Source§impl Serialize for RoutingRules
impl Serialize for RoutingRules
impl StructuralPartialEq for RoutingRules
Auto Trait Implementations§
impl Freeze for RoutingRules
impl RefUnwindSafe for RoutingRules
impl Send for RoutingRules
impl Sync for RoutingRules
impl Unpin for RoutingRules
impl UnsafeUnpin for RoutingRules
impl UnwindSafe for RoutingRules
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more