Overview
GEPA integrates with Weights & Biases (W&B) to provide real-time experiment tracking, visualization, and collaboration features. The integration automatically logs metrics, parameters, and optimization progress to your W&B workspace.Setup
Install Weights & Biases:Basic Usage
Enable W&B tracking by settinguse_wandb=True in your optimization call:
Configuration Options
Thegepa.optimize() function provides several W&B-specific parameters:
use_wandb
- Type:
bool - Default:
False - Description: Enable Weights & Biases experiment tracking
wandb_api_key
- Type:
str | None - Default:
None - Description: W&B API key for authentication. If not provided, uses the key from
wandb loginor environment variables.
wandb_init_kwargs
- Type:
dict[str, Any] | None - Default:
None - Description: Additional keyword arguments passed to
wandb.init(). Use this to configure project name, entity, tags, notes, and other W&B settings.
Complete Example
Logged Metrics
GEPA automatically logs the following to W&B during optimization:- Validation scores: Performance metrics on the validation set
- Training scores: Performance on training minibatches
- Iteration count: Current optimization iteration number
- Metric calls: Total number of evaluations performed
- Best score: Highest validation score achieved so far
- Candidate history: Evolution of candidates over time
Authentication Methods
W&B supports multiple authentication methods:1. Interactive Login
2. Environment Variable
3. Programmatic Login
4. Netrc File
Add credentials to~/.netrc:
Combined Logging
You can use both W&B and MLflow simultaneously:Viewing Results
After running your optimization, view results in the W&B dashboard:- Navigate to your W&B project at
https://wandb.ai/<entity>/<project> - Select your run to see detailed metrics, charts, and system information
- Compare multiple runs to analyze optimization strategies
- Share results with team members using W&B’s collaboration features
Advanced Features
Custom Metrics
If you need to log custom metrics beyond what GEPA provides automatically, you can access the W&B run object through callbacks:External Resources
Weights & Biases Documentation
Official W&B documentation and guides
W&B Python Library Reference
Complete Python API reference for wandb