optimize() API GEPA optimizer, Pareto, artifact, and evaluation APIs. python api api/optimize packages/python/axir-api.json api optimize() API

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.

FieldValue
Kindfunction
Ax conceptoptimize
API sectionOptimizers
Formoptimize(program, examples, options=None)
Returnsoptimized artifact

Important Options

  • student/client
  • teacher/reflection client
  • metric budget
  • bootstrap

Examples

Python
artifact = optimize(qa, train, {"studentAI": client, "teacherAI": reflection})

Full reference

AxBootstrapFewShot

Few-shot demonstration optimizer that selects successful evaluator rollouts before prompt/component evolution.

FieldValue
Kindtype
Ax conceptAxBootstrapFewShot
API sectionOptimizers
FormAxBootstrapFewShot(**options)
Returnsoptimizer engine

Important Options

  • quality threshold
  • max demos
  • max rounds
  • batch size

Examples

Python
bootstrap = AxBootstrapFewShot(qualityThreshold=0.7)

Full reference

AxGEPA

Generated GEPA optimizer engine with Core-owned reflection, Pareto, bootstrap, and selector-state behavior.

FieldValue
Kindtype
Ax conceptAxGEPA
API sectionOptimizers
FormAxGEPA(reflection, **options)
Returnsoptimizer engine

Important Options

  • reflection client
  • budget
  • metric
  • candidate count

Examples

Python
engine = AxGEPA(reflection_client)

Full reference

OptimizerEngine

Optimizer boundary consumed by AxGen, AxAgent, and AxFlow optimization helpers.

FieldValue
Kindinterface
Ax conceptOptimizerEngine
API sectionOptimizers
FormOptimizerEngine.optimize(request, evaluator)
Returnsoptimized artifact

Important Options

  • request
  • evaluator

Full reference

OptimizerEvaluator

Evaluator callback boundary used by generated optimizers.

FieldValue
Kindinterface
Ax conceptOptimizerEvaluator
API sectionOptimizers
FormOptimizerEvaluator.evaluate(request)
Returnsscore/evidence result

Important Options

  • dataset rows
  • candidate map
  • evidence

Full reference

Full Reference

Open the full Python reference. This page highlights the optimize symbols most relevant to everyday use.

Docs