dspy-gepa

Installation
SKILL.md

Instruction Optimization with dspy.GEPA

Guide the user through using dspy.GEPA to automatically discover better instructions for their DSPy programs through reflective evolution.

What is dspy.GEPA

dspy.GEPA is a DSPy optimizer that evolves the instruction text in your program's predictors. Rather than adding few-shot examples (like BootstrapFewShot) or tuning model weights (like BootstrapFinetune), GEPA iteratively proposes, evaluates, and refines the natural-language instructions that guide each LM call.

Key properties:

  • Tunes instructions only -- no few-shot demos are injected into prompts, keeping them compact
  • Uses textual feedback -- a reflection LM reads execution traces and failure feedback to propose better instructions, not just scalar scores
  • Maintains a Pareto frontier -- tracks multiple candidate programs that excel on different subsets, then merges the best traits
  • Works with ~50 examples -- needs less data than MIPROv2 or BootstrapFewShotWithRandomSearch
  • Supports per-predictor feedback -- metrics can return targeted feedback for individual predictors in multi-step pipelines

When to use GEPA

Use dspy.GEPA when:

Related skills

More from lebsral/dspy-programming-not-prompting-lms-skills

Installs
4
GitHub Stars
5
First Seen
Mar 17, 2026