pub struct MultiModelManager { /* private fields */ }Expand description
Multi-model manager
Implementations§
Source§impl MultiModelManager
impl MultiModelManager
Sourcepub fn new(config: MultiModelConfig) -> Self
pub fn new(config: MultiModelConfig) -> Self
Create a new multi-model manager
Sourcepub fn set_debug_logger(&mut self, logger: DebugLogger)
pub fn set_debug_logger(&mut self, logger: DebugLogger)
Set debug logger
Sourcepub fn set_quantizer(&mut self, quantizer: WebQuantizer)
pub fn set_quantizer(&mut self, quantizer: WebQuantizer)
Set quantizer for model optimization
Sourcepub fn register_model(&mut self, metadata: &str) -> Result<(), JsValue>
pub fn register_model(&mut self, metadata: &str) -> Result<(), JsValue>
Register a model in the system
Sourcepub fn get_model_index(&self, model_id: &str) -> Option<usize>
pub fn get_model_index(&self, model_id: &str) -> Option<usize>
Get a model for inference by ID
Sourcepub fn route_request(&self, input_context: &str) -> Result<String, JsValue>
pub fn route_request(&self, input_context: &str) -> Result<String, JsValue>
Route a request to the appropriate model
Sourcepub fn set_default_model(&mut self, model_id: &str)
pub fn set_default_model(&mut self, model_id: &str)
Set the default model
Sourcepub fn get_loaded_models(&self) -> Array
pub fn get_loaded_models(&self) -> Array
Get list of loaded models
Sourcepub fn get_performance_stats(&self) -> String
pub fn get_performance_stats(&self) -> String
Get performance statistics for all models
Sourcepub fn optimize_memory(&mut self) -> Result<(), JsValue>
pub fn optimize_memory(&mut self) -> Result<(), JsValue>
Optimize memory usage by unloading inactive models
Sourcepub async fn preload_models(&mut self) -> Result<(), JsValue>
pub async fn preload_models(&mut self) -> Result<(), JsValue>
Preload models based on usage patterns
Sourcepub fn get_total_memory_usage(&self) -> usize
pub fn get_total_memory_usage(&self) -> usize
Get current memory usage across all models
Sourcepub fn get_system_status(&self) -> String
pub fn get_system_status(&self) -> String
Get system status summary
Trait Implementations§
Source§impl From<MultiModelManager> for JsValue
impl From<MultiModelManager> for JsValue
Source§fn from(value: MultiModelManager) -> Self
fn from(value: MultiModelManager) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for MultiModelManager
impl FromWasmAbi for MultiModelManager
Source§impl IntoWasmAbi for MultiModelManager
impl IntoWasmAbi for MultiModelManager
Source§impl RefFromWasmAbi for MultiModelManager
impl RefFromWasmAbi for MultiModelManager
Source§type Anchor = RcRef<MultiModelManager>
type Anchor = RcRef<MultiModelManager>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl TryFromJsValue for MultiModelManager
impl TryFromJsValue for MultiModelManager
Source§impl VectorFromWasmAbi for MultiModelManager
impl VectorFromWasmAbi for MultiModelManager
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[MultiModelManager]>
Source§impl VectorIntoWasmAbi for MultiModelManager
impl VectorIntoWasmAbi for MultiModelManager
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[MultiModelManager]>) -> Self::Abi
Source§impl WasmDescribeVector for MultiModelManager
impl WasmDescribeVector for MultiModelManager
impl SupportsConstructor for MultiModelManager
impl SupportsInstanceProperty for MultiModelManager
impl SupportsStaticProperty for MultiModelManager
Auto Trait Implementations§
impl Freeze for MultiModelManager
impl !RefUnwindSafe for MultiModelManager
impl !Send for MultiModelManager
impl !Sync for MultiModelManager
impl Unpin for MultiModelManager
impl UnsafeUnpin for MultiModelManager
impl !UnwindSafe for MultiModelManager
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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.