pub enum OpenRouterRoutingPreset {
CheapestWithTools,
LowestLatencyReview,
ZdrOnly,
ByokFirst,
NoDataCollection,
StrictJson,
ReasoningRequired,
MaxPrice {
prompt_usd_per_million: Option<f64>,
completion_usd_per_million: Option<f64>,
},
}Expand description
High-level intent presets that compile into OpenRouter provider-routing
controls. Presets let callers express quality, cost, privacy, and capability
goals without knowing every OpenRouter provider flag.
Multiple presets may be combined. When a preset and an explicit provider
field target the same control, the explicit field wins. Presets applied
earlier in the list may be overridden by later ones for the same field.
Compilation happens in OpenRouterRoutingConfig::apply_presets().
Variants§
CheapestWithTools
Prefer the cheapest providers that support function-calling parameters.
LowestLatencyReview
Prefer the highest-throughput providers for quick review or triage tasks.
ZdrOnly
Route only to zero-data-retention (ZDR) endpoints.
ByokFirst
Try BYOK-registered providers first; fall back to shared capacity.
NoDataCollection
Deny all provider-side data collection (logs and training).
StrictJson
Route only to providers that support strict JSON / structured output.
ReasoningRequired
Route only to providers that natively support reasoning/thinking models.
MaxPrice
Cap per-token provider cost. Values are USD per million tokens; None
means no cap on that dimension.
Trait Implementations§
Source§impl Clone for OpenRouterRoutingPreset
impl Clone for OpenRouterRoutingPreset
Source§fn clone(&self) -> OpenRouterRoutingPreset
fn clone(&self) -> OpenRouterRoutingPreset
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 OpenRouterRoutingPreset
impl Debug for OpenRouterRoutingPreset
Source§impl<'de> Deserialize<'de> for OpenRouterRoutingPreset
impl<'de> Deserialize<'de> for OpenRouterRoutingPreset
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 OpenRouterRoutingPreset
impl PartialEq for OpenRouterRoutingPreset
Source§impl Serialize for OpenRouterRoutingPreset
impl Serialize for OpenRouterRoutingPreset
impl StructuralPartialEq for OpenRouterRoutingPreset
Auto Trait Implementations§
impl Freeze for OpenRouterRoutingPreset
impl RefUnwindSafe for OpenRouterRoutingPreset
impl Send for OpenRouterRoutingPreset
impl Sync for OpenRouterRoutingPreset
impl Unpin for OpenRouterRoutingPreset
impl UnsafeUnpin for OpenRouterRoutingPreset
impl UnwindSafe for OpenRouterRoutingPreset
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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