Understanding Model Registration
This lesson explains why models are registered, how the model types differ, what the MLflow model format provides, and how registration keeps lineage.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the properties of a registered model.
- Distinguish mlflow_model, custom_model and triton_model.
- Explain what an MLflow signature enables.
- Describe registration from job outputs.
Why register models
A model file in a job's outputs is just a file. A registered model is an asset with a name and an integer version, a type, a description, tags and a link to the job that produced it. Endpoints deploy registered models, registries share them, monitoring and Responsible AI tools analyse them, and auditors trace them back to code and data. Registration is the step that turns an experiment result into something the organization can manage.
Each registration of an existing name creates the next version, such as churn:7. The files of a version are immutable, and only metadata such as the description, tags and stage can change, so the artifact that was validated is the one that is deployed.
Model types
A model asset's type tells Azure Machine Learning how to treat its files, which in turn decides how much work deployment needs.
| Type | Contents | Deployment |
|---|---|---|
mlflow_model | An MLflow model folder with an MLmodel file | No-code: the scoring script and environment are generated |
custom_model | Any files, such as a pickle, ONNX file or checkpoint folder | Requires your scoring script and environment |
triton_model | A model repository for NVIDIA Triton Inference Server | No-code on Triton-capable deployments |
The MLflow format is the recommended default, because it carries the information that deployment, monitoring and Responsible AI tools need, and it works with many frameworks.
The MLflow model format
An MLflow model is a folder. Its MLmodel file lists the model's flavors, such as sklearn for scikit-learn and the generic python_function flavor that any MLflow tool can load; its signature, which describes the input columns and types and the outputs; and the environment files, conda.yaml and requirements.txt, that recreate its dependencies. The serialized model sits beside it.
artifact_path: model
flavors:
python_function:
loader_module: mlflow.sklearn
model_path: model.pkl
env:
conda: conda.yaml
virtualenv: python_env.yaml
python_version: 3.11.9
sklearn:
pickled_model: model.pkl
serialization_format: cloudpickle
sklearn_version: 1.5.2
signature:
inputs: '[{"type": "double", "name": "tenure_months"}, {"type": "string", "name": "plan"}]'
outputs: '[{"type": "long"}]'Because the format declares how to load the model and what it expects, an online or batch endpoint can serve it without a scoring script, validate requests against the signature, and build an environment with matching library versions.
Ways to register
A model can be registered from a job output, from an MLflow run or from local files. Registering from a job output is preferred, because it keeps lineage: the studio shows the job, and through it the code snapshot, environment and input data.
# From a job output with the CLI
az ml model create --name churn --version 7 --type mlflow_model \
--path azureml://jobs/JOB_NAME/outputs/model -g rg-ml-dev -w mlw-churn-dev# From a job output with the Python SDK
from azure.ai.ml.entities import Model
from azure.ai.ml.constants import AssetTypes
model = Model(path=f"azureml://jobs/{job_name}/outputs/model", name="churn",
type=AssetTypes.MLFLOW_MODEL, description="GBM churn model",
tags={"data_version": "3", "test_auc": "0.912"})
ml_client.models.create_or_update(model)
# From an MLflow run
import mlflow
mlflow.register_model(f"runs:/{run_id}/model", "churn")MLflow code can then load a registered model with a models:/churn/7 URI. Registering from local files with a path such as ./model works, but it uploads the files without any link to how they were produced.
Enabling no-code deployment
A team saves its scikit-learn model with joblib.dump to a job output and registers it as custom_model. Each deployment requires an engineer to write and maintain a scoring script and environment, and deployments have failed twice because the inference environment had a different scikit-learn version. The team wants deployment with minimal code and matching dependencies.
Change the training script to save the model with mlflow.sklearn.save_model (or log_model) with a signature, declare the job output as mlflow_model, and register it as an MLflow model. Online and batch endpoints can then deploy it without a scoring script, and the environment is built from the dependencies recorded with the model, so the scikit-learn version matches the one used in training.
Writing a shared scoring script template would reduce effort but not fix the version mismatch. Pinning versions in a separate inference environment by hand repeats the information the MLflow model already carries. Converting to ONNX could help portability but still needs scoring code for a custom model.
Why can an mlflow_model be deployed to an online endpoint without a scoring script or environment?
Show answer
The MLflow model format includes the flavor, the signature and the environment files, so Azure Machine Learning can generate the scoring logic and build the environment.
Exam Tips
Remember for the exam
- A registered model has a name, an integer version, a type, tags and lineage.
- Model types: mlflow_model, custom_model and triton_model.
- MLflow models carry flavors, a signature and environment files, enabling no-code deployment.
- Register from job outputs (azureml://jobs/.../outputs/...) to keep lineage.