pub struct ModelTargets {
pub targets: HashMap<String, Vec<InferenceTarget>>,
/* private fields */
}Expand description
Per-model routing table.
Fields§
§targets: HashMap<String, Vec<InferenceTarget>>model_name -> list of inference targets.
Implementations§
Source§impl ModelTargets
impl ModelTargets
Sourcepub fn get(&self, model: &str) -> InferenceTarget
pub fn get(&self, model: &str) -> InferenceTarget
Get target for a specific model. Round-robins across multiple hosts.
Sourcepub fn candidates(&self, model: &str) -> Vec<InferenceTarget>
pub fn candidates(&self, model: &str) -> Vec<InferenceTarget>
All candidate targets for a model, preserving their current order.
Sourcepub fn pick_from(&self, candidates: &[InferenceTarget]) -> InferenceTarget
pub fn pick_from(&self, candidates: &[InferenceTarget]) -> InferenceTarget
Round-robin pick from a caller-supplied candidate slice.
Sourcepub fn pick_sticky_from(
candidates: &[InferenceTarget],
sticky_key: u64,
) -> InferenceTarget
pub fn pick_sticky_from( candidates: &[InferenceTarget], sticky_key: u64, ) -> InferenceTarget
Sticky pick from a caller-supplied candidate slice.
Trait Implementations§
Source§impl Clone for ModelTargets
impl Clone for ModelTargets
Source§fn clone(&self) -> ModelTargets
fn clone(&self) -> ModelTargets
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelTargets
impl Debug for ModelTargets
Source§impl Default for ModelTargets
impl Default for ModelTargets
Source§fn default() -> ModelTargets
fn default() -> ModelTargets
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelTargets
impl RefUnwindSafe for ModelTargets
impl Send for ModelTargets
impl Sync for ModelTargets
impl Unpin for ModelTargets
impl UnsafeUnpin for ModelTargets
impl UnwindSafe for ModelTargets
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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