← TinyGPT · docs · devlog · roadmap · speedup
source: docs/prds/B5-cloud-escalate-training.md · view on GitHub ↗

PRD — Teach the specialist when to defer to cloud

Goal

Train a specialist to emit {"defer_to_cloud": true, "reason": "..."} when it shouldn’t answer itself — too uncertain, off-domain, or explicitly destructive — instead of fabricating. Today’s tinygpt agent --cloud-escalate is a runtime policy: a regex over the response that triggers cloud retry. B5 makes escalation a trained behavior: the model learns to emit the signal.

Why now

Scope — in

Scope — out

Files to touch

FileChange
Sources/TinyGPT/BuildEscalateData.swiftnew — labels .atraj rollouts using the existing cloud-escalate path
Sources/TinyGPT/EvalEscalate.swiftnew — eval harness
Sources/TinyGPTServe/AgentLoop.swiftrecognize the trained defer_to_cloud field; fall back to regex only when missing
docs/recipes/cloud-escalate-train.mdnew — recipe
docs/PLAN.mdB5 ⬜ → ✅ on ship

Acceptance criteria

Reference patterns

Open questions