IModelRegistry<T, TInput, TOutput>
Interfaces · AiDotNet.Interfaces
Defines the contract for model registry systems that manage trained model storage and versioning.
Known implementations: ModelRegistryBase<T, TInput, TOutput>
How It Works
A model registry serves as a centralized repository for trained models, managing their lifecycle from development through production deployment.
For Beginners: Think of a model registry like a library for your trained models. Just like a library catalogs books and tracks which are checked out, a model registry:
- Stores all your trained models in one place
- Tracks different versions of the same model
- Records which models are being used in production
- Helps you find and retrieve the right model when you need it
Key features include:
- Model versioning (keeping track of model evolution)
- Metadata tracking (when trained, by whom, with what data)
- Stage management (development, staging, production)
- Model comparison and lineage tracking
Why model registries matter:
- Prevents losing track of trained models
- Enables rollback to previous versions if needed
- Provides audit trail for compliance
- Facilitates collaboration between team members
- Simplifies deployment process
Methods
| Method | Summary |
|---|---|
List<ModelVersionInfo<T>> ListModelVersions(string modelName) |
Lists all versions of a specific model. |
List<RegisteredModel<T, TInput, TOutput>> SearchModels(ModelSearchCriteria<T> searchCriteria) |
Searches for models based on criteria. |
List<string> ListModels(string filter, Dictionary<string, string> tags) |
Lists all models in the registry. |
ModelCard GenerateModelCard(string modelName, int version, string developers) |
Generates a Model Card from the registered model’s metadata and evaluation results. |
ModelCard GetModelCard(string modelName, int version) |
Gets the Model Card for a registered model version. |
ModelComparison<T> CompareModels(string modelName, int version1, int version2) |
Compares two model versions. |
ModelLineage GetModelLineage(string modelName, int version) |
Gets the lineage information for a model (how it was created). |
RegisteredModel<T, TInput, TOutput> GetLatestModel(string modelName) |
Gets the latest version of a model. |
RegisteredModel<T, TInput, TOutput> GetModel(string modelName, int? version) |
Retrieves a specific model version from the registry. |
RegisteredModel<T, TInput, TOutput> GetModelByStage(string modelName, ModelStage stage) |
Gets the model currently in a specific stage (e.g., production). |
int CreateModelVersion(string modelName, IModel<TInput, TOutput, TMetadata> model, ModelMetadata<T> metadata, string description) |
Creates a new version of an existing model. |
string GetModelStoragePath(string modelName, int version) |
Gets the storage location for a model version. |
string RegisterModel(string name, IModel<TInput, TOutput, TMetadata> model, ModelMetadata<T> metadata, Dictionary<string, string> tags) |
Registers a new model in the registry. |
void ArchiveModel(string modelName, int version) |
Archives a model version. |
void AttachModelCard(string modelName, int version, ModelCard modelCard) |
Attaches a Model Card to a registered model version. |
void DeleteModel(string modelName) |
Deletes all versions of a model. |
void DeleteModelVersion(string modelName, int version) |
Deletes a specific model version. |
void SaveModelCard(string modelName, int version, string filePath) |
Saves the Model Card for a model version to a file. |
void TransitionModelStage(string modelName, int version, ModelStage targetStage, bool archivePrevious) |
Transitions a model version to a different stage. |
void UpdateModelMetadata(string modelName, int version, ModelMetadata<T> metadata) |
Updates the metadata for a model version. |
void UpdateModelTags(string modelName, int version, Dictionary<string, string> tags) |
Adds or updates tags for a model. |