Skip to content

Latest commit

 

History

History
145 lines (90 loc) · 4.02 KB

File metadata and controls

145 lines (90 loc) · 4.02 KB

ICatalog

Namespace: Microsoft.AI.Foundry.Local

public interface ICatalog

Attributes NullableContextAttribute

Properties

Name

The catalog name.

public abstract string Name { get; }

Property Value

String

Methods

ListModelsAsync(Nullable<CancellationToken>)

List the available models in the catalog.

Task<List<IModel>> ListModelsAsync(Nullable<CancellationToken> ct)

Parameters

ct Nullable<CancellationToken>
Optional CancellationToken.

Returns

Task<List<IModel>>
List of IModel instances.

GetModelAsync(String, Nullable<CancellationToken>)

Lookup a model by its alias.

Task<IModel> GetModelAsync(string modelAlias, Nullable<CancellationToken> ct)

Parameters

modelAlias String
Model alias.

ct Nullable<CancellationToken>
Optional CancellationToken.

Returns

Task<IModel>
The matching IModel, or null if no model with the given alias exists.

GetModelVariantAsync(String, Nullable<CancellationToken>)

Lookup a model variant by its unique model id. NOTE: This will return an IModel with a single variant. Use GetModelAsync to get an IModel with all available variants.

Task<IModel> GetModelVariantAsync(string modelId, Nullable<CancellationToken> ct)

Parameters

modelId String
Model id.

ct Nullable<CancellationToken>
Optional CancellationToken.

Returns

Task<IModel>
The matching IModel, or null if no variant with the given id exists.

GetCachedModelsAsync(Nullable<CancellationToken>)

Get a list of currently downloaded models from the model cache.

Task<List<IModel>> GetCachedModelsAsync(Nullable<CancellationToken> ct)

Parameters

ct Nullable<CancellationToken>
Optional CancellationToken.

Returns

Task<List<IModel>>
List of IModel instances.

GetLoadedModelsAsync(Nullable<CancellationToken>)

Get a list of the currently loaded models.

Task<List<IModel>> GetLoadedModelsAsync(Nullable<CancellationToken> ct)

Parameters

ct Nullable<CancellationToken>
Optional CancellationToken.

Returns

Task<List<IModel>>
List of IModel instances.

GetLatestVersionAsync(IModel, Nullable<CancellationToken>)

Get the latest version of a model. This is used to check if a newer version of a model is available in the catalog for download.

Task<IModel> GetLatestVersionAsync(IModel model, Nullable<CancellationToken> ct)

Parameters

model IModel
The model to check for the latest version.

ct Nullable<CancellationToken>
Optional cancellation token.

Returns

Task<IModel>
The latest version of the model. Will match the input if it is the latest version.