Skip to content

EngineConfig

gepa.optimize_anything.EngineConfig(run_dir: str | None = None, seed: int = 0, display_progress_bar: bool = False, raise_on_exception: bool = True, use_cloudpickle: bool = True, track_best_outputs: bool = True, max_metric_calls: int | None = None, max_candidate_proposals: int | None = None, val_evaluation_policy: EvaluationPolicy | Literal['full_eval'] = 'full_eval', candidate_selection_strategy: CandidateSelector | Literal['pareto', 'current_best', 'epsilon_greedy', 'top_k_pareto'] = 'pareto', frontier_type: FrontierType = 'hybrid', parallel: bool = True, max_workers: int | None = (lambda: os.cpu_count() or 32)(), cache_evaluation: bool = False, cache_evaluation_storage: CacheEvaluationStorage = 'auto', best_example_evals_k: int = 30, capture_stdio: bool = False) dataclass

Controls the optimization run loop: budget, parallelism, caching, and stopping.

Most users only need to set max_metric_calls (evaluation budget). Parallel evaluation is enabled by default with max_workers set to os.cpu_count() or 32 (CPU count when available, otherwise 32).

Set capture_stdio=True to automatically route any print() output inside your evaluator into ASI (under "stdout"/"stderr" keys), with no code changes needed. Useful for quick prototyping or wrapping existing evaluation scripts that already have print statements.

Attributes

run_dir: str | None = None class-attribute instance-attribute

seed: int = 0 class-attribute instance-attribute

display_progress_bar: bool = False class-attribute instance-attribute

raise_on_exception: bool = True class-attribute instance-attribute

use_cloudpickle: bool = True class-attribute instance-attribute

track_best_outputs: bool = True class-attribute instance-attribute

max_metric_calls: int | None = None class-attribute instance-attribute

max_candidate_proposals: int | None = None class-attribute instance-attribute

val_evaluation_policy: EvaluationPolicy | Literal['full_eval'] = 'full_eval' class-attribute instance-attribute

candidate_selection_strategy: CandidateSelector | Literal['pareto', 'current_best', 'epsilon_greedy', 'top_k_pareto'] = 'pareto' class-attribute instance-attribute

frontier_type: FrontierType = 'hybrid' class-attribute instance-attribute

parallel: bool = True class-attribute instance-attribute

max_workers: int | None = field(default_factory=(lambda: os.cpu_count() or 32)) class-attribute instance-attribute

cache_evaluation: bool = False class-attribute instance-attribute

cache_evaluation_storage: CacheEvaluationStorage = 'auto' class-attribute instance-attribute

best_example_evals_k: int = 30 class-attribute instance-attribute

capture_stdio: bool = False class-attribute instance-attribute

Functions