Skip to content

fix: update GEPA construction for DSPy 3#56

Closed
steezkelly wants to merge 1 commit into
NousResearch:mainfrom
steezkelly:fix/10-dspy-gepa-api
Closed

fix: update GEPA construction for DSPy 3#56
steezkelly wants to merge 1 commit into
NousResearch:mainfrom
steezkelly:fix/10-dspy-gepa-api

Conversation

@steezkelly
Copy link
Copy Markdown

Summary

Fixes DSPy 3.x GEPA construction for skill evolution:

  • removes the obsolete max_steps argument from dspy.GEPA(...)
  • adds a reflection LM from the existing optimizer_model parameter
  • uses bounded max_metric_calls as the DSPy 3.x optimization budget
  • isolates GEPA construction in _create_gepa_optimizer(...) so future DSPy API drift is easier to test
  • adds regression tests that verify max_steps is not passed, reflection_lm is set, and zero iterations clamp to at least one metric call

Root cause

DSPy >=3.1 removed max_steps from GEPA and requires a reflection LM or instruction proposer. The previous code always raised during GEPA construction and silently fell back to MIPROv2.

Test Plan

  • pytest tests/skills/test_evolve_skill_gepa.py -q
  • pytest -q
  • runtime signature probe: inspect.signature(dspy.GEPA) confirms max_steps is absent and max_metric_calls / reflection_lm are present
  • static added-line security scan for secrets/shell injection/eval/pickle/SQL string formatting
  • independent code review pass

Result: 141 passed, 11 warnings (DSPy deprecation warnings only).

Closes #10

@steezkelly
Copy link
Copy Markdown
Author

Closing this PR in favor of consolidated PR #68. Local integration found real helper-block overlap in evolution/skills/evolve_skill.py across the stack, and #68 preserves local test evidence: targeted stack tests 41 passed; full suite 164 passed; GitHub checks were absent on the split PRs. Review #68 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GEPA optimizer fails with DSPy >=3.1: max_steps is not a valid parameter

1 participant