Skip to content

feat: add automatic model routing#116

Draft
SDU-W-ZhangLab wants to merge 1 commit into
Stack-Cairn:mainfrom
SDU-W-ZhangLab:codex/auto-model-routing
Draft

feat: add automatic model routing#116
SDU-W-ZhangLab wants to merge 1 commit into
Stack-Cairn:mainfrom
SDU-W-ZhangLab:codex/auto-model-routing

Conversation

@SDU-W-ZhangLab

Copy link
Copy Markdown

Summary

  • add a virtual Auto entry to the chat model picker
  • route each turn to a user-tagged fast, balanced, or reasoning model while preserving the conversation-level Auto selection and existing context
  • add deterministic tier fallback, provider/model ordering, settings UI, persistence, and Chinese/English copy
  • keep manual model selection and gateway overrides unchanged

Routing policy

  • attachments, prompts >= 1,200 characters, or 2+ complexity signals -> reasoning
  • prompts >= 400 characters or one complexity signal -> balanced
  • otherwise -> fast
  • fallback order:
    • fast -> balanced -> reasoning
    • balanced -> reasoning -> fast
    • reasoning -> balanced -> fast

This is intentionally a low-cost Auto router, not a parallel Fusion panel/judge. A Fusion-style ensemble should be a separate opt-in feature because it multiplies latency/cost and can duplicate tool side effects.

Verification

  • node --test test/chat/model-selection.test.mjs (16/16 passed)
  • npm run build (TypeScript + Vite production build passed)
  • Biome check on changed source files (no errors; existing warnings remain)

The full frontend suite could not finish reliably on this machine because Node v22.18.0 is below the dependency-declared v22.19.0 minimum; unrelated SSH/MCP/subagent workers retained open handles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants