Dsxir.Optimizer.GEPA (dsxir v0.4.0)

Copy Markdown

Reflective + Pareto-frontier evolutionary optimizer. Implements @behaviour Dsxir.Optimizer and all four checkpointable callbacks, so it drops into Dsxir.OptimizerSession exactly the way MIPROv2 does.

Public API:

{:ok, compiled, stats} =
  Dsxir.compile(Dsxir.Optimizer.GEPA, program, trainset, metric, auto: :medium)

Session mode:

{:ok, compiled, stats} =
  Dsxir.OptimizerSession.compile(Dsxir.Optimizer.GEPA, program, trainset, metric,
                                   opts: [auto: :light])

See Dsxir.Optimizer.GEPA.Auto for :auto presets.

Options

  • :auto (default :medium) - preset for population size, operator weights, rollout K, etc. :light | :medium | :heavy.
  • :reflective_lm (default: settings task LM) - {module, keyword()} tuple for the LM that performs reflective mutations.
  • Any preset key (:num_trials, :operator_weights, etc.) - overrides preset.

Returned stats

Dsxir.Optimizer.GEPA.Stats.t/0. See module doc for fields.

Summary

Functions

Single-trial step. Always returns {:cont, sampler, trial} or {:halt, sampler, :budget_exhausted}; recognised exception classes are caught inside Trial.run/1 and surfaced as an :error-status trial record (and degraded: true on the returned sampler). The session driver decides whether to halt on accumulated errors.

Functions

step(sampler, trial_idx, program, trainset, metric, opts)

Single-trial step. Always returns {:cont, sampler, trial} or {:halt, sampler, :budget_exhausted}; recognised exception classes are caught inside Trial.run/1 and surfaced as an :error-status trial record (and degraded: true on the returned sampler). The session driver decides whether to halt on accumulated errors.