Wire corrections system for LLM output training data #31

Closed
opened 2026-04-09 23:54:43 -07:00 by pyr0ball · 0 comments
Owner

Summary

Wire the shared make_corrections_router() from circuitforge-core into this product so users can submit thumbs-up/down feedback and corrections on LLM output. This feeds the Avocet SFT training pipeline.

Reference implementation

Linnet has the full reference implementation:

  • linnet/app/db.py — SQLite layer with get_db FastAPI dependency
  • linnet/app/migrations/001_corrections.sql — corrections table schema
  • linnet/app/api/corrections.py — wires make_corrections_router(get_db, product="linnet")
  • linnet/frontend/src/components/CorrectionWidget.vue — thumbs up/down + correction form + praise form

Steps

  1. Add a SQLite DB layer (app/db.py) if not already present, with get_db dependency and migration runner
  2. Add a corrections migration SQL file — copy schema from linnet
  3. Add app/api/corrections.py wiring make_corrections_router(get_db=get_db, product="<slug>")
  4. Register the router in main.py at prefix /corrections
  5. Add /corrections to the Vite proxy config (frontend dev server)
  6. Drop CorrectionWidget.vue into the relevant output-display component
  7. Thumbs-up: auto-set opted_in=True (no user text to consent to); praise text goes in context.praise
  8. Thumbs-down: show correction form with opt-in checkbox

Notes

  • Only opted_in=1 rows export via GET /corrections/export (JSONL for Avocet SFT pipeline)
  • corrected_output must be non-empty for rating=down; empty is valid for rating=up
  • circuitforge_core.api.make_corrections_router available from v0.9.1+
## Summary Wire the shared `make_corrections_router()` from `circuitforge-core` into this product so users can submit thumbs-up/down feedback and corrections on LLM output. This feeds the Avocet SFT training pipeline. ## Reference implementation Linnet has the full reference implementation: - `linnet/app/db.py` — SQLite layer with `get_db` FastAPI dependency - `linnet/app/migrations/001_corrections.sql` — corrections table schema - `linnet/app/api/corrections.py` — wires `make_corrections_router(get_db, product="linnet")` - `linnet/frontend/src/components/CorrectionWidget.vue` — thumbs up/down + correction form + praise form ## Steps 1. Add a SQLite DB layer (`app/db.py`) if not already present, with `get_db` dependency and migration runner 2. Add a corrections migration SQL file — copy schema from linnet 3. Add `app/api/corrections.py` wiring `make_corrections_router(get_db=get_db, product="<slug>")` 4. Register the router in `main.py` at prefix `/corrections` 5. Add `/corrections` to the Vite proxy config (frontend dev server) 6. Drop `CorrectionWidget.vue` into the relevant output-display component 7. Thumbs-up: auto-set `opted_in=True` (no user text to consent to); praise text goes in `context.praise` 8. Thumbs-down: show correction form with opt-in checkbox ## Notes - Only `opted_in=1` rows export via `GET /corrections/export` (JSONL for Avocet SFT pipeline) - `corrected_output` must be non-empty for `rating=down`; empty is valid for `rating=up` - `circuitforge_core.api.make_corrections_router` available from v0.9.1+
pyr0ball added the
enhancement
label 2026-04-09 23:59:01 -07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/snipe#31
No description provided.