Sub topic 6
Documenting Versions with Descriptions and Tags
This chapter assumes you know MLflow Tracking, runs, artifacts, and basic Python. You also need a registered model with at least one model version. A model description explains the asset in human-readable terms. Tags store small pieces of structured metadata that tools and people can use to filter, validate, and govern versions.
Model descriptions and version descriptions
A registered model is the long-lived name, such as iris-classifier. A model version is one specific artifact produced by a run, such as version 3.
Use the registered model description for information shared by all versions:
- What the model predicts.
- Which business or technical problem it solves.
- Who owns it.
- What input and output concepts it uses.
Use a version description for information about one release:
- Which data or code produced the version.
- What validation was performed.
- Known limitations.
- Why the version is ready, rejected, or awaiting review.
Descriptions are free-form text. They are useful for people, but automation should use tags with predictable keys and values.
| Metadata | Belongs to | Typical use |
|---|---|---|
| Description | Registered model | Explain the model's purpose |
| Version description | Model version | Explain one candidate or release |
| Registered-model tag | Registered model | Store ownership or domain |
| Version tag | Model version | Store validation and release status |
Setting descriptions
The MlflowClient updates registry metadata. The following example updates both the general model description and the description for version 3.
from mlflow import MlflowClient
client = MlflowClient(tracking_uri="http://127.0.0.1:5000")
model_name = "iris-classifier"
version = "3"
client.update_registered_model(
name=model_name,
description=(
"Classifies iris flowers from sepal and petal measurements. "
"The ML platform team owns this model."
),
)
client.update_model_version(
name=model_name,
version=version,
description=(
"Candidate trained with the current training pipeline. "
"Validation used the held-out test set and passed."
),
)Descriptions can be changed later without creating a new model version. Changing a description does not change the model artifact.
Adding tags
Tags are key-value pairs. MLflow stores tag values as strings, so use consistent spellings such as passed, failed, and pending.
from mlflow import MlflowClient
client = MlflowClient(tracking_uri="http://127.0.0.1:5000")
model_name = "iris-classifier"
version = "3"
client.set_registered_model_tag(model_name, "owner", "ml-platform")
client.set_registered_model_tag(model_name, "domain", "classification")
client.set_model_version_tag(model_name, version, "validation_status", "passed")
client.set_model_version_tag(model_name, version, "validated_by", "offline-evaluation")
client.set_model_version_tag(model_name, version, "data_snapshot", "2026-11-30")
print(f"Documented {model_name} version {version}")Keep tags small and stable. A tag should describe one fact. Do not store a large report or secret credential in a tag. Store a link to an approved report when a larger record is needed.
A version tag can support a promotion gate. For example, an automation job might promote only versions whose validation_status is passed. The tag records the result, but access control must still prevent unauthorized users from changing it.
Common errors
- Setting
validation_statuson the registered model instead of on the version. The status usually applies to one version. - Using many spellings for the same state, such as
pass,passed, andapproved. Choose a vocabulary and enforce it. - Treating a description as an immutable audit record. Descriptions can be edited.
- Assuming tags are typed values. MLflow tag values are strings, even when they contain dates or numbers.
Exercise
Where should you store a validation result that applies only to version 4 of a registered model?
Show answer
Store it as a model-version tag, such as validation_status=passed, and link it to reproducible validation evidence when possible.