Overview
GEPA integrates with MLflow to provide experiment tracking and logging capabilities. The integration automatically logs metrics, parameters, and optimization progress to your MLflow tracking server.Setup
Install MLflow:Basic Usage
Enable MLflow tracking by settinguse_mlflow=True in your optimization call:
Configuration Options
Thegepa.optimize() function provides several MLflow-specific parameters:
use_mlflow
- Type:
bool - Default:
False - Description: Enable MLflow experiment tracking
mlflow_tracking_uri
- Type:
str | None - Default:
None - Description: URI of the MLflow tracking server. If not specified, MLflow uses the default tracking URI.
mlflow_experiment_name
- Type:
str | None - Default:
None - Description: Name of the MLflow experiment. If not specified, logs are saved to the default experiment.
Complete Example
Logged Metrics
GEPA automatically logs the following metrics to MLflow during optimization:- Validation scores: Performance on the validation set
- Training scores: Performance on training minibatches
- Iteration count: Current optimization iteration
- Metric calls: Number of evaluations performed
- Best score: Highest validation score achieved
Combined Logging
You can use both MLflow and Weights & Biases simultaneously:MLflow UI
View your experiments in the MLflow UI:http://localhost:5000 to explore your optimization runs, compare experiments, and analyze metrics.
External Resources
MLflow Prompt Optimization Guide
Official MLflow documentation for prompt optimization with GEPA
MLflow Tracking Documentation
Learn more about MLflow experiment tracking