)

print(model.run_metadata["metadata_key"].value)For further depth, there is an advanced metadata logging guide that goes more into detail about logging metadata in ZenML.

Using the stages of a model

A model's versions can exist in various stages. These are meant to signify their lifecycle state:

staging: This version is staged for production.

production: This version is running in a production setting.

latest: The latest version of the model.

archived: This is archived and no longer relevant. This stage occurs when a model moves out of any other stage.

from zenml import Model

# Get the latest version of a model

model = Model(

name="iris_classifier",

version="latest"

# Get `my_version` version of a model

model = Model(

name="iris_classifier",

version="my_version",

# Pass the stage into the version field

# to get the `staging` model

model = Model(

name="iris_classifier",

version="staging",

# This will set this version to production

model.set_stage(stage="production", force=True)

# List staging models

zenml model version list <MODEL_NAME> --stage staging

# Update to production

zenml model version update <MODEL_NAME> <MODEL_VERSIONNAME> -s production

The ZenML Pro dashboard has additional capabilities, that include easily changing the stage:

ZenML Model and versions are some of the most powerful features in ZenML. To understand them in a deeper way, read the dedicated Model Management guide.

PreviousManage artifacts

NextA starter project

Last updated 19 days ago