API Reference GEPA v#0.3.0

Copy Markdown View Source

Modules

GEPA: Genetic-Pareto optimizer for text-based system components.

Defines the contract for integrating GEPA with external systems.

Adapter dispatch helpers used by the Elixir GEPA engine.

Basic adapter for simple Q&A tasks.

Logprob-aware classification adapter.

Confidence-aware scoring strategies for GEPA.Adapters.Confidence.

Scores correct answers as 1.0 above a probability threshold, otherwise blends linearly from min_score_on_correct to 1.0. Incorrect answers always score 0.

Scores a correct answer with a sigmoid over confidence probability: 1 / (1 + exp(-steepness * (probability - midpoint))).

Scores a correct answer as 1.0 only when confidence probability is greater than or equal to threshold; otherwise 0.0.

Official-style default adapter for simple text-in/text-out tasks.

Vector-store-agnostic RAG adapter.

Task instance for the Generic RAG adapter.

Deterministic retrieval and generation metrics for the Generic RAG adapter.

A small, adapter-local RAG pipeline used by GEPA.Adapters.GenericRAG.

Behaviour for vector-store backends used by GEPA.Adapters.GenericRAG.

Deterministic in-memory vector-store implementation for tests, examples, and local development. Similarity is simple token overlap.

Chroma vector-store placeholder behind the Generic RAG behaviour.

LanceDB vector-store placeholder behind the Generic RAG behaviour.

Milvus vector-store placeholder behind the Generic RAG behaviour.

Pgvector adapter placeholder behind the Generic RAG vector-store behaviour.

Qdrant HTTP vector-store adapter for Generic RAG.

Weaviate vector-store placeholder behind the Generic RAG behaviour.

MCP tool-use adapter.

Minimal MCP client behaviour for GEPA's Elixir adapter layer.

Placeholder SSE MCP transport config.

In-memory MCP client for tests. Tools are supplied as a map of name to %{description:, input_schema:, run:} or as {name, fun} pairs.

Placeholder stdio MCP transport config.

Placeholder Streamable HTTP MCP transport config.

Trace emitted by GEPA.Adapters.MCP when capture_traces is true.

Compatibility alias for GEPA.Adapters.MCP.

Synchronous observational callbacks for GEPA optimization runs.

Callback container that forwards events to each registered callback.

A proposed new candidate program with metadata for acceptance testing.

Rich evaluation data captured for a proposal minibatch.

Utilities for evaluating Elixir code snippets with captured outputs.

Protocol-style data access abstraction.

In-memory loader using zero-based integer IDs.

Behaviour and facade for embedding providers.

ReqLLM-backed embedding provider.

Main optimization engine for GEPA.

Container for per-example evaluation results returned by an adapter.

Cache for validation evaluations keyed by candidate content and example id.

Cached result for one candidate/example pair.

Image data wrapper for visual side-information in GEPA.OptimizeAnything.

Behavior and facade for Language Model integrations.

GEPA LLM adapter backed by Agent Session Manager.

GEPA LLM adapter backed by ReqLLM.

Capability helpers for GEPA LLM adapters.

Normalized LLM client used by the GEPA LLM facade.

Mock LLM implementation for testing.

Backward-compatible ReqLLM implementation.

Normalized request passed from GEPA to LLM adapters.

Normalized LLM adapter response.

GEPA-facing portable tool specification.

Wraps arbitrary callable LLMs with lightweight token/cost accounting.

Upstream-compatible LM wrapper for reflection models.

Compatibility alias for tracking arbitrary callable LMs.

Optimize an arbitrary candidate with a user-supplied evaluator.

Internal adapter that lets optimize_anything use the normal GEPA engine.

Normalizes user evaluator signatures and return values.

Process-local diagnostic log context used by optimize-anything evaluators.

Propagatable optimize-anything evaluator log context.

Historical per-example context injected into optimize-anything evaluators.

Simple progress display for GEPA optimization.

Behavior for candidate proposal strategies.

LLM-based instruction proposal with configurable templates.

Official-compatible merge proposer.

Genealogy and triplet-selection helpers for the merge proposer.

Reflective mutation proposer.

Immutable result container for GEPA optimization.

Helpers for upstream-compatible LLM seed candidate generation.

Persistent state tracking the complete optimization history.

Behavior for stop conditions that control when optimization terminates.

Combines multiple stop conditions with AND/OR logic.

Stops optimization when a configured file exists.

Stops after a maximum number of metric evaluations.

Stops after a maximum number of proposal iterations.

Stops when a reflection LLM's reported cumulative cost reaches a budget.

Stops after a maximum number of tracked candidate programs.

Stops when no improvement observed for patience iterations.

Stops once the best aggregate validation score reaches a threshold.

BEAM-friendly signal/interrupt stopper.

Time-based stop condition.

Acceptance criteria for proposed GEPA candidates.

Accept if the new subsample score sum is greater than or equal to the old sum.

Accept only if the new subsample score sum is strictly greater than the old sum.

Behaviour for sampling training data into minibatches.

Epoch-shuffled sampler matching the Python reference semantics.

Simple deterministic circular sampler.

Behavior for selecting which program candidate to mutate.

Greedy selector - always picks the highest-scoring program.

Epsilon-greedy candidate selector with optional decay.

Selects candidates from Pareto front using frequency-weighted sampling.

Selects randomly from the top-k scoring candidates on the Pareto frontier.

Behaviour for selecting which named candidate components should be updated.

Update all candidate components together.

Official-style round-robin component selector.

Behavior for validation evaluation policies.

Always evaluates all validation examples.

Incremental evaluation policy - progressively evaluates validation set.

Telemetry helpers for GEPA.

Experiment tracking behavior and built-in trackers.

Dependency-free experiment tracker compatible with the upstream tracker API.

In-memory tracker backed by an Agent.

MLflow tracker placeholder behind GEPA.Tracking.

Tracker that discards all metrics.

W&B tracker placeholder behind GEPA.Tracking.

Shared type specifications for GEPA.

Compatibility facade for GEPA utility functions.

Pareto-front utilities used for candidate selection and merge parent choice.

Candidate-lineage visualization helpers.