What you will be able to do
- Point the MLflow client at the Unity Catalog registry and name a model with its three-level name
- Identify the Unity Catalog privileges needed to create a model, add a version, load it, and set an alias
- Register a chain in one step with registered_model_name, or later with mlflow.register_model() from a run or LoggedModel URI
- Explain what an MLflow 3 LoggedModel is and what it carries into the Unity Catalog model version
- Use a model version alias such as Champion to mark the deployed version, since Unity Catalog has no stages
Key concept
Three-level model name in Unity Catalog — A model registered in Unity Catalog belongs to a schema in a catalog, the same as a table does. MLflow APIs address it as catalog.schema.model. Each registration adds a numbered version under that name, and Unity Catalog privileges on the catalog, schema and model decide who can create, load or promote those versions.
1.Pointing MLflow at the Unity Catalog registry
Registering a RAG chain or agent in Unity Catalog makes it a governed object. It gets the same access control, auditing, lineage and cross-workspace discovery that tables get. Databricks runs a hosted MLflow Model Registry inside Unity Catalog, and the open-source MLflow Python client works with it, so you register with ordinary MLflow calls. You only have to send them to the right registry.
The registry URI decides where a model is registered. In MLflow 3 the default registry URI is databricks-uc, so registration goes to Unity Catalog unless you change it. The same is true on Databricks Runtime 13.3 LTS and above when the workspace's default catalog is in Unity Catalog. In other workspaces the client still writes to the legacy workspace model registry. There, you set the registry URI explicitly at the top of the notebook:
import mlflow
mlflow.set_registry_uri("databricks-uc")Setting the URI to databricks instead, by mlflow.set_registry_uri("databricks") or the MLFLOW_REGISTRY_URI environment variable, deliberately goes back to the legacy workspace registry. The registry is chosen only by the registry URI. Renaming an experiment or choosing an artifact location changes nothing about where a model is registered.
The model name must be the full three-level name. For example, prod.rag_apps.support_bot means catalog prod, schema rag_apps, model support_bot. A bare support_bot works only when the workspace's default catalog is in Unity Catalog, because then the catalog and schema are filled in from the defaults. If the default catalog is not in Unity Catalog, the short name fails, so the three-level name is the one to use everywhere. The name argument of log_model() (formerly artifact_path) is a different thing: it labels the model's artifacts, and it does not name a registered model.
Compute matters too. The cluster must have access to Unity Catalog, which for ML workloads means Dedicated access mode (formerly single user). On Databricks Runtime 15.4 LTS ML and above, dedicated group access mode also works.
Checkpoint 1 of 9· Fill the gap
Your workspace's default catalog is not in Unity Catalog, so MLflow still registers models in the legacy workspace registry. Which value completes this notebook cell so that models are registered in Unity Catalog?
import mlflow
mlflow.set_registry_uri(" ? ")Only the registry URI decides where a model is registered, and databricks-uc sends registration to Unity Catalog. Setting it to databricks deliberately goes back to the legacy workspace model registry.
Checkpoint 2 of 9· Check yourself
A workspace has Unity Catalog enabled, but its default catalog is hive_metastore. An engineer uses MLflow 3 and calls log_model(..., registered_model_name="support_bot") to register a RAG chain in schema rag_apps of catalog prod. What should they change?
The catalog and schema are filled in from the defaults only when the workspace's default catalog is in Unity Catalog. Here it is not, so the full catalog.schema.model name is required. The log_model name argument only labels the model's artifacts.
“its default catalog is not configured to be in Unity Catalog, you will need to specify the full three-level name.”Source: docs.databricks.com
Checkpoint 3 of 9· Exam question
A generative AI engineer has trained a RAG chain and wants to register it directly to Unity Catalog as part of the mlflow.pyfunc.log_model() call, targeting the catalog prod, schema rag_apps, and model name support_bot. Which configuration correctly registers the model to Unity Catalog under this three-level namespace?
Correct answer: A — Set mlflow.set_registry_uri("databricks-uc") and pass registered_model_name="prod.rag_apps.support_bot" to log_model()
- A. Correct:
mlflow.set_registry_uri("databricks-uc")points the MLflow client at the Unity Catalog model registry, and supplying the full three-level name asregistered_model_nameregisters the version under that catalog and schema in one call. - B. Incorrect: the
"databricks"registry URI selects the Workspace Model Registry, which does not use catalog.schema.model names. The version is not registered in Unity Catalog underprod.rag_apps, even with the three-level name passed. - C. Incorrect:
artifact_pathnames the storage path for model artifacts within the run, not the registry destination, so putting the catalog.schema.model string there does not create a Unity Catalog registration. - D. Incorrect:
set_experimentonly chooses the experiment that run history is logged to.artifact_pathis just the folder for the model files inside the run. With no registry URI and noregistered_model_name,log_model()registers nothing.
2.Privileges for registering and using models
Unity Catalog checks privileges at every level of the namespace. A grant on the schema does nothing unless the principal can also reach the catalog and the schema. That is why USE CATALOG and USE SCHEMA come with every model action. On top of those, each action needs its own privilege:
| Operation | Privilege on top of USE CATALOG + USE SCHEMA |
|---|---|
| Create a new registered model | CREATE MODEL on the schema |
| Create a new version of an existing model | Owner of the registered model, or CREATE MODEL VERSION on it |
| Load or deploy a model | EXECUTE on the registered model |
| Set an alias on a registered model | Owner of the registered model |
Grants go through Catalog Explorer or SQL. For example, GRANT CREATE MODEL ON SCHEMA <schema-name> TO <principal> gives the create privilege, and a separate grant of USE CATALOG and USE SCHEMA has to go with it. The same rules apply to a job that trains or deploys on a schedule: the principal running the workflow needs them, not only the person who wrote it. The workspace must also be attached to a metastore that supports privilege inheritance, which is true of every metastore created after August 25, 2022.
Checkpoint 4 of 9· Check yourself
A nightly batch-inference job runs as a service principal and loads models:/prod.rag_apps.support_bot@Champion. The service principal has no grants yet. What is the minimum it needs?
Loading or deploying a model needs EXECUTE on the registered model, along with USE CATALOG and USE SCHEMA on the catalog and schema that contain it. For a scheduled job, the principal running the workflow must hold these grants. It is not enough for the notebook's author to have them. Ownership is needed only to set an alias, and CREATE MODEL VERSION only to add versions.
“Permissions required: EXECUTE privilege on the registered model, plus USE SCHEMA and USE CATALOG privileges on the schema and catalog containing the model.”Source: docs.databricks.com
Checkpoint 5 of 9· Exam question
An engineer runs GRANT CREATE MODEL ON SCHEMA prod.rag_apps TO data_scientists but a data scientist in that group still cannot register the new model prod.rag_apps.support_bot, receiving a permissions error. Which additional privilege is most likely missing?
Correct answer: A — USE CATALOG on prod and USE SCHEMA on prod.rag_apps for the group
- A. Correct: registering a model in Unity Catalog requires traversing the namespace, so the principal also needs
USE CATALOGon the catalog andUSE SCHEMAon the schema in addition toCREATE MODEL; without these, access to the containing objects is blocked even with create rights. - B. Incorrect:
EXECUTEallows running existing functions and models, andCREATE FUNCTIONallows creating functions. Neither grants theUSE CATALOGandUSE SCHEMAaccess needed to reach the schema, so registeringsupport_botstill fails. - C. Incorrect:
SELECTallows reading table data, andCREATE TABLEallows creating tables. A model is a separate securable type, and neither privilege gives the group access to the catalog or schema, so registeringsupport_botstill fails. - D. Incorrect:
CREATE SCHEMAonly allows creating new schemas, and the group already holdsCREATE MODELonprod.rag_apps, so repeating it changes nothing. Neither addsUSE CATALOGorUSE SCHEMA, which are the grants the group lacks.
3.Two ways to register: at log time or afterwards
**Passing registered_model_name to log_model() logs and registers in one step.** The registration goes to Unity Catalog, so the value must be the three-level name. If the registered model doesn't exist yet, it is created, and each later call adds a new version. Use this path when every logged model should become a version, for example in a scheduled job that rebuilds a chain.
with mlflow.start_run():
# Train a sklearn model on the iris dataset
X, y = datasets.load_iris(return_X_y=True, as_frame=True)
clf = RandomForestClassifier(max_depth=7)
clf.fit(X, y)
# Take the first row of the training dataset as the model input example.
input_example = X.iloc[[0]]
# Log the model and register it as a new version in UC.
mlflow.sklearn.log_model(
sk_model=clf,
name="model",
# The signature is automatically inferred from the input example and its predicted output.
input_example=input_example,
# Use three-level name to register model in Unity Catalog.
registered_model_name="prod.ml_team.iris_model",
)**mlflow.register_model() registers a model that is already logged.** It takes the model's URI and the three-level name. Suppose a run produced a good chain yesterday at runs:/<run_id>/model. One call makes that exact artifact a version, with no retraining, no re-logging and no copying of files into catalog storage by hand. Use this path when you log many candidates and register only the one you pick.
mlflow.register_model(
"runs:/<run_id>/model", "prod.ml_team.iris_model"
)There is also a third, manual route. Open the experiment run page, click Register model, choose Unity Catalog and a destination model, then click Register. Registration can take a while, so refresh the destination model in Catalog Explorer to see when the version appears.
Whichever path you use, Unity Catalog accepts a new version only if the model has a signature. The model signature and input example define the inputs and outputs a model expects. The easy way to get a signature is to pass input_example to log_model() (MLflow 2.5.0 and above), as the code above does. A chain logged without a signature or an input example gets no version, however good it is.
Checkpoint 6 of 9· Fill the gap
This MLflow 3 cell should log the classifier and also create a new version of prod.ml_team.iris_model in Unity Catalog in the same call. Which keyword argument goes in the blank?
with mlflow.start_run():
# Train a sklearn model on the iris dataset
X, y = datasets.load_iris(return_X_y=True, as_frame=True)
clf = RandomForestClassifier(max_depth=7)
clf.fit(X, y)
# Take the first row of the training dataset as the model input example.
input_example = X.iloc[[0]]
# Log the model and register it as a new version in UC.
mlflow.sklearn.log_model(
sk_model=clf,
name="model",
# The signature is automatically inferred from the input example and its predicted output.
input_example=input_example,
# Use three-level name to register model in Unity Catalog.
? ="prod.ml_team.iris_model",
)Passing registered_model_name to log_model() logs the model and registers it in one step. It creates the registered model if it doesn't exist yet and adds a new version on each call. The name argument (formerly artifact_path) only labels the model's artifacts and does not name a registered model.
Source: docs.databricks.comCheckpoint 7 of 9· Exam question
A team already has a logged MLflow run containing a trained chain at runs:/8f2c1a.../model, and they now want to register that existing run as version 1 of a Unity Catalog model named analytics.chatbots.faq_agent, without re-running training. Which approach accomplishes this?
Correct answer: A — Use mlflow.register_model on runs:/8f2c1a.../model with the name analytics.chatbots.faq_agent and the registry URI set to databricks-uc.
- A. Correct:
mlflow.register_modelaccepts the model URI of an existing run plus a target name. With the registry URI pointing at Unity Catalog, it creates a new model version from that run's logged artifacts, so nothing is retrained or re-logged. - B. Incorrect:
log_modelcreates a brand-new run and registers that run's artifacts. Rebuilding the chain and logging it again leaves the existing run unregistered and produces a different artifact, and the team wants that existing run registered. - C. Incorrect: copying files into a schema's managed storage does not call the registry. It creates no registered model or model version in Unity Catalog, and it records no link back to the source run.
- D. Incorrect:
set_experimentonly selects or creates an experiment for tracking, and reopening a run withstart_rundoes not register its model. Experiments and registered models are separate entities, so no model version is created.
Sources1
4.The MLflow 3 LoggedModel and registering a chain from it
In MLflow 3 a model is a first-class object, not a file inside a run. Each log_model() call creates a LoggedModel. It keeps links to the model's metadata, metrics, parameters and generating code, across runs and environments. Because the model stands on its own, logging no longer needs an active run, and the model's artifacts are stored under models/<model_id>/artifacts instead of under the run.
| Aspect | MLflow 2.x | MLflow 3 |
|---|---|---|
| Argument that labels the model in log_model() | artifact_path (now deprecated) | name |
| Model URI returned by log_model() | runs:/<run_id>/<artifact_path> | models:/<model_id> |
| Active run required to log | Yes | No |
| Where model artifacts are stored | Under the run's artifacts | Under the model's own artifact path |
| Default registry URI | Workspace registry unless configured | databricks-uc |
A GenAI chain written as a custom Python model is logged through the pyfunc flavor. With MLflow 3 you give it a name instead of an artifact_path:
mlflow.pyfunc.log_model(
name="model",
python_model=python_model,
...
)You register it from the LoggedModel's URI. mlflow.last_logged_model() returns the most recent one, and its model_uri has the form models:/<model_id>. Pass that URI to register_model() with the three-level name. The new version keeps all the parameters and metrics recorded on the LoggedModel:
logged_model = mlflow.last_logged_model()
mlflow.register_model(logged_model.model_uri, "prod.ml_team.iris_model")The model version page in Catalog Explorer shows everything the LoggedModel collected, from every experiment and workspace that touched it. For a GenAI application that includes traces: traces from development and evaluation sit next to traces from the serving endpoint, all tied to the same Model ID. A reviewer approving a version for deployment can read all of this on one page. There is one exception: mlflow.spark.log_model still works in MLflow 3 but does not create a LoggedModel, so Spark models keep the 2.x run-artifact behaviour.
Checkpoint 8 of 9· Fill the gap
An engineer logged a pyfunc RAG chain with MLflow 3 without starting a run. They now want that LoggedModel to become a version of prod.ml_team.iris_model in Unity Catalog. Which attribute completes the call?
logged_model = mlflow.last_logged_model()
mlflow.register_model(logged_model. ? , "prod.ml_team.iris_model")register_model() takes a model URI and the three-level name. In MLflow 3, the LoggedModel's model_uri has the form models:/<model_id>, and the new version keeps the parameters and metrics recorded on the LoggedModel. A bare model_id is not a URI. A run_id does not point to the model, because no run was needed to log it.
Source: docs.databricks.com5.Marking the deployed version with aliases
Unity Catalog has no model stages. The legacy registry let you move versions between Staging and Production, but Unity Catalog does not support stages. Two separate tools replace them. The catalog and schema say which environment a model belongs to. An alias says which version is deployed.
Keep those two ideas apart. A version registered in prod.ml_team is under prod's governance rules, for example a rule that only admins may delete from the prod catalog. That does not mean it is serving production traffic. Deployment status belongs to the alias.
An alias is a mutable, named pointer to one version of a registered model. Give Champion to the version in production, and have workloads load models:/prod.ml_team.iris_model@Champion instead of a version number. To promote a new version, move the alias to it. Batch jobs that load by alias pick up the new version on their next run without any code change. Deployment workflows can also look up the version behind the alias and point a serving endpoint at it.
from mlflow import MlflowClient
client = MlflowClient()
# create "Champion" alias for version 1 of model "prod.ml_team.iris_model"
client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 1)
# reassign the "Champion" alias to version 2
client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 2)
# get a model version by alias
client.get_model_version_by_alias("prod.ml_team.iris_model", "Champion")
# delete the alias
client.delete_registered_model_alias("prod.ml_team.iris_model", "Champion")Moving an alias needs more than registering a version. Only the owner of the registered model can set or reassign an alias, and the owner also needs USE CATALOG and USE SCHEMA. A data scientist with CREATE MODEL VERSION can add version 7 but cannot make it Champion. That split is usually the point: whoever trains a version is not necessarily the one who decides what serves. Aliases can also be managed in Catalog Explorer.
Checkpoint 9 of 9· Fill the gap
Version 2 of prod.ml_team.iris_model has passed review. Batch jobs load models:/prod.ml_team.iris_model@Champion, and version 2 should now replace version 1 as the production model. Which client method goes in the blank?
from mlflow import MlflowClient
client = MlflowClient()
# create "Champion" alias for version 1 of model "prod.ml_team.iris_model"
client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 1)
# reassign the "Champion" alias to version 2
client. ? ("prod.ml_team.iris_model", "Champion", 2)
# get a model version by alias
client.get_model_version_by_alias("prod.ml_team.iris_model", "Champion")
# delete the alias
client.delete_registered_model_alias("prod.ml_team.iris_model", "Champion")Unity Catalog has no model stages, so you promote a version by moving the Champion alias to it. Calling set_registered_model_alias again with version 2 does that, and jobs that load @Champion pick up version 2 on their next run. Stage transitions belong to the legacy workspace registry.
Source: docs.databricks.comSources
(5)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“The default registry URI in MLflow 3 is databricks-uc, meaning the MLflow Model Registry in Unity Catalog will be used.”
↩︎ Pointing MLflow at the Unity Catalog registry“For other workspaces, the MLflow Python client creates models in the Databricks workspace model registry.”
↩︎ Pointing MLflow at the Unity Catalog registry“including centralized access control, auditing, lineage, and model discovery across workspaces”
↩︎ Pointing MLflow at the Unity Catalog registry“For ML workloads, this means that the compute's access mode must be Dedicated (formerly single user).”
↩︎ Pointing MLflow at the Unity Catalog registry“you need the CREATE MODEL and USE SCHEMA privileges on the enclosing schema, and USE CATALOG privilege on the enclosing catalog.”
↩︎ Privileges for registering and using models“This setting might also be useful in other cases if you run into authorization issues when trying to register a model.”
↩︎ Privileges for registering and using models“using registered_model_name in the log_model() call registers the model to Unity Catalog, so you must provide the full three-level name of the model”
↩︎ Two ways to register: at log time or afterwards“To register a model, use MLflow Client API register_model() method.”
↩︎ Two ways to register: at log time or afterwards“New ML model versions in UC must have a model signature.”
↩︎ Two ways to register: at log time or afterwards“From the experiment run page, click Register model in the upper-right corner of the UI.”
↩︎ Two ways to register: at log time or afterwards“Stages are not supported for models in Unity Catalog.”
↩︎ Marking the deployed version with aliases“Model aliases allow you to assign a mutable, named reference to a particular version of a registered model.”
↩︎ Marking the deployed version with aliases“If the “Champion” version is updated to reference a new model version, the batch inference workload automatically picks it up on its next execution.”
↩︎ Marking the deployed version with aliases“pass the three-level name of the model to MLflow APIs, in the form <catalog>.<schema>.<model>.”
↩︎ Key concept“Stages are not supported for models in Unity Catalog.”
↩︎ Exam trap 1“Using the prod catalog doesn't necessarily mean that the model version serves production traffic.”
↩︎ Exam trap 2“you need the CREATE MODEL and USE SCHEMA privileges on the enclosing schema, and USE CATALOG privilege on the enclosing catalog.”
↩︎ Exam trap 3“or have the CREATE MODEL VERSION privilege on it plus USE SCHEMA and USE CATALOG privileges on the schema and catalog containing the model.”
↩︎ Prediction“Permissions required: EXECUTE privilege on the registered model, plus USE SCHEMA and USE CATALOG privileges on the schema and catalog containing the model.”
↩︎ Checkpoint - 2.
“its default catalog is not configured to be in Unity Catalog, you will need to specify the full three-level name.”
↩︎ Pointing MLflow at the Unity Catalog registry“Set the environment variable MLFLOW_REGISTRY_URI.”
↩︎ Pointing MLflow at the Unity Catalog registry“MLflow no longer requires a run to be active when logging a model, because models have become first-class citizens in MLflow 3.”
↩︎ The MLflow 3 LoggedModel and registering a chain from it“This model URI is of the format models:/<model_id> (rather than runs:/<run_id>/<artifact_path> as in MLflow 2.x)”
↩︎ The MLflow 3 LoggedModel and registering a chain from it“it does not use the new LoggedModel concept.”
↩︎ The MLflow 3 LoggedModel and registering a chain from it“its default catalog is not configured to be in Unity Catalog, you will need to specify the full three-level name.”
↩︎ Exam trap 4 - 3.https://docs.databricks.com/aws/en/machine-learning/manage-model-lifecycle/upgrade-workflowsOfficial docs
“To load or deploy a model, the principal must have the EXECUTE privilege on the registered model.”
↩︎ Privileges for registering and using models“To set an alias on a registered model, the principal must be the owner of the registered model.”
↩︎ Marking the deployed version with aliases - 4.https://docs.databricks.com/aws/en/mlflowOfficial docs
“When you log a model using log_model(), a LoggedModel is created that persists throughout the model's lifecycle, across different environments and runs”
↩︎ The MLflow 3 LoggedModel and registering a chain from it - 5.
“all of its metrics and parameters are available in the model registry UI and from the API.”
↩︎ The MLflow 3 LoggedModel and registering a chain from it“you can see traces associated with the Model ID from development and evaluation (mlflow.evaluate() runs) alongside traces from online serving in endpoints.”
↩︎ The MLflow 3 LoggedModel and registering a chain from it