Start or connect to an MLflow tracking server; set MLFLOW_TRACKING_URI to the server URL or a local directory path.
In your training script, call mlflow.start_run() (or use it as a context manager) to open a new run.
Log hyperparameters with mlflow.log_param(key, value) or mlflow.log_params(dict) before training begins.
During training, call mlflow.log_metric(key, value, step=epoch) at each step to record scalar metrics such as loss and accuracy.
Log artifacts (model files, plots, data samples) with mlflow.log_artifact(local_path) or mlflow.log_artifacts(dir_path).
End the run explicitly with mlflow.end_run() if not using the context manager; verify the run appears in the MLflow UI.
Known gotchas
If MLFLOW_TRACKING_URI is not set, runs are stored in a local ./mlruns directory, which differs from a remote server—results will not be visible to teammates.
Logging very large numbers of metrics per step can slow training; batch metrics or reduce logging frequency for high-throughput loops.
Nested runs require passing the parent run ID; forgetting this flattens the hierarchy in the UI.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp