Skip to content

Conversation

@GabrielLoiseau
Copy link

This PR adds documentation for additional GEPA arguments based on the official GEPA repository, improving the coverage of gepa_kwargs in dspy.teleprompt.gepa.gepa.

resolve #8921

Available parameters:
- batch_sampler: Strategy for selecting training examples. Can be a [BatchSampler](https://github.com/gepa-ai/gepa/blob/main/src/gepa/strategies/batch_sampler.py) instance or a string
('epoch_shuffled'). Defaults to 'epoch_shuffled'. Only valid when reflection_minibatch_size is None.
- reflection_prompt_template: Custom prompt template for reflection. Must contain placeholders
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of DSPy, it does already provide a propose_new_texts, so this will always get ignored, UNLESS, one implements this check in the DSPyAdapter's reflection_prompt_template

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake! I removed reflection_prompt_template from the docs

[NoImprovementStopper](https://github.com/gepa-ai/gepa/blob/main/src/gepa/utils/stop_condition.py),
or custom stopping logic. Note: This overrides the default
max_metric_calls stopping condition.
- mlflow_tracking_uri: The tracking URI to use for MLflow (when use_mlflow=True).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomeHirata can correct, but mlflow related args are pre-handled by the dspy <> mlflow <> gepa integration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this MLFlow documentation example, and it looks like everything is handled within MLflow directly (or at least it is standard practice), I removed those args.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @GabrielLoiseau. Can you help add a doc for the "use_mlflow" argument? It's good to have docstring for all public arguments for completeness.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @TomeHirata, I added the doc for "use_mlflow" and added back the two other mlflow related args.

@LakshyAAAgrawal
Copy link
Collaborator

Hey, this is a great PR, thank you very much! Could you please address the few comments above? In general, try to see all the args being passed by optimize call within the dspy.GEPA->compile method, and we can hide those from the documentation.

@GabrielLoiseau
Copy link
Author

Thank you for your review! I also removed display_progress_bar and raise_on_exception as they are enforced within the optimize call inside dspy.GEPA compile

'full_eval' (evaluate every id each time) or an [EvaluationPolicy](https://github.com/gepa-ai/gepa/blob/main/src/gepa/strategies/eval_policy.py) instance. Default is 'full_eval'.
- use_mlflow: If True, enables MLflow integration to log optimization progress.
MLflow can be used alongside Weights & Biases (WandB).
- mlflow_tracking_uri: The tracking URI to use for MLflow (when use_mlflow=True).
Copy link
Collaborator

@TomeHirata TomeHirata Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have mlflow_tracking_uri and mlflow_experiment_name which are configured globally.

Copy link
Author

@GabrielLoiseau GabrielLoiseau Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are used within GEPA optimize function, should we remove them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] GEPA docs should highlight the use of GEPA's stoppers

3 participants