Training an In-House Orchestrator
Replacing the Claude API at the centre of our agent harness with a self-hosted, fine-tuned orchestrator — the model that plans, routes, and decides across every turn.
The plan so far — and where we stand
This deck lays out the plan to bring the orchestrator in-house. Here is that plan in brief — and the ground covered since.
From Gemma-3-4B to Qwen-3.5-4B
The first fine-tune plateaued at low routing accuracy. Diagnosis pointed at the data, not the model — but we also moved to a stronger, better-fit base.
The Golden set — scraped from the live platform
Our single frozen source of truth for every promotion decision: 94 sessions, 470 turns, 3,357 decision points — never trained on.
How we measured it — replay-based eval
Each golden session is replayed like a film reel: the model is quizzed at every decision the original assistant faced, then scored by deterministic code.
Zero-shot baseline: where 1,711 decisions landed
Untrained Qwen-3.5-4B on the frozen Golden set — 37.5% overall pass (strict 32.6%). 1,711 of 3,357 decision points fit the 18k window and were scored.
Generic tools work; platform conventions don't
The baseline splits cleanly: the model already knows universal tools, but fails the platform's own conventions — precisely what fine-tuning must teach.
The scoreboard: baseline vs post-SFT
Same frozen cases, same deterministic scoring, same serving config — the report diff is the training effect, isolated. The post-SFT column is a placeholder until the v2 QLoRA run lands.
Why the old synthetic data capped accuracy
The Tier A + B corpus (1,000 sessions / 8,899 decision points) was structurally valid — but taught the hardest decision inconsistently.
Repaired Tier A/B + a new Tier-C wave
One written routing policy, the old corpus repaired against it, then new boundary-focused data — all serialized for the Qwen stack.
What one SFT datapoint looks like
One JSONL record = one full multi-turn session. 1,232 records carry 9,488 assistant decision points — the model is trained only on the assistant's spans.
Two datasets, two schemas — and why
The same session data underneath, but a training target and an eval spec do opposite jobs — so their shapes differ.
Post-eval → aimed fire: error-driven SFT round 2
The post-eval report is a failure map, not training data. Every failing verdict names a tool, a convention and an argument schema — round 2 authors fresh data at exactly those coordinates.
Inside a GRPO step — how it actually learns
GRPO needs no critic model: it samples a group of answers to the same state, scores them, and pushes the policy toward the better-than-average ones.
The dataset is trivial — the reward is the work
Sample G completions per orchestration state (G ≈ 8–16), score each, optimise toward the relatively better ones. Dataset = prompts only.
What the RL stages actually consume
Unlike SFT, neither RL record stores a target action. GRPO scores live completions; DPO compares two stored ones.
Nemotron Super as the self-hosted RL judge
GRPO runs G rollouts × many steps × many prompts — judge volume is enormous. On the Claude API that's a budget bonfire; on Nemotron Super (bipardai02, already deployed via vLLM) it's compute we own. Bonus: it decorrelates from Claude, which wrote the SFT data.
Train on the model's own mistake states
The single biggest cause of agent failure: the model errs at step 3, lands in a state no expert trace ever visited, and has no idea what to do.
Define success before we spend GPU time
Every promotion decision — keep training, swap the base, ship — is gated on these. Without them, 'is it good enough?' has no answer.
The swap is a config change, not a rebuild
The LLM Gateway already routes each logical slot to a concrete provider + model via DB config, with a fallback chain and per-vendor adapters. The orchestrator becomes one more provider behind that same interface.