MLflow Tracking
The open source backbone of the ML platform
MLflow Tracking is the de-facto open source layer that records runs, metrics and artifacts, and it underpins the rest of the platform — the registry, projects and model serving all hang off tracked runs.
What you will learn
- Log a run with parameters, metrics and artifacts in MLflow
- Explain the client-server split in MLflow tracking
- Query and compare runs programmatically
What is this?
MLflow is an open source platform for the ML lifecycle. Its tracking component records experiments: each run captures parameters, metrics, tags, artifacts and environment context, usable through a Python client, a REST API and a UI. A remote tracking server lets a whole team see and query every run.
Why do you need it?
- It standardizes logging so any framework (sklearn, PyTorch, XGBoost) records the same shape.
- A shared tracking server makes results team-wide instead of laptop-locked.
- The registry and serving integrations use the same run IDs, keeping lineage intact.
- It is free, widely deployed and works locally with zero infrastructure.
Mental model
Git for code, MLflow for experiments
Tracking runs like commits
Git stores the history of code so you can compare, branch and revert. MLflow stores the history of experiments — with their metrics and artifacts — so model development gets the same discipline.
How it works
- A client connects to a tracking server (or a local file store).
- mlflow.start_run() opens a run context; everything logged belongs to that run.
- log_param records inputs; log_metric records outputs (with optional step for curves).
- log_artifact stores files (model, plots, reports) in the artifact store.
- Autologging hooks into common frameworks so params/metrics are captured without manual calls.
- The UI and search API query runs by tags, params and metrics.
MLflow tracking client-server architecture.
Examples
The minimal tracked run
import mlflowwith mlflow.start_run(run_name="iris-rbf"): mlflow.log_param("kernel", "rbf") mlflow.log_param("C", 1.0) ... mlflow.log_metric("test_accuracy", 0.9333) mlflow.sklearn.log_model(model, "model")Four calls turn training into a first-class, queryable run. Autologging can do most of this for you when you enable it.
In production
- A team points 10 laptops at one shared tracking server; a nightly retrain logs into production experiments.
- Autologging captures everything so onboarding a new model family takes minutes.
- Serving reads the artifact URI from the winning run, so deployment stays linked to the run that produced it.
Best practices
- Set a tracking URI explicitly and share it with the team.
- Use experiments per project line and tags per hypothesis.
- Enable autologging as a default, then hand-log what autologging misses.
- Keep artifact stores versioned and budgeted — artifacts grow fast.
Common mistakes
- Forgetting to share the tracking URI, so every engineer runs a private server.
- Nesting start_run calls and logging to the wrong run.
- Logging metrics inside a tight loop without a step, ballooning the metrics store.
Debugging tips
- Run disappears? Check TRACKING_URI env var vs the --backend-store-uri flag.
- Artifact missing? Confirm the artifact URI points where the server can read and the client can write.
- UI slow? Prune or archive old experiments and cap autologged metrics.
Interview checkpoint
Hands-on lab
- Train a model with MLflow tracking enabled
- Log parameters, metrics and a model artifact
- Query the run back from the store to prove the artifact is intact
Log Your First MLflow Run
30 min · intermediate
Quick quiz
Which MLflow client call records a training output?
MLflow tracking requires committing to a hosted cloud service.