Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

MongoDB Backend for MLflow

[WARNING] This project is under active development and has not reached a stable release. APIs, storage formats, and configuration may change at any time without notice. It is not intended for production use. See LICENSE for the full disclaimer of warranties.

An MLflow plugin that stores tracking data (experiments, runs, traces, and logged models) and model registry data (registered models, versions, aliases, tags, and prompts) in MongoDB. The tracking store and registry store are configured independently, so either one can use MongoDB while the other uses another MLflow backend.

Installation

Python 3.10 or newer, MLflow 3.5 or newer within the 3.x series, and MongoDB 8.0 or newer are required.

python -m pip install "mlflow-mongodb>=0.1.0b2"

Running MLflow

The following configuration stores both tracking data and registry data in MongoDB:

export TRACKING_STORE_URI="mongodb://localhost:27017/mlflow"
export REGISTRY_STORE_URI="mongodb://localhost:27017/mlflow"
export MLFLOW_BIND_HOST="127.0.0.1"
export MLFLOW_BIND_PORT="5000"

mlflow server \
  --backend-store-uri "${TRACKING_STORE_URI}" \
  --registry-store-uri "${REGISTRY_STORE_URI}" \
  --host "${MLFLOW_BIND_HOST}" \
  --port "${MLFLOW_BIND_PORT}"

Open http://127.0.0.1:5000 to use the MLflow UI. Clients can connect to the server with:

export MLFLOW_TRACKING_URI="http://127.0.0.1:5000"

The MongoDB URI must include the database name; mlflow is the database name in the example above. Authentication, replica-set, TLS, and other connection options can be provided using standard MongoDB URI syntax. For example:

mongodb://username:password@mongo.example.com:27017/mlflow?authSource=admin

When using the MongoDB tracking backend, MLflow 3.5 clients upload full trace payloads to MLflow's existing artifact storage. Configure a reachable experiment artifact location, such as S3 or an MLflow artifact proxy. The MongoDB store returns the trace artifact URI; it does not implement its own artifact provider or upload the payload itself.

On MLflow 3.5 servers, trace retrieval uses artifacts while spans are also persisted in MongoDB. On MLflow 3.6 and newer servers, modern clients use MongoDB-backed trace retrieval. A 3.5 client cannot read a trace written only to MongoDB by a modern client unless an artifact payload also exists. Cross-version reads of that kind are not guaranteed.

Aggregated trace metric queries require MLflow 3.9 or newer; available metrics and dimensions depend on the installed MLflow version. Older versions preserve native MLflow spans without newer OTel translations, and derive cost summaries only when MLflow provides its cost aggregator. These limitations do not disable run metric logging.

Documentation

New to MLflow? Start with the MLflow Tracking Quickstart. The following guides provide additional context for using this plugin:

Versioning

This project follows Semantic Versioning (MAJOR.MINOR.PATCH), same as MLflow itself. It's currently on major version 0, meaning the API isn't yet stable and may change between releases. main always carries a .devN version (e.g. 0.1.0.dev0) to signal it's unreleased and ahead of the latest published version.

Contributor setup

For development, clone the repository and install it in editable mode:

git clone https://github.com/mongodb-developer/mlflow-mongodb.git
cd mlflow-mongodb

python -m venv .venv
source .venv/bin/activate
python -m pip install -e .

If you downloaded a source archive instead, extract it and run the venv and pip commands from the extracted repository root. The final . in pip install -e . means “install the project in the current directory,” and -e keeps the installation linked to that source checkout.

Install the development dependencies and Git hooks with:

python -m pip install -e ".[dev]"
pre-commit install --install-hooks

Run all formatting, linting, and repository checks with:

pre-commit run --all-files

Functional tests

The functional tests use a real MongoDB 8.0 or newer server. Install the project in editable mode with its development dependencies before running them:

python -m pip install -e ".[dev]"

Set MONGODB_URI to a dedicated test database; for example:

export MONGODB_URI="mongodb://localhost:27017/mlflow_functional_test"
python -m pytest tests/functional

Authentication, replica-set, TLS, and other standard MongoDB URI options can be included in MONGODB_URI. Use a MongoDB 8.0 replica set when running tests that exercise MongoDB transactions.

The functional suite deletes documents from its application collections after every test so their indexes can be reused. At the end of the test session, it drops the database selected by MONGODB_URI. Never point MONGODB_URI at a database containing data that must be preserved.

Metadata

Release files for mlflow-mongodb 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mlflow-mongodb 0.1.0b2
File Size Uploaded Provenance Actions
mlflow_mongodb-0.1.0b2.tar.gz 74.7 kB With provenance Details for mlflow_mongodb-0.1.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mlflow-mongodb 0.1.0b2
File Interpreter ABI Platform Actions
mlflow_mongodb-0.1.0b2-py3-none-any.whl Python 3 none any Details for mlflow_mongodb-0.1.0b2-py3-none-any.whl

Total release size: 158.7 kB

Release files / mlflow_mongodb-0.1.0b2.tar.gz

Download URL mlflow_mongodb-0.1.0b2.tar.gz
Size 74.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7549712ac21ec2939ca4334919b865516d60d54c91f606f48502db01932caf33
BLAKE2b-256 checksum
How to use checksums
1df508dec846445eeefdba1058e47e71cce1a3e148419c4152ea7f66d1bd0069
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / mlflow_mongodb-0.1.0b2-py3-none-any.whl

Download URL mlflow_mongodb-0.1.0b2-py3-none-any.whl
Size 84.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e95bdae8f23a9eef93bb703f33f9146da40526e3478429043e66a2e66f6ec9c3
BLAKE2b-256 checksum
How to use checksums
0ae2aa30a750b4c74486e91436e64351501ddfc21bdacbf93fb9baebfa4a9d7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for mlflow-mongodb 0.1.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mlflow_mongodb-0.1.0b2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page