- The published
gepa==0.1.4package exposes the standalone reflectiveoptimize_anything()engine. - This plugin exposes
run_optimization()andrun_omni()for the native AutoResearch, Meta-Harness, Best-of-N, and two-phase Omni workflows.
scripts/native_omni/ and is independent of the installed GEPA package.
Mental model
optimize_anything is black-box optimization over a candidate. The evaluator returns a higher-is-better score plus optional feedback; the search engine uses that feedback to propose and select candidates. A budget bounds evaluator calls and, for agentic plugin engines, model-token spend.
The direct PyPI API has no top-level engine= selector — it is the reflective GEPA engine. Engine selection belongs to the plugin wrapper: gepa means the PyPI reflective engine, and autoresearch, meta_harness, and best_of_n mean plugin-native engines.
Published PyPI GEPA API
seed_candidate may be a string, a named component mapping, or None when the engine can bootstrap from objective and background. Examples in dataset and valset are opaque values passed to the evaluator. The direct PyPI call has no test_set parameter.
Config
Unknown or misspelled fields raise
TypeError. Do not pass the plugin wrapper’s max_evals, max_token_cost, engine_config, or output_dir fields to this direct API.
Evaluator and data splits
evaluator(candidate) for a single task and evaluator(candidate, example) with dataset or valset. A bare float is accepted, but (score, info) gives the proposer useful failure details.
batch_evaluator accepts a list of (candidate, example) pairs and returns one score or (score, info) per pair in order. The plugin-native evaluation server applies the same normalization and enforces batch cardinality.
For the plugin wrapper, put held-out examples in
task["test_set"]. They are never exposed through the native agent task endpoint or passed to Phase 1. The wrapper scores them after optimization and may expose metadata["test_score"] and metadata["test_scores"].
Plugin wrapper
engine="gepa" routes to PyPI gepa==0.1.4 and requires its nested GEPAConfig contract. The other explicit engines are plugin-native and use a shared Task, BudgetTracker, and external evaluation workspace. Omitting engine selects run_omni().
All wrapper run_dir and output_dir paths must be absolute and outside the checkout. sandbox=False is rejected at the wrapper boundary.