dspy-gepa-optimizer
Installation
SKILL.md
DSPy GEPA Optimizer (3.2.x)
GEPA (Genetic-Pareto) is a reflective optimizer: it mutates a program's instructions and few-shots using an LM that reads your metric's textual feedback and proposes improvements. It maintains a Pareto frontier across validation tasks and is the default recommendation for complex DSPy workloads in 2026.
The expansion "Genetic-Evolutionary Prompt Adaptation" that appears in some AI-generated summaries is an LLM-hallucinated backronym. The paper defines GEPA as Genetic-Pareto; the "Pareto" is load-bearing (GEPA keeps a frontier of candidates rather than collapsing to one).
Prerequisites — do these first or GEPA wastes rollouts
- A
dspy.Modulethat runs end-to-end (seedspy-fundamentals). - A rich-feedback metric returning
dspy.Prediction(score=float, feedback=str)(seedspy-evaluation-harness). A float-only metric makes GEPA no better than MIPRO. A dict with the same fields still crashesdspy.Evaluateunder DSPy 3.2.1 — usedspy.Prediction. trainsetand a separatevalset. For GEPA, maximize training examples and keep validation just large enough to represent the downstream distribution; do not reuse the same examples for both.- A
reflection_lm— a strong LM (often the same or stronger than the task LM) set totemperature=1.0for creative proposals. Current DSPy docs use a GPT-5-class reflection model with a large output budget.
Canonical call
import dspy