pub struct RouteAction {
pub target_model: String,
pub fallbacks: Vec<String>,
pub disable_cache: bool,
pub max_cost_usd: Option<f64>,
}Expand description
What a matching Route does to the request before dispatch.
Fields§
§target_model: StringRewrite to this model. May target a different provider than the request (V3d-1 cross-provider routing); the target is capability-checked and dispatch/savings use the target’s own provider.
fallbacks: Vec<String>Ordered fallback model ids, tried in order when the primary dispatch
fails with a fallback-eligible error (provider down / 5xx / timeout).
Empty = no failover. The gateway resolves each via the registry, so a
fallback may cross providers. Populated by the cloud routes schema;
#[serde(default)] keeps older rows / payloads compatible.
disable_cache: boolWhen true, a request this route matches skips L1+L2 entirely (no lookup, no insert) — for privacy/sensitive traffic that must not persist in the shared cache. Default false; omitted from JSON when false.
max_cost_usd: Option<f64>Hard per-request ceiling (USD). After this route’s rewrite, if the
rerouted model’s estimated cost still exceeds this, the gateway rejects
the request (402) instead of dispatching. None = no ceiling.
Trait Implementations§
Source§impl Clone for RouteAction
impl Clone for RouteAction
Source§fn clone(&self) -> RouteAction
fn clone(&self) -> RouteAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more