in the stack.

zenml integration install mlflow -yOnce the MLflow integration is installed, you can register an MLflow model registry component in your stack:

zenml model-registry register mlflow_model_registry --flavor=mlflow

# Register and set a stack with the new model registry as the active stack

zenml stack register custom_stack -r mlflow_model_registry ... --set

The MLFlow model registry will automatically use the same configuration as the MLFlow Experiment Tracker. So if you have a remote MLFlow tracking server configured in your stack, the MLFlow model registry will also use the same configuration.

Due to a critical severity vulnerability found in older versions of MLflow, we recommend using MLflow version 2.2.1 or higher.

How do you use it?

There are different ways to use the MLflow model registry. You can use it in your ZenML pipelines with the built-in step, or you can use the ZenML CLI to register your model manually or call the model registry API within a custom step in your pipeline. The following sections show you how to use the MLflow model registry in your ZenML pipelines and with the ZenML CLI:

Register models inside a pipeline

ZenML provides a predefined mlflow_model_deployer_step that you can use to register a model in the MLflow model registry which you have previously logged to MLflow:

from zenml import pipeline

from zenml.integrations.mlflow.steps.mlflow_registry import (

mlflow_register_model_step,

@pipeline

def mlflow_registry_training_pipeline():

model = ...

mlflow_register_model_step(

model=model,

name="tensorflow-mnist-model",

The mlflow_register_model_step expects that the model it receives has already been logged to MLflow in a previous step. E.g., for a scikit-learn model, you would need to have used mlflow.sklearn.autolog() or mlflow.sklearn.log_model(model) in a previous step. See the MLflow experiment tracker documentation for more information on how to log models to MLflow from your ZenML steps.

List of available parameters