---
title: Track and compare models using MLflow Logged Models | Databricks on AWS
source: https://docs.databricks.com/aws/en/mlflow/logged-model
ingestedAt: "2026-06-18T08:14:01.884Z"
---

MLflow Logged Models help you track a model's progress throughout its lifecycle. When you train a model, use `mlflow.<model-flavor>.log_model()` to create a `LoggedModel` that ties together all of its critical information using a unique ID. To leverage the power of `LoggedModels`, get started with [MLflow 3](https://docs.databricks.com/aws/en/mlflow/mlflow-3-install).

For GenAI applications, `LoggedModels` can be created to capture git commits or sets of parameters as dedicated objects that can then be linked to traces and metrics. In deep learning and classical ML, `LoggedModels` are produced from MLflow runs, which are existing concepts in MLflow and can be thought of as jobs that execute model code. Training runs produce models as outputs, and evaluation runs use existing models as input to produce metrics and other information you can use to assess the performance of a model.

The `LoggedModel` object persists throughout the model's lifecycle, across different environments, and contains links to artifacts such as metadata, metrics, parameters, and the code used to generate the model. Logged Model tracking lets you compare models against each other, find the most performant model, and track down information during debugging.

Logged Models can also be registered to the Unity Catalog model registry, making information about the model from all MLflow experiments and workspaces available in a single location. For more details, see [Model Registry improvements with MLflow 3](https://docs.databricks.com/aws/en/mlflow/model-registry-3).

![Model tracking flow for gen AI, deep learning, and traditional ML.](https://docs.databricks.com/aws/en/assets/images/mlflow-logged-model-tracking-f189bd7a8097d19ba5cd0f9799dd3617.png)

## Improved tracking for gen AI and deep learning models[​](#improved-tracking-for-gen-ai-and-deep-learning-models "Direct link to Improved tracking for gen AI and deep learning models")

Generative AI and deep learning workflows especially benefit from the granular tracking that Logged Models provides.

**Gen AI - unified evaluation and trace data:**

*   Gen AI models generate additional metrics during evaluation and deployment, such as reviewer feedback data and traces.
*   The `LoggedModel` entity allows you to query all the information generated by a model using a single interface.

**Deep learning - efficient checkpoint management:**

*   Deep learning training creates multiple checkpoints, which are snapshots of the model's state at a particular point during training.
*   MLflow creates a separate `LoggedModel` for each checkpoint, containing the model's metrics and performance data. This allows you to compare and evaluate checkpoints to identify the best-performing models efficiently.

## Create a Logged Model[​](#create-a-logged-model "Direct link to Create a Logged Model")

To create a Logged Model, use the same `log_model()` API as existing MLflow workloads. The following code snippets show how to create a Logged Model for gen AI, deep learning, and traditional ML workflows.

For complete, runnable notebook examples, see [Example notebooks](#example-notebooks).

*   Gen AI
*   Deep learning
*   Traditional ML

The following code snippet shows how to log a LangChain agent. Use the `log_model()` method for your flavor of agent.

Python

    # Log the chain with MLflow, specifying its parameters# As a new feature, the LoggedModel entity is linked to its name and paramsmodel_info = mlflow.langchain.log_model(  lc_model=chain,  name="basic_chain",  params={    "temperature": 0.1,    "max_tokens": 2000,    "prompt_template": str(prompt)  },  model_type="agent",  input_example={"messages": "What is MLflow?"},)# Inspect the LoggedModel and its propertieslogged_model = mlflow.get_logged_model(model_info.model_id)print(logged_model.model_id, logged_model.params)

Start an evaluation job and link the metrics to a Logged Model by providing the unique `model_id` for the `LoggedModel`:

Python

    # Start a run to represent the evaluation jobwith mlflow.start_run() as evaluation_run:  eval_dataset: mlflow.entities.Dataset = mlflow.data.from_pandas(    df=eval_df,    name="eval_dataset",  )  # Run the agent evaluation  result = mlflow.evaluate(    model=f"models:/{logged_model.model_id}",    data=eval_dataset,    model_type="databricks-agent"  )  # Log evaluation metrics and associate with agent  mlflow.log_metrics(    metrics=result.metrics,    dataset=eval_dataset,    # Specify the ID of the agent logged above    model_id=logged_model.model_id  )

## Example notebooks[​](#example-notebooks "Direct link to example-notebooks")

For example notebooks that illustrate the use of `LoggedModels`, see the following pages:

*   [MLflow 3 deep learning workflow](https://docs.databricks.com/aws/en/mlflow/mlflow3-dl-workflow)
*   [MLflow 3 traditional ML workflow](https://docs.databricks.com/aws/en/mlflow/mlflow3-ml-workflow)

## View models and track progress[​](#view-models-and-track-progress "Direct link to View models and track progress")

You can view your Logged Models in the workspace UI:

1.  Go to the **Experiments** tab in your workspace.
2.  Select an experiment. Then, select the **Models** tab.

This page contains all the Logged Models associated with the experiment, along with their metrics, parameters, and artifacts.

![Model tracking UI.](https://docs.databricks.com/aws/en/assets/images/mlflow-model-tracking-ui-719f2224cc10087b4371b8d4496c066a.png)

You can generate charts to track metrics across runs.

![Model tracking UI metric charts.](https://docs.databricks.com/aws/en/assets/images/mlflow-logged-models-chart-2d6c8580530c75753e7106ceb2646c6b.png)

## Search and filter Logged Models[​](#search-and-filter-logged-models "Direct link to Search and filter Logged Models")

From the **Models** tab, you can search and filter Logged Models based on their attributes, parameters, tags, and metrics.

![Model tracking UI search logged models.](https://docs.databricks.com/aws/en/assets/images/mlflow-logged-models-search-b02d1bd99679c20ae4e18173a9bc089d.png)

You can filter metrics based on dataset-specific performance, and only models with matching metric values on the given datasets are returned. If dataset filters are provided without any metric filters, models with _any_ metrics on those datasets are returned.

You can filter based on the following attributes:

*   `model_id`
*   `model_name`
*   `status`
*   `artifact_uri`
*   `creation_time` (numeric)
*   `last_updated_time` (numeric)

Use the following operators to search and filter string-like attributes, parameters, and tags:

*   `=`, `!=`, `IN`, `NOT IN`

Use the following comparison operators to search and filter numeric attributes and metrics,:

*   `=`, `!=`, `>`, `<`, `>=`, `<=`

### Search Logged Models programmatically[​](#search-logged-models-programmatically "Direct link to Search Logged Models programmatically")

You can search for Logged Models using the MLflow API:

Python

    ## Get a Logged Model using a model_idmlflow.get_logged_model(model_id = <my-model-id>)## Get all Logged Models that you have access tomlflow.search_logged_models()## Get all Logged Models with a specific namemlflow.search_logged_models(  filter_string = "model_name = <my-model-name>")## Get all Logged Models created within a certain time rangemlflow.search_logged_models(  filter_string = "creation_time >= <creation_time_start> AND creation_time <= <creation_time_end>")## Get all Logged Models with a specific param valuemlflow.search_logged_models(  filter_string = "params.<param_name> = <param_value_1>")## Get all Logged Models with specific tag valuesmlflow.search_logged_models(  filter_string = "tags.<tag_name> IN (<tag_value_1>, <tag_value_2>)")## Get all Logged Models greater than a specific metric value on a dataset, then order by that metric valuemlflow.search_logged_models(  filter_string = "metrics.<metric_name> >= <metric_value>",  datasets = [    {"dataset_name": <dataset_name>, "dataset_digest": <dataset_digest>}  ],  order_by = [    {"field_name": metrics.<metric_name>, "dataset_name": <dataset_name>,"dataset_digest": <dataset_digest>}  ])

For more information and additional search parameters see the [MLflow 3 API documentation](https://mlflow.org/docs/latest/api_reference/python_api/mlflow.html).

### Search runs by model inputs and outputs[​](#search-runs-by-model-inputs-and-outputs "Direct link to Search runs by model inputs and outputs")

You can search runs by model ID to return all runs that have the Logged Model as an input or output. For more information on the filter string syntax, see [filtering for runs](https://docs.databricks.com/aws/en/mlflow/runs#filter-runs).

![Model tracking UI search logged models by model ID.](https://docs.databricks.com/aws/en/assets/images/mlflow-runs-search-model-id-9cf01ed9934ab74f5883896a12d568cc.png)

You can search for runs using the MLflow API:

Python

    ## Get all Runs with a particular model as an input or output by model idmlflow.search_runs(filter_string = "models.model_id = <my-model-id>")

## Next steps[​](#next-steps "Direct link to Next steps")

To learn more about other new features of MLflow 3, see the following articles:

*   [Model Registry improvements with MLflow 3](https://docs.databricks.com/aws/en/mlflow/model-registry-3).
*   [MLflow 3 deployment jobs](https://docs.databricks.com/aws/en/mlflow/deployment-job).
