0c65387a5f
Route contract is now a JSON array of action objects (one per ask) so
compound utterances route all their intents, not just the first. Grammar
root emits `[{intent...},...]`; parseActions tolerates a bare object.
Cascade still returns one Decision — full N-action dispatch lands with the
engine turn-on (marked in-code).
Router prompt rewritten shorter + decision-ordered (prompt-guy feedback),
fact redefined as "implicit update" not "trackable state", kept in Russian
to match the CPT base + phraser. "интент" → "намерение".
CLAUDE.md: routing-architecture section + refreshed open items.
docs/plans: route-data generation plan.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GMrVfuYN3nE4L1vEiFYC9
2.2 KiB
2.2 KiB
Route-training data plan (LLM-as-router)
Goal: training data that teaches the CPT'd Qwen3-1.7B to emit the route
contract — {"intent":<enum>, key?, value?, text?, verb?}, GBNF-constrained —
matching internal/router/llmrouter.go (routeSystem + routeGrammar) verbatim.
Train=deploy parity: label with the EXACT prompt the daemon sends.
7 intents: fact, reminder, note, query, act, chat, system. Hard cases (grammar
can't enforce): note vs reminder («запомни» vs «напомни»), fact vs note (trackable
state vs static memo).
Steps
- Source utterances — real RU turns, not synthetic. Main:
function_calling.jsonl(473); plususer-*.jsonlfragments for chat/fact/system coverage.gen_route_data.pydedups across all. - Relabel, don't convert — old taxonomy (time/weather/timer) ≠ 7 intents. Feed
each utterance through
routeSystemto a strong router model → take its{intent,...}. - Validate — intent ∈ enum, keys ⊆ {intent,key,value,text,verb}. Drop invalid.
- Balance check — after a run, count intents.
act/system/factlikely thin (function_calling skews query/act). Author extra examples for the holes; re-run. - Better prompt first — improve
routeSystemfor sub-1B disambiguation before a big generation run (awaiting prompt-guy input). Re-labeling is cheap; regenerate. - Train — route-LoRA on top of CPT base, OR fold into the persona SFT as a second contract (decide once volume known). Eval = route accuracy on a held-out REAL set.
Blocking
- Router at
inference.kvmx.ru/localhost:6446must be up (currently down). - CPT must finish before the route-LoRA trains on it.
Files
esp32-whisper-fine-tune/llm/gen_route_data.py— the relabeler (done, self-checks).ROUTE_SYSTEMconst = verbatim copy of GorouteSystem; keep in sync.- Output:
llm/data/route_train.jsonl(resumable append).
Prompt-guy question (sent 2026-07-11)
How to structure the router system prompt for a sub-1B model doing 7-intent classification + slot extraction, GBNF-constrained — example ordering/count, contrastive near-miss pairs (note vs reminder) vs more singles, rule placement.