pub struct RoutingRules {
pub enabled: Option<bool>,
pub aliases: BTreeMap<String, String>,
pub tiers: BTreeMap<String, String>,
}Expand description
[proxy.routing] — explicit, operator-written model targets.
Aliases map an exact requested model to a fixed target, e.g. an org
name (acme/fast) onto an approved endpoint or a local model. LeanCTX never
chooses a model by itself: automatic, intent- or cost-based selection was
removed in v4 (the gateway decides what may leave, not which model).
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: an unknown alias or unreachable target 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>Removed intent-tier table. Still parsed so doctor can tell an operator
that it no longer routes anything; never read by the proxy.
Implementations§
Trait Implementations§
Source§impl Clone for RoutingRules
impl Clone for RoutingRules
Source§impl Debug for RoutingRules
impl Debug for RoutingRules
Source§impl Default for RoutingRules
impl Default for 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 Forget for RoutingRules
impl Freeze for RoutingRules
impl Move 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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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