From gepa-observable-migration
Guides LLM prompt optimization with DSPy and custom GEPA: gathers datasets/graders, generates optimizing code. For DSPy/LLM users.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gepa-observable-migration:gepa-demoThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Prompt optimization is the process of improving the quality of prompts used in language models. It is often done manually, but increasingly their are frameworks (such as DSPy) being used to use LLMs to do this.
README.mdassets/gepa-demo/gepa-demo-eval.pyassets/gepa-demo/gepa-demo-script.pyassets/gepa-demo/gepa_demo_data.pyassets/gepa-demo/gepa_demo_eval.pyassets/gepa-demo/gepa_demo_metric.pyassets/gepa-demo/gepa_demo_optimize.pyassets/gepa-demo/gepa_demo_program.pyreferences/data-mapping.mdreferences/env.mdreferences/interactive-prompting.mdreferences/metrics.mdreferences/repo-setup.mdreferences/user-journeys.mdreferences/web-dashboard.mdPrompt optimization is the process of improving the quality of prompts used in language models. It is often done manually, but increasingly their are frameworks (such as DSPy) being used to use LLMs to do this.
In essence, the process involves the user providing a dataset and a grader or reward model to judge an LLM's output. A prompt's performance on the dataset is measured, the gaps in in its performance identified, and a new prompt is then proposed and tested. This runs in a loop until an end state is reached.
GEPA (which stands for GEnetic PAreto) is a prompt optimization algorithm that follows the process above. It is increasingly a popular approach to prompt optimization, and utilizes two key strategic choices compared to other algorithms:
More can be read about GEPA on this Github repo if needed.
Help users improve their prompts using our custom implementation of GEPA. Ask them for a dataset and create a grader for them (if they don't already have one), then optimize the prompt.
Our custom GEPA implementation forks the original library to provide observability into its run. The Github repo also packages a webserver which is used to visualize the process.
python --versionnode --version (Prisma requirement)npm --versiongit --versiondspy-gepa-logger repo to the current folder (if not, ask where to clone it).gepa_observable imports work from any folder.references/repo-setup.md.references/data-mapping.md for question prompts and mapping patterns.auto=light|medium|heavy OR max_full_evals OR max_metric_calls. Default to auto=light.env.local and verify API key<user-folder>/optimizer-script/.env.local with template:
OPENAI_API_KEY=sk-... # User must replace with actual key
TASK_LM=openai/gpt-5-mini
REFLECTIVE_LM=openai/gpt-5.2
JUDGE_LM=openai/gpt-5.2
your_openai_api_key_here will cause authentication errorsreferences/env.md)dspy.Example list from the dataset and call .with_inputs(...).dspy.Signature from input/output fields.dspy.Module (e.g., ChainOfThought or Predict).references/data-mapping.md for patterns.dspy.Prediction(score=float, feedback=str).Signature (e.g., JudgeSig) and call
dspy.ChainOfThought(JudgeSig) to get structured outputsreferences/metrics.md for templates.<user-folder>/optimizer-script/ and copy all files from assets/gepa-demo/ into it.gepa_demo_data.py, gepa_demo_program.py, gepa_demo_metric.py to match the dataset.gepa-demo-script.py keeps CLI args for:
--seed-prompt--auto or --max-full-evals or --max-metric-calls--server-url--project-name--log-dir--train-ratio/--val-ratiooptimizer-script/.python <user-folder>/optimizer-script/gepa-demo-eval.py --data-file <path>.score + feedback, and outputs look sane.--use-llm-judge. If scores are all zero, the judge output
is likely malformed or not being parsed.references/web-dashboard.md to start the server from the cloned repo web/ directory.npx prisma generate is run before npx prisma migrate deploycd web && npm run devpython <user-folder>/optimizer-script/gepa-demo-script.py ... with the server URLauto=medium or auto=heavy for better results)To start completely fresh:
# Stop web server
pkill -f "next dev"
# Remove directories
rm -rf optimizer-script dspy-gepa-logger
# Clear database (if needed)
rm dspy-gepa-logger/web/dev.db
# Start from step 0
Common issues:
"Incorrect API key" error
optimizer-script/.env.local with your actual API keyyour_openai_api_key_here with sk-..."Cannot find module '.prisma/client'" error
npx prisma generate in the web/ directorynpx prisma migrate deploy"Port 3000 already in use" error
lsof -i :3000 then kill the processWeb server stops unexpectedly
lsof -i :3000cd web && npm run dev"temperature not supported" error
temperature=1.0No data showing in dashboard
sqlite3 web/dev.db "SELECT COUNT(*) FROM Run;"--server-url http://localhost:3000 was passed to optimizerWhen available, use the AskUserQuestion tool for better interactivity:
This creates a more guided, interactive experience.
references/data-mapping.mdreferences/metrics.mdreferences/env.mdreferences/repo-setup.mdreferences/web-dashboard.mdreferences/interactive-prompting.mdreferences/user-journeys.mdassets/gepa-demo/npx claudepluginhub razor-ai/dspy-gepa-loggerOptimizes text artifacts (code, prompts, configs, agent architectures) using GEPA's reflective evolutionary search with a declarative API.
Optimizes DSPy programs using the dspy.GEPA reflective/evolutionary optimizer for complex tasks with rich-feedback metrics. Requires a DSPy module, metric returning dspy.Prediction, trainset, and reflection LM.
Systematically optimizes prompts using an eval set and search methods (instruction tuning, few-shot selection, decomposition) instead of manual tweaking.