pub struct ModelService { /* private fields */ }Expand description
Model management service
Implementations§
Source§impl ModelService
impl ModelService
Sourcepub fn with_models_dir(models_dir: PathBuf) -> Result<Self>
pub fn with_models_dir(models_dir: PathBuf) -> Result<Self>
Create a ModelService with custom models directory
Sourcepub fn list_catalog(&self) -> Result<Vec<ModelCatalogEntry>>
pub fn list_catalog(&self) -> Result<Vec<ModelCatalogEntry>>
List all models in the catalog
Sourcepub fn get_catalog_entry(&self, name: &str) -> Option<&ModelCatalogEntry>
pub fn get_catalog_entry(&self, name: &str) -> Option<&ModelCatalogEntry>
Get catalog entry for a model by name
Sourcepub async fn list_installed(&self) -> Result<Vec<InstalledModel>>
pub async fn list_installed(&self) -> Result<Vec<InstalledModel>>
List all installed models
Sourcepub async fn pull(
&self,
name: &str,
progress: Option<&ProgressBar>,
) -> Result<PathBuf>
pub async fn pull( &self, name: &str, progress: Option<&ProgressBar>, ) -> Result<PathBuf>
Download a model from the catalog
Sourcepub async fn pull_from_repo(
&self,
repo: &str,
filename: &str,
name: &str,
progress: Option<&ProgressBar>,
) -> Result<PathBuf>
pub async fn pull_from_repo( &self, repo: &str, filename: &str, name: &str, progress: Option<&ProgressBar>, ) -> Result<PathBuf>
Download a custom model from a HuggingFace repository
Sourcepub fn get_model_path(&self, name: &str) -> PathBuf
pub fn get_model_path(&self, name: &str) -> PathBuf
Get the path to a model’s ONNX file
Note: This method is no longer used by CLI (replaced by node-runner in Phase 2). Kept for potential future use.
Sourcepub async fn is_installed(&self, name: &str) -> bool
pub async fn is_installed(&self, name: &str) -> bool
Check if a model is installed
Note: This method is no longer used by CLI (replaced by node-runner in Phase 2). Kept for potential future use.
Auto Trait Implementations§
impl Freeze for ModelService
impl !RefUnwindSafe for ModelService
impl Send for ModelService
impl Sync for ModelService
impl Unpin for ModelService
impl !UnwindSafe for ModelService
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