Overview

MLflow is an open-source platform developed to streamline the machine learning lifecycle, from experimentation to deployment. It was initially released by Databricks in 2018 and has since become a widely adopted tool for MLOps. The platform is designed to address common challenges in ML development, such as experiment reproducibility, model versioning, and deployment standardization (MLflow Documentation).

The core components of MLflow include Tracking, Projects, Models, Model Registry, and Recipes. MLflow Tracking enables users to log parameters, metrics, and artifacts from their ML experiments, facilitating comparison and analysis of different runs. MLflow Projects provide a standard format for packaging ML code, making it easier to reproduce runs and share code across teams. MLflow Models offer a convention for packaging ML models in various formats, which simplifies deployment to diverse serving platforms. The MLflow Model Registry provides a centralized hub for managing the lifecycle of ML models, including versioning, stage transitions, and annotations. MLflow Recipes, introduced more recently, offer opinionated templates for common ML tasks, aiming to accelerate development and enforce best practices.

MLflow is primarily suited for developers and data scientists who need to manage the complexity of machine learning workflows. It integrates with a wide array of ML libraries and frameworks, including TensorFlow, PyTorch, scikit-learn, and Apache Spark MLlib. Users can deploy MLflow either as a self-hosted solution, leveraging its open-source components, or through managed services offered by cloud providers, most notably within the Databricks Lakehouse Platform. The platform's flexibility allows it to be used for various scales of projects, from individual research to enterprise-level ML operations.

While MLflow provides comprehensive tools for lifecycle management, its open-source nature means that self-hosting requires users to manage their own infrastructure for the tracking server and artifact store. Commercial offerings, such as those from Databricks, provide managed versions of MLflow, abstracting away infrastructure concerns and adding enterprise-grade features like enhanced security and collaboration tools (Databricks Pricing). The platform's commitment to open standards and its modular design allow it to be integrated into existing ML ecosystems, making it a versatile choice for organizations looking to standardize their ML workflows.

Key features

  • MLflow Tracking: Records and queries experiment parameters, metrics, code versions, and output artifacts. It provides a UI for visualizing and comparing runs.
  • MLflow Projects: Packages ML code in a reusable and reproducible format, defining dependencies and entry points for execution.
  • MLflow Models: Provides a standard format for packaging ML models, allowing them to be deployed to various serving platforms (e.g., Docker, Apache Spark, Azure ML, AWS SageMaker).
  • MLflow Model Registry: A centralized repository for managing the full lifecycle of ML models, including versioning, stage transitions (e.g., Staging, Production), and annotations.
  • MLflow Recipes: Offers templated, opinionated workflows for common ML tasks, such as classification and regression, to accelerate development and promote best practices.
  • API and SDKs: Provides Python, Java, R, and REST APIs for programmatic interaction with all MLflow components.

Pricing

MLflow is available as an open-source project, allowing for free self-hosting. Commercial offerings are primarily through the Databricks Lakehouse Platform, which integrates MLflow as a managed service.

Plan Description Pricing Model (As of 2026-05-07)
Open-source MLflow Self-hosted version of MLflow with all core features. Free (user responsible for infrastructure costs)
Databricks Community Edition Limited free tier of the Databricks platform, including some MLflow functionality. Free with resource limits (Databricks Pricing)
Databricks Standard Plan Paid tier of the Databricks platform, offering managed MLflow with enhanced features and support. Consumption-based (DBUs), starts at $0.40/DBU (AWS region dependent) (Databricks Pricing)
Databricks Premium Plan Enterprise-grade Databricks platform, including advanced MLflow features, security, and compliance. Consumption-based (DBUs), starts at $0.55/DBU (AWS region dependent) (Databricks Pricing)

Common integrations

  • Machine Learning Frameworks: Integrates with TensorFlow, PyTorch, scikit-learn, XGBoost, LightGBM, Keras, and Apache Spark MLlib for logging experiments and models (MLflow LLM Guide).
  • Cloud Platforms: Supports artifact storage and model deployment on AWS S3, Azure Blob Storage, Google Cloud Storage, AWS SageMaker, Azure ML, and Google Cloud Vertex AI (MLflow LLM Guide).
  • Databricks: Tightly integrated into the Databricks Lakehouse Platform for managed MLflow services, including experiment tracking, model registry, and model serving.
  • Data Version Control (DVC): Can be used alongside DVC for managing data and model versioning, complementing MLflow's experiment tracking capabilities (DVC MLflow Integration).
  • Orchestration Tools: Compatible with workflow orchestration tools like Apache Airflow and Kubeflow for automating ML pipelines.

Alternatives

  • Weights & Biases: A proprietary platform for experiment tracking, visualization, and collaboration, offering a managed service with advanced features.
  • Comet ML: An MLOps platform for experiment tracking, model production monitoring, and model management, available as a managed service.
  • DVC: An open-source tool for data version control, complementing MLflow by focusing on managing datasets and model files.

Getting started

This example demonstrates how to log a simple scikit-learn model and its metrics using MLflow Tracking.

import mlflow
import mlflow.sklearn
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_diabetes
import numpy as np

# Enable autologging for scikit-learn
mlflow.sklearn.autolog()

def eval_metrics(actual, pred):
    rmse = np.sqrt(mean_squared_error(actual, pred))
    mae = mean_absolute_error(actual, pred)
    r2 = r2_score(actual, pred)
    return rmse, mae, r2

if __name__ == "__main__":
    # Load the diabetes dataset
    diabetes = load_diabetes()
    X = diabetes.data
    y = diabetes.target

    # Split the data into training and test sets
    X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

    # Define model parameters
    n_estimators = 100
    max_depth = 6

    with mlflow.start_run():
        # Train the RandomForestRegressor model
        rf_model = RandomForestRegressor(n_estimators=n_estimators, max_depth=max_depth, random_state=42)
        rf_model.fit(X_train, y_train)

        # Make predictions on the test set
        predictions = rf_model.predict(X_test)

        # Evaluate model performance
        rmse, mae, r2 = eval_metrics(y_test, predictions)

        # Log parameters and metrics explicitly (autologging also captures some)
        mlflow.log_param("n_estimators", n_estimators)
        mlflow.log_param("max_depth", max_depth)
        mlflow.log_metric("rmse", rmse)
        mlflow.log_metric("mae", mae)
        mlflow.log_metric("r2", r2)

        # Log the model
        mlflow.sklearn.log_model(rf_model, "random_forest_model")

        print(f"Logged run: {mlflow.active_run().info.run_id}")
        print(f"RMSE: {rmse}, MAE: {mae}, R2: {r2}")

    # To view the MLflow UI, run 'mlflow ui' in your terminal in the same directory.