pub struct Catalog { /* private fields */ }Expand description
The model catalog provides discovery and lookup for all available models.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub async fn update_models(&self) -> Result<(), FoundryLocalError>
pub async fn update_models(&self) -> Result<(), FoundryLocalError>
Refresh the catalog from the native core.
No-op. The native catalog manages its own caching and refresh, so
there is nothing for the SDK to do here. This method is retained only for
API compatibility with the legacy SDK and always returns Ok(()).
Sourcepub async fn get_models(&self) -> Result<Vec<Arc<Model>>, FoundryLocalError>
pub async fn get_models(&self) -> Result<Vec<Arc<Model>>, FoundryLocalError>
Return all known models keyed by alias.
Sourcepub async fn get_model(
&self,
alias: &str,
) -> Result<Arc<Model>, FoundryLocalError>
pub async fn get_model( &self, alias: &str, ) -> Result<Arc<Model>, FoundryLocalError>
Look up a model by its alias.
Sourcepub async fn get_model_variant(
&self,
id: &str,
) -> Result<Arc<Model>, FoundryLocalError>
pub async fn get_model_variant( &self, id: &str, ) -> Result<Arc<Model>, FoundryLocalError>
Look up a specific model variant by its unique id.
NOTE: This will return a Model representing a single variant. Use
get_model to obtain a Model with all
available variants.
Sourcepub async fn get_cached_models(
&self,
) -> Result<Vec<Arc<Model>>, FoundryLocalError>
pub async fn get_cached_models( &self, ) -> Result<Vec<Arc<Model>>, FoundryLocalError>
Return only the model variants that are currently cached on disk.
Sourcepub async fn get_loaded_models(
&self,
) -> Result<Vec<Arc<Model>>, FoundryLocalError>
pub async fn get_loaded_models( &self, ) -> Result<Vec<Arc<Model>>, FoundryLocalError>
Return model variants that are currently loaded into memory.
Sourcepub async fn get_model_versions(
&self,
model_alias: &str,
model_name: Option<&str>,
max_versions: u32,
) -> Result<Vec<Arc<Model>>, FoundryLocalError>
pub async fn get_model_versions( &self, model_alias: &str, model_name: Option<&str>, max_versions: u32, ) -> Result<Vec<Arc<Model>>, FoundryLocalError>
Return catalog versions for an alias, optionally narrowed to one model name.
max_versions limits the results per model name; 0 returns all versions.
Sourcepub async fn get_latest_version(
&self,
model_or_model_variant: &Model,
) -> Result<Arc<Model>, FoundryLocalError>
pub async fn get_latest_version( &self, model_or_model_variant: &Model, ) -> Result<Arc<Model>, FoundryLocalError>
Resolve the latest catalog version for the provided model or variant.