The MLflow Field Guide
A working-knowledge reference on MLflow: how its architecture actually separates metadata from artifacts, what each core component does, how it shows up across clouds and vendors, how to run it for free, and the questions you're actually likely to be asked.
Overview & Principles
What MLflow is, who maintains it, and the design philosophy behind it.
MLflow is an open-source platform for managing the end-to-end machine learning lifecycle — originally experiment tracking, model packaging and model registry for classical ML, and, since MLflow 3, extended to cover generative AI and agentic applications (tracing, evaluation, prompt management). It was created by Databricks in 2018 and open-sourced under the Apache 2.0 licence; in June 2020 the project was donated to the Linux Foundation to give it neutral, vendor-independent governance, though Databricks remains its largest contributor and also sells a managed version of it.
Design philosophy
- Framework-agnostic: works with scikit-learn, PyTorch, TensorFlow, XGBoost, Spark MLlib, OpenAI, LangChain, and dozens more, rather than locking you into one training stack.
- Modular: each component (Tracking, Projects, Models, Registry, GenAI) can be adopted independently — you don't have to buy in to the whole platform at once.
- API-first, UI second: everything is scriptable via Python/R/Java/REST; the web UI is a view over the same underlying data.
- Deployment-target agnostic: a model logged once can be served via REST, Docker, Kubernetes, Spark batch/streaming, or a specific cloud's ML platform without re-authoring it.
The five pillars
- Tracking — log and query experiments (params, metrics, artifacts).
- Projects — package code in a reusable, reproducible format.
- Models — a standard packaging format ("flavors") for models from any library.
- Model Registry — a versioned, governed store for promoting models toward production.
- GenAI (MLflow 3) — tracing, evaluation, prompt registry and an AI gateway for LLM/agent apps.
MLflow interview questions rarely ask you to recite the docs — they test whether you understand why each component exists (what problem it solves) and how the pieces fit together in a real pipeline. Anchor your answers on the problem, not just the API.
Architecture
How a training run's data actually flows through MLflow — the piece most candidates can name but can't draw.
Fig. 1 — A client logs runs through the (optional) Tracking Server, which splits data across two independent stores; the Model Registry sits on top of both to govern promotion and deployment.
The two-store split, and why it exists
The single most-tested architecture concept: MLflow deliberately separates metadata (small, structured, queryable — params, metrics, tags) from artifacts (large, unstructured blobs — model weights, plots, datasets). This lets you pick the right tool for each job: a relational database for the former, and cheap object storage for the latter.
Backend store options
file:./mlruns— default, local files, fine for solo experimentationsqlite:///mlflow.db— single-file DB, good for local demospostgresql://...— production-grade, supports the Model Registrymysql://...
Note: the Model Registry requires a database-backed store — plain file stores can't back it.
Artifact store options
- Local filesystem (default,
./mlruns) - Amazon S3 / S3-compatible (e.g. MinIO)
- Azure Blob Storage / ADLS
- Google Cloud Storage
- NFS, HDFS, FTP (less common today)
When you deploy a real Tracking Server, clients never talk to the artifact store directly — they go through the server, which proxies artifact reads/writes. This means engineers don't need cloud storage credentials on their laptops, and access can be centrally controlled.
Core Components
Each pillar in more depth, with the vocabulary you'll be expected to use precisely.
Tracking
Component. An API + UI for logging and querying experiments (a named collection of related work) made up of runs (a single execution). Each run can log parameters, metrics, tags and artifacts.
Projects
Component. A convention for packaging data-science code so anyone (or any automation) can re-run it reproducibly. An MLproject YAML file declares entry points, parameters and the runtime environment.
Models
Component. A standard directory format for packaging models. Each saved model declares one or more flavors plus the universal pyfunc flavor — a generic predict(input) interface any MLflow-aware tool can call.
Model Registry
Component. A centralised, versioned store for promoting a model to production. Modern MLflow favours mutable aliases (e.g. @champion) over the older fixed stages, since an alias can be reassigned without touching consumers.
Deployment
Component. Turns a registered model into a live prediction endpoint — a local REST server for testing, a Docker image, or native integration with Kubernetes, SageMaker, Azure ML, or Databricks Model Serving.
GenAI & Agents
Component · MLflow 3. Tracing captures every step of an LLM/agent call as a hierarchical trace, built on OpenTelemetry. Evaluation runs 50+ built-in and custom scorers. The Prompt Registry versions prompts like code.
What's New in MLflow 3
MLflow 3 (current major version through 2026) is a significant evolution from the 1.x/2.x line most existing tutorials describe.
- GenAI-native, not bolted on. Tracing, evaluation and prompt management for LLMs/agents are built into the same Tracking Server, UI and Registry used for classical ML — one system for both worlds.
- Hierarchical tracing. A single user request can be traced through every LLM call, tool invocation, and vector-store lookup it triggers, with timing and token counts per step. Fully OpenTelemetry-compatible.
- Model-centric tracking. First-class model checkpoint tracking with unique model IDs and dataset-aware metric linking, tightening lineage.
- Unified GenAI app packaging. A whole GenAI application — prompt template, retrieval logic, model config, dependencies — can be versioned and deployed as one atomic unit.
- Lightweight tracing SDK. A slimmed-down client (roughly 95% smaller install) for production services that only need to emit traces.
- Storage layout change. Model artifacts now live under the model's own artifact path rather than always nested under a run — a "model" is now a first-class object, not just a run's side effect.
A lot of blog posts and Stack Overflow answers still describe the older Staging/Production/Archived stage model. Current MLflow guidance favours aliases instead. If asked about model promotion, mention both, but lead with aliases and explain why they're preferred.
Commercial & Open-Source Implementations
MLflow itself is free and open source — but how you run it, and what competes with it, varies a lot.
Ways to run MLflow itself
Plain open-source MLflow
Self-hosted OSS. pip install mlflow and run your own Tracking Server, backend DB and artifact store. Full control, zero licence cost, you own the ops burden.
Databricks Managed MLflow
Managed. MLflow's original creator's hosted offering. Adds Unity Catalog integration, managed infrastructure, and tight Databricks integration.
AWS SageMaker with MLflow
Managed. SageMaker offers a fully-managed MLflow Tracking Server as part of SageMaker Studio, plus native SageMaker deployment targets.
Azure ML + MLflow
Managed. Azure ML uses MLflow as its native tracking format — mlflow.log_metric() calls are captured automatically, no separate tracking server needed.
Docker Compose / Kubernetes
Self-hosted OSS. MLflow server + PostgreSQL (backend store) + MinIO (S3-compatible artifact store) as containers, often behind an auth-protected ingress.
Google Vertex AI
Self-hosted OSS. Vertex AI doesn't run MLflow natively, but MLflow can be self-hosted on GCP (GKE/Cloud Run) with GCS as the artifact store.
Adjacent / competing tools
These solve overlapping problems — worth knowing the honest trade-offs rather than dismissing them, especially in an interview.
Weights & Biases
Commercial. Cloud-first, polished dashboards and real-time collaboration; strongest in research-heavy teams. Free individual tier; paid team/enterprise pricing.
Neptune.ai
Commercial. Positions itself between MLflow and W&B — strong metadata/lineage focus for production ML, priced by tracking hours.
Comet ML
Commercial. Similar space to W&B/Neptune — experiment tracking, production monitoring, and increasingly LLM observability.
Kubeflow
Open source. A broader Kubernetes-native ML platform (pipelines, serving, notebooks) — more infrastructure to operate, but covers orchestration MLflow doesn't attempt.
DVC
Open source. Git-based data/model versioning; often paired with MLflow rather than instead of it.
SageMaker / Vertex AI Experiments
Managed (cloud-native). Cloud-vendor-native tracking, tightly integrated but not portable off that cloud — the trade-off MLflow's platform-agnostic design avoids.
Comparison Table
High-level trade-offs — treat exact pricing as indicative and time-boxed to 2026.
| Tool | Licence | Strength | Weakness | Best fit |
|---|---|---|---|---|
| MLflow (OSS) | Apache 2.0, free | Full control, no vendor lock-in, now covers GenAI too | Basic UI vs. commercial tools; you own the ops | Regulated/data-sovereignty environments |
| Databricks Managed MLflow | Commercial (usage-based) | Zero ops, Unity Catalog governance | Best value only if already on Databricks | Teams standardised on the Databricks lakehouse |
| Weights & Biases | Commercial, free individual tier | Best-in-class dashboards, collaboration | Cloud-dependent, cost scales with team size | Fast-moving research teams |
| Neptune.ai | Commercial, hour-based free tier | Metadata/lineage rigor for production | Pricing model can be confusing at scale | Production ML with strict audit needs |
| Kubeflow | Apache 2.0, free | Full pipeline orchestration on Kubernetes | Heavy to operate; steep learning curve | Kubernetes-native platform teams |
| DVC | Apache 2.0, free | Git-native data/pipeline versioning | Not an experiment UI or model server by itself | Pairing with MLflow, not replacing it |
Local Setup
Three levels: the 60-second local demo, a persistent local server, and a production-like Docker Compose stack.
Level 1 — Zero-config local run
No server needed. MLflow defaults to a local ./mlruns folder for both metadata and artifacts.
pip install mlflow
python - <<'PY'
import mlflow
with mlflow.start_run():
mlflow.log_param("n_estimators", 100)
mlflow.log_metric("accuracy", 0.91)
PY
mlflow ui # opens the UI at http://127.0.0.1:5000, reading ./mlruns
Level 2 — A real local Tracking Server (SQLite backend)
Useful once you want the Model Registry, which needs a database-backed store.
mlflow server \
--backend-store-uri sqlite:///mlflow.db \
--default-artifact-root ./mlartifacts \
--host 127.0.0.1 \
--port 5000
Level 3 — Docker Compose: Postgres + MinIO (production-like)
The pattern most teams use to self-host a shared MLflow instance: MLflow server + PostgreSQL for metadata + MinIO (S3-compatible) for artifacts.
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: mlflow
POSTGRES_PASSWORD: mlflow
POSTGRES_DB: mlflow
volumes: [pgdata:/var/lib/postgresql/data]
minio:
image: minio/minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minio_user
MINIO_ROOT_PASSWORD: minio_password
ports: ["9000:9000", "9001:9001"]
volumes: [minio_data:/data]
mlflow:
image: ghcr.io/mlflow/mlflow:latest
depends_on: [postgres, minio]
environment:
MLFLOW_S3_ENDPOINT_URL: http://minio:9000
AWS_ACCESS_KEY_ID: minio_user
AWS_SECRET_ACCESS_KEY: minio_password
ports: ["5000:5000"]
command: >
mlflow server
--backend-store-uri postgresql://mlflow:mlflow@postgres:5432/mlflow
--artifacts-destination s3://mlflow-artifacts
--host 0.0.0.0 --port 5000
volumes: {pgdata: {}, minio_data: {}}
Create the mlflow-artifacts bucket in MinIO once (via its console at localhost:9001) — MLflow won't create the bucket itself. Then point clients at MLFLOW_TRACKING_URI=http://localhost:5000.
Command cheat sheet
| Command | What it does |
|---|---|
| mlflow ui | Quick local UI over ./mlruns, no server process management |
| mlflow server ... | Long-running Tracking Server for teams/remote access |
| mlflow run <uri> | Execute an MLflow Project (local path or Git URI) |
| mlflow models serve -m <uri> | Spin up a local REST endpoint for a logged/registered model |
| mlflow models build-docker -m <uri> | Package a model as a standalone Docker image |
| mlflow experiments list | CLI listing of experiments on the configured tracking URI |
Quickstart Code
The patterns you should be able to write from memory.
Classic ML: manual + autologging
import mlflow
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
mlflow.set_tracking_uri("http://127.0.0.1:5000")
mlflow.set_experiment("fraud-detection")
mlflow.sklearn.autolog() # captures params, metrics, and the model automatically
with mlflow.start_run(run_name="rf-baseline"):
model = RandomForestClassifier(n_estimators=200, max_depth=8)
model.fit(X_train, y_train)
preds = model.predict(X_test)
acc = accuracy_score(y_test, preds)
mlflow.log_metric("holdout_accuracy", acc)
mlflow.log_artifact("feature_importance.png")
Registering and promoting a model
result = mlflow.register_model(
model_uri="runs:/<run_id>/model",
name="fraud-risk-scorer",
)
from mlflow import MlflowClient
client = MlflowClient()
client.set_registered_model_alias(
name="fraud-risk-scorer", alias="champion", version=result.version,
)
# Consumers always load the current champion, regardless of version number:
model = mlflow.pyfunc.load_model("models:/fraud-risk-scorer@champion")
Serving a model locally
mlflow models serve -m "models:/fraud-risk-scorer@champion" -p 1234 --no-conda
curl http://127.0.0.1:1234/invocations \
-H "Content-Type: application/json" \
-d '{"dataframe_split": {"columns": ["order_amount","account_age_days"], "data": [[249.99, 12]]}}'
GenAI: tracing an LLM call (MLflow 3)
import mlflow
mlflow.set_experiment("support-copilot")
mlflow.openai.autolog() # auto-instruments the OpenAI SDK
@mlflow.trace
def answer_question(question: str) -> str:
# any nested LLM calls, retrievals, or tool calls inside here
# are captured as child spans in the same trace automatically
return call_llm(question)
Interview Questions
Grouped by depth. Click to reveal a model answer — write your own version in your own words before reading mine.
Conceptual
coreWhat is MLflow, in one sentence?
An open-source platform that manages the ML (and now GenAI) lifecycle — experiment tracking, reproducible packaging, model registry/versioning, and deployment — through a framework-agnostic API and UI.
coreWhat are MLflow's core components, and what problem does each solve?
Tracking solves "I can't remember which hyperparameters produced which result." Projects solves "this only runs on my machine." Models solves "every framework saves models differently." Model Registry solves "which version is actually in production, and who approved it?" GenAI/Tracing solves the same accountability problem for LLM/agent calls, where a single "run" isn't one function call but a chain of them.
coreWhat's the difference between an experiment and a run?
An experiment is a named container/folder for related work (e.g. "fraud-detection-q3"); a run is one execution logged inside it. Many runs live under one experiment.
coreWhat is a "flavor," and why does pyfunc matter?
A flavor is a format for saving a model that a specific tool can understand — sklearn, pytorch, onnx, etc. Every MLflow model also implements the generic pyfunc flavor, which exposes a single predict(input) interface regardless of the underlying library — that's what lets generic tooling work on any model without knowing what trained it.
coreExplain the backend store vs. artifact store split. Why not just use one store for everything?
Metadata (params, metrics, tags) is small, structured, and needs to be queried and filtered quickly — a natural fit for a relational database. Artifacts (model weights, plots, datasets) are large binary blobs better suited to cheap object storage. Splitting them lets each half scale and be operated independently.
Practical / hands-on
practicalHow would you compare 50 runs to find the best model?
Either the UI's run comparison view (sort/filter by a metric column, parallel-coordinates plot for hyperparameter sweeps) or programmatically via MlflowClient().search_runs() with a filter string.
practicalHow do you avoid re-writing logging code for every framework you use?
mlflow.autolog() (or the framework-specific version) automatically captures parameters, metrics, and the trained model for supported libraries with no manual logging calls.
practicalHow do you promote a model from staging to production safely?
Register the model, validate it (via mlflow.evaluate()), then reassign a mutable alias — e.g. move @champion from version 4 to version 5 — rather than hard-coding a version number into consuming services. Promotion becomes a metadata change, not a code deploy, and rollback is just reassigning the alias back.
practicalHow would you serve an MLflow model in production? What are the options?
Depends on latency/scale needs: mlflow models serve for a quick local endpoint (dev/test only); mlflow models build-docker for any orchestrator; native deploy plugins for SageMaker, Azure ML or Databricks Model Serving for managed, autoscaling endpoints; or batch scoring inside a Spark job for offline/bulk predictions.
practicalHow do you set up a shared MLflow instance for a team, not just solo use?
Run a persistent mlflow server backed by a real database (Postgres/MySQL) for the backend store — required for the Model Registry — and object storage for artifacts, usually behind auth/ingress. Docker Compose or Kubernetes are the common ways to operate this, or you offload the ops entirely to a managed offering.
Architecture & scenario-based
scenarioYour team has 15 data scientists all writing to the same Tracking Server. What could go wrong, and how do you mitigate it?
Likely issues: naming collisions and clutter, no access control on who can promote to production aliases, unmanaged artifact storage costs, and a single point of failure if the server or its DB goes down. Mitigations: enforced naming conventions, registry permissions (native in managed offerings, or via a reverse proxy/auth layer self-hosted), artifact lifecycle policies, and running the backend DB with proper backups and HA.
scenarioHow would you handle model monitoring and drift detection with MLflow?
MLflow doesn't do continuous production monitoring out of the box — mlflow.evaluate() is typically used for point-in-time or scheduled batch evaluation against fresh data, logged as new runs you compare over time, or paired with a dedicated monitoring tool. Worth being explicit in an interview that this is a gap you'd fill with additional tooling, not something MLflow solves natively.
scenarioHow does MLflow handle reproducibility? What's still your responsibility?
MLflow Projects capture the entry point, parameters, and environment definition, and autologging captures the exact params/metrics/model used. What it doesn't automatically guarantee: data reproducibility (you still need to version or snapshot training data — often paired with DVC) and non-determinism from GPU ops or unpinned dependencies.
scenarioCompare MLflow to Weights & Biases. When would you pick one over the other?
MLflow: open source, self-hostable, no per-seat cost, strongest where data sovereignty matters, but a plainer UI and you own the ops burden. W&B: commercial SaaS, much richer visual dashboards and collaboration, but ongoing cost that scales with team size and a cloud dependency. In a regulated financial-services context, MLflow's self-hosted, audit-friendly nature is often the deciding factor.
scenarioHow would MLflow fit into an MLOps pipeline that also uses Airflow/CI-CD?
MLflow isn't an orchestrator — it's the tracking/registry/serving layer an orchestrator's ML task calls into. Typical pattern: a CI/CD pipeline or Airflow DAG triggers training that logs to MLflow Tracking; a validation stage evaluates the run against a quality gate; if it passes, the pipeline registers the model and reassigns the production alias; a deployment stage rolls out the newly-aliased model.
GenAI / newer surface area
genaiWhat does MLflow Tracing add that traditional logging doesn't?
Traditional logs are flat and manual. Tracing captures a full hierarchical execution tree automatically — a single request's LLM calls, tool invocations, and vector-store retrievals, with per-step timing, token counts and errors — largely via one-line auto-instrumentation, and it's OpenTelemetry-compatible so it isn't a proprietary dead end.
genaiHow does MLflow evaluate GenAI outputs, given there's often no single "correct" answer?
Via a library of built-in scorers (faithfulness, relevance, toxicity) plus custom scorers, including LLM-as-judge approaches, run either against freshly generated outputs or a pre-computed "answer sheet" — extending the same mlflow.evaluate() API classical ML already used.
Glossary
Every term used in this guide, in one place.
- Alias
- A mutable, named pointer to a specific model version (e.g. @champion), reassignable without changing consumer code. Preferred over stages in current MLflow guidance.
- Artifact
- Any file output logged from a run — a serialized model, a plot, a sample dataset, a confusion matrix image.
- Artifact Store
- Where artifacts physically live — local disk, S3, Azure Blob Storage, GCS, etc.
- Autologging
- Automatic capture of parameters, metrics and the model itself for supported frameworks, via mlflow.autolog(), with no manual logging calls required.
- Backend Store
- Where run/experiment metadata is persisted — a file store, SQLite, PostgreSQL or MySQL.
- Experiment
- A named, top-level grouping of related runs.
- Flavor
- A format for saving/loading a model tied to a specific library or tool. A model can declare multiple flavors at once.
- MLproject
- The YAML file at the root of an MLflow Project declaring entry points, parameters and the runtime environment.
- Model Registry
- The versioned, governed store that tracks a named model's lineage from experiment run through to production.
- pyfunc
- MLflow's universal model flavor — a generic predict(input) interface that lets any MLflow-aware tool load and score a model without knowing its training framework.
- Run
- A single tracked execution of ML code — one training job with its own parameters, metrics, tags and artifacts.
- Stage
- The older, fixed model-lifecycle label. Still supported but superseded by aliases in current guidance.
- Tag
- Free-form key/value metadata attached to a run or a registered model version.
- Trace
- A hierarchical record of everything that happened during one LLM/agent request — nested spans for each LLM call, tool call, or retrieval, with timing and token usage.
- Tracking Server
- The optional HTTP server that fronts the backend and artifact stores, enabling remote/team access and artifact proxying.
- Tracking URI
- The address a client points at to log/query runs — a local path, a sqlite:/// URI, or an http:// Tracking Server URL.
- Unity Catalog
- Databricks' governance layer, which can back the Model Registry to add cross-workspace access control and lineage.
Sources
- MLflow Tracking — official docs
- MLflow Model Registry — official docs
- Announcing MLflow 3 — MLflow blog
- LLM Tracing and Agent Observability — official docs
- Prompt Registry — official docs
- mlflow · PyPI
- MLflow 3.0: Build, Evaluate, and Deploy Generative AI with Confidence — Databricks blog
- The MLflow Project Joins Linux Foundation