optimize() API
GEPA, Pareto, artifact, and optimizer APIs.
Most Used
Ax.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 | Ax.optimize(program, examples, options) |
| Returns | optimized artifact |
Important Options
student/clientteacher/reflection clientmetric budgetbootstrap
Examples
Map<String, Object> artifact = Ax.optimize(qa, train, Map.of("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 | new AxBootstrapFewShot(options) |
| Returns | optimizer engine |
Important Options
quality thresholdmax demosmax roundsbatch size
Examples
AxBootstrapFewShot bootstrap = new AxBootstrapFewShot(Map.of("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 | new AxGEPA(reflection, options) |
| Returns | optimizer engine |
Important Options
reflection clientbudgetmetriccandidate count
Examples
AxGEPA engine = new AxGEPA(reflectionClient, Map.of());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 Java reference. This page highlights the optimize symbols most relevant to everyday use.