pub struct FoundryLocalManager { /* private fields */ }Expand description
Manager for Foundry Local SDK operations.
Implementations§
Source§impl FoundryLocalManager
impl FoundryLocalManager
Sourcepub fn builder() -> FoundryLocalManagerBuilder
pub fn builder() -> FoundryLocalManagerBuilder
Create a new builder for FoundryLocalManager.
Sourcepub fn service_uri(&self) -> Result<&str>
pub fn service_uri(&self) -> Result<&str>
Sourcepub fn is_service_running(&mut self) -> bool
pub fn is_service_running(&mut self) -> bool
Check if the service is running. Will also set the service URI if it is not set.
§Returns
True if the service is running, False otherwise.
Sourcepub fn start_service(&mut self) -> Result<()>
pub fn start_service(&mut self) -> Result<()>
Sourcepub async fn list_catalog_models(&mut self) -> Result<&Vec<FoundryModelInfo>>
pub async fn list_catalog_models(&mut self) -> Result<&Vec<FoundryModelInfo>>
Sourcepub fn refresh_catalog(&mut self)
pub fn refresh_catalog(&mut self)
Refresh the catalog.
Sourcepub async fn get_model_info(
&mut self,
alias_or_model_id: &str,
raise_on_not_found: bool,
) -> Result<FoundryModelInfo>
pub async fn get_model_info( &mut self, alias_or_model_id: &str, raise_on_not_found: bool, ) -> Result<FoundryModelInfo>
Get the model information by alias or ID.
§Arguments
alias_or_model_id- Alias or Model ID. If it is an alias, the most preferred model will be returned.raise_on_not_found- If true, raise an error if the model is not found. Default is false.
§Returns
Model information, or None if not found and raise_on_not_found is false.
Sourcepub async fn get_cache_location(&self) -> Result<String>
pub async fn get_cache_location(&self) -> Result<String>
Sourcepub async fn list_cached_models(&mut self) -> Result<Vec<FoundryModelInfo>>
pub async fn list_cached_models(&mut self) -> Result<Vec<FoundryModelInfo>>
Sourcepub async fn download_model(
&mut self,
alias_or_model_id: &str,
token: Option<&str>,
force: bool,
) -> Result<FoundryModelInfo>
pub async fn download_model( &mut self, alias_or_model_id: &str, token: Option<&str>, force: bool, ) -> Result<FoundryModelInfo>
Sourcepub async fn load_model(
&mut self,
alias_or_model_id: &str,
ttl: Option<i32>,
) -> Result<FoundryModelInfo>
pub async fn load_model( &mut self, alias_or_model_id: &str, ttl: Option<i32>, ) -> Result<FoundryModelInfo>
Sourcepub async fn list_loaded_models(&mut self) -> Result<Vec<FoundryModelInfo>>
pub async fn list_loaded_models(&mut self) -> Result<Vec<FoundryModelInfo>>
Auto Trait Implementations§
impl Freeze for FoundryLocalManager
impl !RefUnwindSafe for FoundryLocalManager
impl Send for FoundryLocalManager
impl Sync for FoundryLocalManager
impl Unpin for FoundryLocalManager
impl !UnwindSafe for FoundryLocalManager
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