pub struct ModelVersionManager { /* private fields */ }Expand description
Model version manager
Implementations§
Source§impl ModelVersionManager
impl ModelVersionManager
Sourcepub fn new(config: VersioningConfig) -> Self
pub fn new(config: VersioningConfig) -> Self
Create a new version manager
Sourcepub fn register_version(
&self,
metadata: ModelMetadata,
is_stable: bool,
) -> InferenceResult<()>
pub fn register_version( &self, metadata: ModelMetadata, is_stable: bool, ) -> InferenceResult<()>
Register a model version
Sourcepub fn get_active_version(&self, model_id: &str) -> Option<ModelVersion>
pub fn get_active_version(&self, model_id: &str) -> Option<ModelVersion>
Get the active version for a model
Sourcepub fn set_active_version(
&self,
model_id: &str,
version: ModelVersion,
) -> InferenceResult<()>
pub fn set_active_version( &self, model_id: &str, version: ModelVersion, ) -> InferenceResult<()>
Set the active version for a model
Sourcepub fn record_request(
&self,
model_id: &str,
version: &ModelVersion,
latency_ms: f64,
is_error: bool,
) -> InferenceResult<()>
pub fn record_request( &self, model_id: &str, version: &ModelVersion, latency_ms: f64, is_error: bool, ) -> InferenceResult<()>
Record a request for a model version
Sourcepub fn health_check(
&self,
model_id: &str,
version: &ModelVersion,
) -> InferenceResult<HealthCheck>
pub fn health_check( &self, model_id: &str, version: &ModelVersion, ) -> InferenceResult<HealthCheck>
Perform health check on a model version
Sourcepub fn get_fallback_version(
&self,
model_id: &str,
current_version: &ModelVersion,
) -> Option<ModelVersion>
pub fn get_fallback_version( &self, model_id: &str, current_version: &ModelVersion, ) -> Option<ModelVersion>
Get fallback version for a model
Sourcepub fn list_versions(&self, model_id: &str) -> Vec<ModelVersion>
pub fn list_versions(&self, model_id: &str) -> Vec<ModelVersion>
List all versions for a model
Sourcepub fn get_metadata(
&self,
model_id: &str,
version: &ModelVersion,
) -> Option<ModelMetadata>
pub fn get_metadata( &self, model_id: &str, version: &ModelVersion, ) -> Option<ModelMetadata>
Get metadata for a specific version
Sourcepub fn get_stats(
&self,
model_id: &str,
version: &ModelVersion,
) -> Option<ModelStats>
pub fn get_stats( &self, model_id: &str, version: &ModelVersion, ) -> Option<ModelStats>
Get statistics for a specific version
Auto Trait Implementations§
impl Freeze for ModelVersionManager
impl RefUnwindSafe for ModelVersionManager
impl Send for ModelVersionManager
impl Sync for ModelVersionManager
impl Unpin for ModelVersionManager
impl UnwindSafe for ModelVersionManager
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