- proposes new instruction candidates as rewards arrive
- selects candidates via a proxy URL (prompt substitution)
- tracks per-candidate reward statistics and a live best prompt
Prerequisites
- Python 3.11+
uvpackage managerSYNTH_API_KEYset in your environment- Access to a Synth backend (default is production)
Run The Demo Script
From thesynth-ai repo:
Local Dev (backend on your laptop)
If you are running the backend locally (compose infra + host processes), point the demo at localhost:baseline as the candidate, your proposer is not running.
For local dev, ensure the Rust backend has DEV_OPENAI_API_KEY set (or override the proposer model to one you have access to):
What Happens
- The demo creates an online GEPA session via
GepaOnlineSession. - The backend returns a proxy URL (e.g.
/api/gepa/v1/{session_id}/chat/completions). - The demo calls the proxy URL for each LLM call.
- The proxy injects the currently-selected candidate instruction into the request (system message).
- The demo computes a reward (correct intent label or not) and reports it back to the session.
- Once enough rewards arrive, the backend proposes new instruction candidates and the proxy starts serving them.