[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-78900":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":15,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":9,"pushedAt":9,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":17,"lastSyncTime":26,"discoverSource":27},78900,"gepa-viz","modaic-ai\u002Fgepa-viz","modaic-ai","Interactive live visualizer for gepa runs",null,"TypeScript",405,30,1,0,23,316,2,62.97,false,"main",true,[],"2026-06-12 04:01:24","# gepa-viz\n\n![demo](assets\u002Fful-gepa-run-viz-trimmed.gif)\n\nLive visualization for [GEPA](https:\u002F\u002Fgithub.com\u002Fgepa-ai\u002Fgepa) prompt-optimization runs. Renders the candidate tree as a force-directed graph so you can watch prompts evolve over a pareto frontier in real time.\n\n- **Accepted candidates** are donuts whose ring segments are green\u002Fred per per-example valset score.\n- **Rejected proposals** are small grey nodes (hover to see the feedback that produced them).\n- **Click a node** for a detail view: the candidate prompt, prompt diff vs parent, reflection minibatch with per-example feedback, and the pareto frontier as a clickable pixel grid.\n\n\n## Install (end users)\n\n```bash\npip install gepa-viz\n```\n\n`GepaVizCallback` is a context manager. Entering it streams the run into the\ndashboard; exiting dumps a `run.json` artifact. There are three ways to use it.\n\n### 1. Embedded (default) — the callback runs its own viewer\n\nEntering `with GepaVizCallback(...)` spins up a local server and opens a browser\ntab; the graph extends node-by-node over SSE as GEPA accepts and rejects\nproposals. Exiting dumps `run.json` and keeps the viewer alive until you Ctrl+C.\nNo second terminal, no CLI step. Works equally with DSPy or base `gepa`:\n\n```python\nfrom gepa_viz import GepaVizCallback\n\n# DSPy\nwith GepaVizCallback(valset=valset, trainset=trainset) as cb:\n    dspy.GEPA(\n        metric=..., auto=\"light\", reflection_lm=...,\n        gepa_kwargs={\"callbacks\": [cb]},\n    ).compile(student, trainset=trainset, valset=valset)\n\n# Base gepa\nwith GepaVizCallback(valset=valset, trainset=trainset) as cb:\n    gepa.optimize(..., callbacks=[cb])\n```\n\n### 2. Remote — stream into a standalone server\n\nRun one long-lived server and point the callback at it with `endpoint=`. The\ncallback starts no server of its own; it POSTs snapshots to `\u003Cendpoint>\u002Fingest`\nand the server fans them out to connected browsers over SSE. Useful when the\noptimizer runs on a different machine (`gepa-viz live --host 0.0.0.0`).\n\n```bash\ngepa-viz live          # serves the SPA + \u002Fevents + \u002Fingest on :5151\n```\n\n```python\nwith GepaVizCallback(valset=valset, trainset=trainset,\n                     endpoint=\"http:\u002F\u002F127.0.0.1:5151\") as cb:\n    dspy.GEPA(..., gepa_kwargs={\"callbacks\": [cb]}).compile(student, ...)\n```\n\n### 3. Static — dump now, view later\n\nPass `live=False` for a headless\u002FCI run that just writes `run.json` at the end,\nthen re-open it any time in a static viewer (loads once, no streaming):\n\n```python\nwith GepaVizCallback(valset=valset, live=False, path=\"run.json\") as cb:\n    dspy.GEPA(..., gepa_kwargs={\"callbacks\": [cb]}).compile(student, ...)\n```\n\n```bash\ngepa-viz serve --file run.json\n```\n\n`GepaVizCallback` options: `path`, `trainset`, `live` (default `True`), `host`\n(`127.0.0.1`), `port` (`5151`), `open_browser` (`True`), `keep_alive` (`True`),\n`endpoint` (`None`), `endpoint_timeout` (`5.0`).\n\n## Reading the Visualization\n\n### Big Nodes\n![big-nodes](assets\u002Fpareto-comparison.gif)\nBig nodes are candidates that were evaluated on the valset. Each segment on the ring is a seperate example. Red segments are examples the candidate got wrong and green are examples the candidate got right.\n\nAs you can see candidates 1 and 2 have the same accuracy but performed well on different examples.\n\n## Node Details\n![node-details](assets\u002Fnode-details-page.gif)\nNode details page shows information for the candidate in more depth.\n**Valset Results**\nThe grid at the top shows the candidates response to each example and whether it got it right or wrong. \n\n**Prompt**\nShows the prompt for the candidate. Use the toggle switch to see the diff between the prompt and its parent.\n\n**Mini-Batch**\nThe mini batch results for the candidate. Diffs show the difference between the initial attempt and the post-reflection attempt on the minibatch.\n\n## Small Nodes\n![small-nodes](assets\u002Frejected-node.gif)\nThe small grey nodes are candidates that were rejected at the minibatch phase. After reflection the mini-batch was retried and the score didn't go up. Therefore they were never evaluated on the valset and aren't on the pareto frontier, however you can view their in depth details all the same.\n\n## Edges\n![edges-hover](assets\u002Ffeedback-edges.gif)\nIf you hover on the edges in the graph you will see the feedback that was given to the reflection model to generate the child candidate.\n\n\n\n\n\n## CLI\n\n```\ngepa-viz serve [--file PATH] [--host HOST] [--port N] [--open | --no-open]\ngepa-viz live  [--host HOST] [--port N] [--open | --no-open]\n```\n\n- `serve` — **static** viewer for a dumped `run.json` (loads once, no polling).\n  Defaults: `--file .\u002Frun.json`, `--host 127.0.0.1`, `--port 5151`.\n- `live` — **live** server a remote producer streams into via `\u002Fingest`; serves\n  the SPA and pushes updates to browsers over SSE.\n\nThe server is a tiny stdlib `ThreadingHTTPServer` — no Node, no extra runtime.\n\n## Repo layout\n\n```\ngepa-viz\u002F\n  client\u002F      # Vite SPA (React + react-router + d3 + Tailwind)\n  python\u002F      # gepa_viz Python package (callback + CLI + bundled SPA)\n  justfile     # build automation\n```\n\nThe end-user wheel ships the pre-built SPA inside `gepa_viz\u002Fstatic\u002F` so installation is just `pip install`.\n\n## Develop\n\nPrerequisites: `node`, `npm`, `uv`, `just`.\n\n```bash\njust install         # npm ci + uv sync\njust dev-client      # Vite dev server with HMR on :5173\njust dev-py          # run examples\u002Fdemo_run.py (needs OPENAI_API_KEY)\njust build           # build SPA + bundle into wheel → python\u002Fdist\u002F*.whl\njust serve           # run gepa-viz serve from the source tree\njust lint            # ESLint on src\u002F\njust clean\n```\n\nDuring development the SPA reads `run.json` from `client\u002Fpublic\u002Frun.json` (Vite serves it as a static asset). The Python callback writes there by default when it detects it's running inside the repo. For production-style testing, run `just build` and `pip install python\u002Fdist\u002F*.whl` into a throwaway venv.\n\n## Schema\n\nThe callback writes a JSON file with this shape (the SPA reads from it; you can also hand-craft a `run.json` for offline browsing):\n\n```jsonc\n{\n  \"examples\": [\n    { \u002F* arbitrary input fields *\u002F, \"ground_truth\": { \u002F* output fields *\u002F } }\n  ],\n  \"candidates\": {\n    \"0\":   { \"prompt\": \"...\", \"parent\": null, \"score\": 0.62,\n             \"predictions\": [{\"prediction\": {...}, \"score\": 1.0}], \"minibatch\": null },\n    \"0.1\": { \"prompt\": \"...\", \"parent\": \"0\",  \"score\": null,\n             \"predictions\": null,\n             \"minibatch\": [{\"example\": {...}, \"parent_prediction\": {...},\n                            \"parent_score\": 0.0, \"prediction\": {...},\n                            \"score\": 0.0, \"feedback\": \"...\"}] },\n    \"1\":   { \"prompt\": \"...\", \"parent\": \"0\",  \"score\": 0.81, \"predictions\": [...], \"minibatch\": [...] }\n  }\n}\n```\n\n- **Accepted candidate ids** are integer strings (`\"0\"`, `\"1\"`, `\"2\"`, …), matching gepa's internal index.\n- **Rejected candidate ids** are `\"\u003Cparent>.\u003Cn>\"` with `n` starting at 1 per parent.\n\n## License\n\nMIT.\n","gepa-viz 是一个用于GEPA运行的交互式实时可视化工具。它使用TypeScript开发，能够将候选提示优化过程以力导向图的形式展示，使用户可以实时观察提示在帕累托前沿上的演变。该工具通过不同颜色和大小的节点区分接受和拒绝的提案，并提供点击节点查看详细信息的功能，如候选提示、与父提示的差异、反馈小批量以及可点击的帕累托前沿网格。适用于需要对基于GEPA算法的提示优化过程进行直观监控和分析的场景，无论是嵌入式使用还是远程流式传输，甚至是在静态模式下回顾历史运行数据都非常方便。","2026-06-11 03:57:17","CREATED_QUERY"]