A model registry is a version control system for models that provides APIs to store and retrieve models and model-related artifacts. A model registry stores different versions of models, including metadata about their performance metrics, author, creation date, dependencies, usage, and lineage (training experiment code/hyperparameters and /training data).
Model registries are recommended for projects involving ML pipelines and/or those that require stringent governance, traceability, and management. The model registry stores the models and their metadata as the output of training pipelines, decoupling training pipelines from inference pipelines. Inference pipelines download a versioned model from the model registry during initialization, and keep it cached (this is safe, as models are immutable) for inference requests. In general, a model registry enables better collaboration, versioning, and organization of models in MLOps.
Some model registries provide a unified API for storing and retrieving models and their metadata, such as Hopsworks, Sagemaker, and Weights & Biases, while others, such as MLFlow, separate the metadata store for model metadata from an artifact store, where the serialized models are stored.
Example code for registering a Scikit-Learn model to Hopsworks is shown below: