dspy-gepa
Original:🇺🇸 English
Translated
3 scripts
Evaluates and optimizes agent skills using a DSPy-powered GEPA (Generate/Evaluate/Propose/Apply) loop. Loads scenario YAML files as DSPy datasets, scores outputs with pattern-matching metrics, and optimizes prompts via BootstrapFewShot or MIPROv2 teleprompters. Also generates new scenario YAML files from skill descriptions.
10installs
Sourceqredence/skills
Added on
NPX Install
npx skill4agent add qredence/skills dspy-gepaTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →DSPy GEPA — Generate, Evaluate, Propose, Apply
GEPA is a DSPy-powered tool for evaluating, optimizing, and generating skill scenarios.
Quick Start
Requires Python 3.10+ with , , and :
dspypyyamljsonschemabash
pip install dspy-ai pyyaml jsonschemaGenerate New Scenarios
Point GEPA at an existing skill to generate new test scenarios:
bash
python scripts/gepa.py generate \
--skill-description "Creates FastAPI routers with CRUD endpoints" \
--skill-name fastapi-router-py \
--num-scenarios 5 \
--output tests/scenarios/fastapi-router-py/generated.yamlOr expand an existing scenario file with more variations:
bash
python scripts/gepa.py generate \
--scenarios tests/scenarios/fastapi-router-py/scenarios.yaml \
--num-scenarios 3 \
--output new-scenarios.yamlEvaluate Scenarios
Score a DSPy program against scenario patterns:
bash
python scripts/gepa_evaluate.py \
--scenarios tests/scenarios/fastapi-router-py/scenarios.yamlFull GEPA Loop
Evaluate baseline → optimize → evaluate optimized → save:
bash
python scripts/gepa.py optimize \
--scenarios tests/scenarios/fastapi-router-py/scenarios.yaml \
--output optimized_program.jsonConvert Scenarios to Dataset
bash
python scripts/scenario_to_dataset.py \
--scenarios tests/scenarios/fastapi-router-py/scenarios.yaml \
--output dataset.jsonArchitecture
See for the full GEPA loop design and DSPy mapping.
references/gepa-architecture.mdMetrics
See for pattern-matching scoring details.
references/metrics.mdExample Output
See for a complete CLI session with output.
examples/sample-run.md