Skip to main content
There are two intentionally distinct API layers:
  1. The published gepa==0.1.4 package exposes the standalone reflective optimize_anything() engine.
  2. This plugin exposes run_optimization() and run_omni() for the native AutoResearch, Meta-Harness, Best-of-N, and two-phase Omni workflows.
The native runtime is checked in under 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

Use 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.

run_omni

See Omni workflow for phase boundaries, budget partitioning, and continuation options.
Last modified on August 9, 2026