From gepa-observable-migration
Migrates DSPy GEPA code to gepa-observable for observability: real-time dashboard, LM call logging, stdout capture, and custom observers tracking 8 optimization lifecycle events.
How this skill is triggered — by the user, by Claude, or both
Slash command
/gepa-observable-migration:migrate-gepaThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Migrate existing DSPy GEPA code to gepa-observable for integrated observability:
Migrate existing DSPy GEPA code to gepa-observable for integrated observability: real-time dashboard, custom observer callbacks, and LM call capture working together.
pip install dspy-gepa-logger
# Before
from dspy.teleprompt import GEPA
# After
from gepa_observable import GEPA
from gepa_observable import GEPA
optimizer = GEPA(
metric=my_metric,
auto="medium",
# Observability system:
server_url="http://your-server:3000", # Dashboard integration
project_name="My Project",
capture_lm_calls=True, # LM call logging
capture_stdout=True, # Console capture
verbose=True, # LoggingObserver
observers=[MyCustomObserver()], # Custom callbacks
)
optimizer.compile(student=program, trainset=train, valset=val)gepa-observable provides an integrated observability system where all components work together:
| Component | Purpose | Enabled By |
|---|---|---|
| ServerObserver | Sends events to web dashboard | server_url param |
| LoggingObserver | Console output with summaries | verbose=True |
| LM Call Logger | Captures all LM invocations | capture_lm_calls=True |
| Custom Observers | Your callbacks for any event | observers=[...] |
All observers receive the same 8 lifecycle events:
SeedValidationEvent - Initial validation scoresIterationStartEvent - Each optimization iterationMiniBatchEvalEvent - Minibatch evaluationsReflectionEvent - Proposed prompt changesAcceptanceDecisionEvent - Accept/reject decisionsValsetEvalEvent - Full validation evaluationsMergeEvent - Candidate merge operationsOptimizationCompleteEvent - Final resultsclass MyObserver:
def on_seed_validation(self, event):
avg = sum(event.valset_scores.values()) / len(event.valset_scores)
print(f"Seed score: {avg:.2%}")
def on_iteration_start(self, event):
print(f"Iteration {event.iteration}, parent score: {event.parent_score:.2%}")
def on_reflection(self, event):
for comp, text in event.proposed_texts.items():
print(f"Proposing for {comp}: {text[:100]}...")
def on_valset_eval(self, event):
if event.is_new_best:
print(f"NEW BEST: {event.valset_score:.2%}")
def on_optimization_complete(self, event):
print(f"Done! Best: {event.best_score:.2%} in {event.total_iterations} iters")
# Use with other observers - they all work together
optimizer = GEPA(
metric=my_metric,
auto="medium",
server_url="http://localhost:3000",
observers=[MyObserver()],
verbose=True, # Also keep LoggingObserver
)
pip install dspy-gepa-loggerfrom gepa_observable import GEPAserver_url for dashboardpip install dspy-gepa-loggerfrom dspy.teleprompt import GEPAreferences/api-reference.md - Complete parameter docs, observer protocol, all event typesreferences/examples.md - Full before/after code examplesnpx claudepluginhub razor-ai/dspy-gepa-loggerOptimizes 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.
Optimizes text artifacts (code, prompts, configs, agent architectures) using GEPA's reflective evolutionary search with a declarative API.
Optimizes project's target file using GEPA algorithm: proposes candidates, evaluates in isolated git worktrees with benchmarks and gates until budget or stall.