Skip to content

feat: model routing by task weight — RuleRouter baseline, LayaRouter via systemone #586

Closed

Description

@ajianaz

What problem does this solve?

Running every task on the strongest model is expensive; routing helps (FrugalGPT, Hybrid LLM, RouteLLM) but many routers fail to beat a simple baseline (LLMRouterBench, ACL 2026) and over-select the most expensive model under loose budgets (NeurIPS 2026).

Proposed solution

ModelRouter with two adapters, per docs/profiles-collaboration-secrets.md A9–A10:

  • route(task_brief, profile, budget_left) -> Route { tier, source, confidence, reason }.
  • Precedence: owner's explicit choice → role pin (scribe = light) → router → profile default.
  • RuleRouter (always available): role, risk tier of needed tools, expected files changed.
  • LayaRouter: reuses the systemone client internally (not the model-facing tool); fixed literal questions over a short owner-side brief, never raw tool output; used only at confidence ≥ 0.85, else RuleRouter. On/off = SYSTEMONE_API_KEY + SYSTEMONE_BASE_URL (hosted codecoradev/laya-service-rust); down or 503 → RuleRouter.
  • Ties go to the cheaper tier; the budget caps the tier; route per delegation and per discussion participant, not per turn (prompt cache); one bounded escalation on failure; every decision is a ledger entry (cached by brief hash; laya is deterministic).
  • Adoption gate: LayaRouter becomes the default only if it beats RuleRouter on success and cost in evals/ Tier 2.
  • tole doctor reports router state and laya /healthz.

Alternatives considered

LLM self-routing (costly, a weak model rarely knows when to escalate); per-turn switching (breaks caching).

Are you willing to contribute the implementation?

Yes, I can do it

Before submitting

  • I searched existing issues and didn't find a duplicate

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions