Optimizers
The parameter fields, defaults, and agent-opt class for every optimizer, in one table.
Six optimizers are available, each suited to a different problem shape. See Choosing an optimizer for how to pick one, or Understanding optimization for how the optimization loop works.
Parameters by optimizer
The parameter set below describes what you pass in the platform’s optimization request when you create a run, not arguments to the class constructor; see Run an optimization for one optimizer’s parameters going into a request end to end. Optimization Objective (task_description) is present on every optimizer’s form, though nothing is prefilled into it.
| Optimizer | Class | Use it when | Parameters (label / code key / default) |
|---|---|---|---|
| Random Search | RandomSearchOptimizer | First look at a prompt’s headroom | Number Variations (num_variations), 3 |
| Bayesian Search | BayesianSearchOptimizer | Tuning few-shot examples on solid instructions | Min examples (min_examples), 2Max examples ( max_examples), 4No.of trials ( n_trials), 5 |
| ProTeGi | ProTeGi | Parallel candidate fixes from failing examples | Beam size (beam_size), 4Number of gradients ( num_gradients), 4Errors per gradient ( errors_per_gradient), 4Prompts per gradient ( prompts_per_gradient), 1Number of Rounds ( num_rounds), 3 |
| Meta-Prompt | MetaPromptOptimizer | One prompt refined over rounds, not parallel candidates | Optimization Objective (task_description)Number of Rounds ( num_rounds), 4 |
| PromptWizard | PromptWizardOptimizer | Wording itself, not one instruction, is the ceiling | Mutated Rounds (mutate_rounds), 3Refined Iterations ( refine_iterations), 2Beam size ( beam_size), 2 |
| GEPA | GEPAOptimizer | Widest search of the six, 40 metric calls prefilled | Max Metric Calls (max_metric_calls), 40 |
Every parameter listed above must be passed on the optimization request. The values shown are what the form prefills when you pick that optimizer, and you can change any of them before you start the run. A request missing any listed parameter, or carrying a parameter that isn’t listed for that optimizer and isn’t task_description, is rejected before the run starts; see Common errors and fixes for the exact error.
task_description is the one parameter allowed outside a row’s own list: it can additionally be passed on any optimizer’s request, even where its row above doesn’t list it for that optimizer, and Meta-Prompt is the one optimizer that requires it as part of its own parameter set.
Keep exploring
Random Search
Unguided variations on the wording
Bayesian Search
Tunes which few-shot examples are used, not the wording
ProTeGi
Several fixes drawn from failures, explored in parallel
Meta-Prompt
One prompt rewritten from failures, iterated over rounds
PromptWizard
Mutates the wording, then critiques and refines the result
GEPA
Evolutionary search with a budget set in metric calls, 40 prefilled
Questions & Discussion