optimize() API
GEPA, Pareto, artifact, and optimizer APIs.
Most Used
optimize
Convenience optimizer helper that composes AxBootstrapFewShot before AxGEPA and returns an artifact without applying final component changes.
| Field | Value |
|---|---|
| Kind | function |
| Ax concept | optimize |
| API section | Optimizers |
| Form | optimize(program, examples, options=None) |
| Returns | optimized artifact |
Important Options
student/clientteacher/reflection clientmetric budgetbootstrap
Examples
artifact = optimize(qa, train, {"studentAI": client, "teacherAI": reflection})AxBootstrapFewShot
Few-shot demonstration optimizer that selects successful evaluator rollouts before prompt/component evolution.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | AxBootstrapFewShot |
| API section | Optimizers |
| Form | AxBootstrapFewShot(**options) |
| Returns | optimizer engine |
Important Options
quality thresholdmax demosmax roundsbatch size
Examples
bootstrap = AxBootstrapFewShot(qualityThreshold=0.7)AxGEPA
Generated GEPA optimizer engine with Core-owned reflection, Pareto, bootstrap, and selector-state behavior.
| Field | Value |
|---|---|
| Kind | type |
| Ax concept | AxGEPA |
| API section | Optimizers |
| Form | AxGEPA(reflection, **options) |
| Returns | optimizer engine |
Important Options
reflection clientbudgetmetriccandidate count
Examples
engine = AxGEPA(reflection_client)OptimizerEngine
Optimizer boundary consumed by AxGen, AxAgent, and AxFlow optimization helpers.
| Field | Value |
|---|---|
| Kind | interface |
| Ax concept | OptimizerEngine |
| API section | Optimizers |
| Form | OptimizerEngine.optimize(request, evaluator) |
| Returns | optimized artifact |
Important Options
requestevaluator
OptimizerEvaluator
Evaluator callback boundary used by generated optimizers.
| Field | Value |
|---|---|
| Kind | interface |
| Ax concept | OptimizerEvaluator |
| API section | Optimizers |
| Form | OptimizerEvaluator.evaluate(request) |
| Returns | score/evidence result |
Important Options
dataset rowscandidate mapevidence
Full Reference
Open the full Python reference. This page highlights the optimize symbols most relevant to everyday use.