Knowing the components tells you which part solves your current problem, from comparing runs to deploying models.
MLflow organizes ML work around a few concepts:
- Tracking records each training attempt as a run inside an experiment: parameters, metrics over time, tags and files (artifacts).
- Models are saved in a standard format with a flavor (sklearn, pytorch, transformers...) plus a generic
pyfuncinterface, so any logged model can be loaded and called withpredictthe same way. - The Model Registry gives models names, versions and aliases such as
champion, which deployment code refers to. - Serving turns a logged model into a REST endpoint or Docker image.
- GenAI features add tracing of LLM and agent calls, evaluation with LLM judges, and a prompt registry.
Install with pip install mlflow. With no configuration, MLflow 3 stores runs in a local SQLite database mlflow.db in the working directory and artifacts in a local folder. Start the web UI with:
mlflow ui --port 5000then open http://localhost:5000 to browse experiments, compare runs and charts, and inspect models.
For teams, a shared tracking server backed by a database and object storage replaces the local file (covered later). The same Python code works against either; only the tracking URI changes.
Example
import mlflow
print(mlflow.__version__) # 3.x
print(mlflow.get_tracking_uri()) # sqlite:///.../mlflow.db (local default)
mlflow.set_experiment("hello-mlflow")
with mlflow.start_run():
mlflow.log_param("model", "baseline")
mlflow.log_metric("accuracy", 0.81)
# Then, in a terminal in the same directory:
# mlflow ui --port 5000 -> open http://localhost:5000Remember
- Runs inside experiments record params, metrics, tags and artifacts
- Models get a flavor plus a generic pyfunc interface; the registry versions them
- Local default: SQLite
mlflow.db;mlflow uibrowses it
Watch out for
- Running
mlflow uifrom a different directory than your scripts and seeing no runs, because the local store is relative to the working directory.