pub struct RouterEngine { /* private fields */ }Implementations§
Source§impl RouterEngine
impl RouterEngine
pub fn new(global_limits: GlobalLimits) -> Self
pub async fn add_deployment(&self, deployment: Deployment)
pub async fn remove_deployment(&self, deployment_id: &str)
pub async fn rebuild_pool(&self, deployments: Vec<Deployment>)
pub async fn register_strategy(&self, strategy: Box<dyn RoutingStrategy>)
pub async fn set_default_strategy(&self, name: &str)
pub async fn set_fallback_config(&self, config: FallbackConfig)
pub async fn set_alias(&self, alias: &str, target: &str)
pub async fn set_routing_group(&self, model: &str, strategy_name: &str)
pub async fn record_success( &self, deployment_id: &str, latency_ms: f64, tokens: u64, state: &dyn RoutingState, )
pub async fn record_failure( &self, deployment_id: &str, state: &dyn RoutingState, )
pub fn resolve_alias(model: &str, aliases: &HashMap<String, String>) -> String
pub async fn select_deployment( &self, model: &str, state: &dyn RoutingState, ctx: &RoutingContext, ) -> Result<RoutingResult, RoutingError>
pub async fn route_with_fallback<T: Send + 'static>( &self, model: &str, state: &dyn RoutingState, ctx: &RoutingContext, executor: impl Fn(Arc<Deployment>) -> Pin<Box<dyn Future<Output = Result<T, HyperInferError>> + Send>> + Send, ) -> Result<(RoutingResult, T), RoutingError>
Auto Trait Implementations§
impl !RefUnwindSafe for RouterEngine
impl !UnwindSafe for RouterEngine
impl Freeze for RouterEngine
impl Send for RouterEngine
impl Sync for RouterEngine
impl Unpin for RouterEngine
impl UnsafeUnpin for RouterEngine
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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