Utilities for MLflow
Project description
title: README author: Jan-Michael Rye
Synopsis
Provides several command-line utilities for working with MLflow, such as merging experiments from one backend to another and fixing artifact paths after moving a local mlruns directory. Versions prior to 2026 worked directly on meta.yaml file in local mlruns directories. Starting with version 2026.1, the commands have been updated to use mlflow.client.MlflowClient which uses the MLflow REST API as the previous File Store has been deprecated. For migration details, see Migrate from File Store to Database.
Links
GitLab
Other Repositories
Installation
Install the MLflow Extra package from the Python Package Index using any standard Python package manager, e.g.
# Uncomment the following 2 lines to create and activate a virtual environment.
# python -m venv venv
# source venv/bin/activate
pip3 install --upgrade mlflow-extra
It can also be installed from source with any standard Python package manager that supports pyproject.toml files. For example, to install it with pip, either locally or in a virtual environment, run the following commands:
git clone https://gitlab.inria.fr/jrye/mlflow-extra
cd mlflow-extra
# Uncomment the following 2 lines to create and activate a virtual environment.
# python -m venv venv
# source venv/bin/activate
pip install --upgrade .
Commands
These commands provide complimentary functionality for the mlflow command-line interface.
mlflow-filter_runs
A command-line tool to filter runs in an experiment using either metric threshold values or the total number of runs to keep.
usage: mlflow-filter_runs [-h] [-a] [-c] [-l] [-m METRICS [METRICS ...]]
[-n NUMBER] [-t THRESHOLDS [THRESHOLDS ...]]
experiment_id [experiment_id ...]
Delete runs from experiment based on thresholds.
positional arguments:
experiment_id The MLflow experiment ID (see mlflow experiments
list).
options:
-h, --help show this help message and exit
-a, --ascending Keep the first n runs in ascending order instead of
descending.
-c, --confirm Confirm the deletion. Without this only a dryrun is
performed.
-l, --list List metrics and their statistics.
-m, --metrics METRICS [METRICS ...]
The metrics by which to filter runs.
-n, --number NUMBER The number of runs to keep.
-t, --thresholds THRESHOLDS [THRESHOLDS ...]
The threshold values for the selected metrics. In
descending order the threshold values are a lower
limit. In ascending order they are an upper limit.
mlflow-fix_artifacts
A command-line tool for fixing artifact URIs in runs when the artifact directories have been moved. Previously this worked on local data in the deprecated File Store backend (i.e. the mlruns directory and the meta.yaml files therein). The current version only works under the following conditions:
- The MLflow backend is a local SQLite database (e.g.
mlflow.db). - The artifacts are located in a directory following the
mlrunsstructure, i.e. in subdirectories of the format<experiment ID>/<run ID>/artifacts.
mlflow-merge
A command-line tool to merge data from one backend to another. Currently this only supports the following:
- experiments
- runs (parameters, metrics, artifacts)
- models (versions and aliases are not yet copied from the source)
Support for models and datasets will be added later.
usage: mlflow-merge [-h] [--tua TUA] [--rua RUA] [--wua WUA] [--tub TUB]
[--rub RUB] [--wub WUB]
Copy experiments and runs from one backend to another. This is a work in
progress and should be used with caution.
options:
-h, --help show this help message and exit
--tua TUA Tracking URI for the source backend.
--rua RUA Registry URI for the source backend.
--wua WUA Workspace store URI for the source backend.
--tub TUB Tracking URI for the destination backend.
--rub RUB Registry URI for the destination backend.
--wub WUB Workspace store URI for the destination backend.
Alternatives
- mlflow-export-import - I was not able to test this due to a conflicting dependency error when I tried to install it in a clean virtual environment, but it is often recommended in MLflow discussions that I have found online.
Deprecated Commands
The following commands have been removed after the deprecation of the File Store backend.
- mlflow-fix_experiment_ids
Python Module
See the online documentation for details.
Utility Scripts
Some utility scripts are provided for convenience.
install.sh
install.sh will optionally set up a virtual environment and then install MLflow Extra from source with pip. See install.sh -h for details.
install_and_run.sh
install_and_run.sh will run any of the commands in the MLflow Extra package after ensuring that they are available by installing the package from source if necessary. It is useful for quickly fixing artifacts paths when transferring mlruns directories. See install_and_run.sh -h for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlflow_extra-2026.1.tar.gz.
File metadata
- Download URL: mlflow_extra-2026.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ade4c11c0d0f32e5aa0e3b9f29af5aac926b58e984b53b22ad877ef8a2d82d84
|
|
| MD5 |
152f4a96439e0ebe3c7c4c0b35087248
|
|
| BLAKE2b-256 |
67637251d35701d568d7021861262f372f436387c0627b21fbfffeda2915985b
|
File details
Details for the file mlflow_extra-2026.1-py3-none-any.whl.
File metadata
- Download URL: mlflow_extra-2026.1-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
419e0688c5e68c9fdfbf51561470846359faa2f5fa5701e004fa937d9e8eb0e5
|
|
| MD5 |
1a4ef2f2cb65ad5a55297576ad9f299e
|
|
| BLAKE2b-256 |
a94a59b43422b8cec5d7c71776b21bec63c1cc51d09f5f1e904f755d4a7c3e34
|