GEPA Elixir Logo

GEPA for Elixir

Hex.pmElixirOTPTestsCoverageLicense

GEPA for Elixir is a library for optimizing text-based system components with LLM-backed reflection, Pareto search, and evaluator-driven workflows.

Installation

Add gepa_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:gepa_ex, "~> 0.2.0"}
  ]
end

Start Here

Quick Start

llm = GEPA.LLM.req_llm(:openai)
adapter = GEPA.Adapters.Basic.new(llm: llm)

{:ok, result} =
  GEPA.optimize(
    seed_candidate: %{"instruction" => "Answer exactly."},
    trainset: [%{input: "What is 2+2?", answer: "4"}],
    valset: [%{input: "What is 5+5?", answer: "10"}],
    adapter: adapter,
    max_metric_calls: 20
  )

IO.puts("Best score: #{GEPA.Result.best_score(result)}")

For evaluator-driven tasks, use GEPA.OptimizeAnything.optimize_anything/1 and provide a candidate, evaluator, dataset, and objective text.

What Ships

Examples and Livebooks

The scripts and notebooks are tied to the current codebase and should be read alongside the guide set above.

HexDocs

The full API reference is generated from mix.exs and the module docs in lib/. The guide menu now lives under guides/*.md.

Changelog

See CHANGELOG.md for release notes.