Skip to main content

1. What is Model Registry?

A Model Registry is a centralized system used to store, manage, version, and track machine learning models. Instead of keeping trained models as random files:
a registry provides an organized structure:
A registry can store information such as:
  • Model name
  • Model version
  • Model artifacts
  • Training metrics
  • Model parameters
  • Creation time
  • Model stage/status
  • Metadata

2. Why Model Versioning?

Model versioning makes it possible to keep multiple versions of a trained model. Example:
If version 2 introduces a problem, version 1 can be restored.

3. Semantic Versioning

Semantic Versioning, commonly called SemVer, uses:
Example:

MAJOR

Used when there are incompatible changes.
Example:
  • Completely different model architecture
  • Input format changed
  • Prediction interface changed

MINOR

Used when new functionality is added without breaking compatibility.
Example:
  • Additional features
  • Improved model
  • New preprocessing capability

PATCH

Used for small fixes.
Example:
  • Bug fix
  • Configuration correction
  • Minor improvement

4. Model Registry Workflow


5. MLflow Model Registry

For the MLflow-based workflow, MLflow Model Registry can be used to manage model versions. The basic architecture is:

6. Install MLflow


7. Simple Model Registry Example

model_registry.py

version 2: changing the test size

8. Important Part: Registering the Model

This section registers the trained model:
The important parameter is:
MLflow creates a registered model called:
A new model version can be created when another run registers the same model name. For example:

9. Start MLflow UI

Run:
Open:
The MLflow UI can be used to inspect:
The registered model can be viewed from the Models section.

10. Load a Specific Model Version

A registered model can be loaded using its name and version.
Here:
is the model name.
is the model version.

11. Make Predictions Using the Loaded Model


12. Load Different Versions

Version 1:
Version 2:
Version 3:
This allows a specific model version to be selected.

13. Model Version Example

Suppose three training runs are performed.
Then an improved model:
Another improvement:
The registry now contains:

14. Model Lifecycle

A model can move through different lifecycle states depending on the registry workflow. Typical workflow:
For example:

15. Model Registry vs Experiment Tracking

These concepts are related but different.

Experiment Tracking

Answers:
How was this model trained?
Example:

Model Registry

Answers:
Which model version should be used?
Example:

16. Recommended Model Naming

Use descriptive names:
Avoid names such as:

17. Important Model Metadata

A production model registry should ideally track:
Example:

18. Complete Model Lifecycle


Key Concepts

  • Model Registry - centralized management of trained model versions.
  • Model Version - a specific registered instance of a model.
  • Semantic Versioning - MAJOR.MINOR.PATCH version format.
  • Experiment Tracking - records parameters, metrics, artifacts, and training runs.
  • Model Registry - manages model versions and lifecycle.
  • Model Artifact - saved trained model that can be loaded later.
  • Rollback - switching back to an earlier model version.
  • Staging - model validation environment before production.
  • Production - model version currently used by an application.
  • Archived - old model version retained for historical purposes.

File