Skip to content

feat(routing): add configurable per-prompt model routing - #1422

Draft
mounir0672230294-alt wants to merge 2 commits into
lidge-jun:devfrom
mounir0672230294-alt:feat/smart-model-router
Draft

feat(routing): add configurable per-prompt model routing#1422
mounir0672230294-alt wants to merge 2 commits into
lidge-jun:devfrom
mounir0672230294-alt:feat/smart-model-router

Conversation

@mounir0672230294-alt

@mounir0672230294-alt mounir0672230294-alt commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • Add opt-in, deterministic per-prompt classification into fast, balanced, and powerful task tiers.
  • Let routing-profile candidates declare the task tiers they can serve, while preserving the existing health, quota, capability, cost, and fallback constraints.
  • Reclassify the latest user prompt on every request made through the selected routing-profile alias, without an extra model call and without persisting raw prompt text.
  • Add Routing Profiles GUI controls, management dry-run and CLI support, explainability traces, localized copy, documentation, and regression tests.
  • Keep the feature provider-agnostic so configured OpenAI, DeepSeek, Qwen, Kimi, GLM, and other provider models can participate in the same profile.

Verification

  • bun run typecheck
  • bun run test tests/prompt-classifier.test.ts tests/request-evidence.test.ts tests/routing-profile.test.ts tests/policy-execution.test.ts tests/route-explainability.test.ts tests/routing-profile-editor-data.test.ts
    • 71 pass, 0 fail
  • cd gui && bun test tests/routing-profiles.test.tsx ../tests/routing-profile-editor-data.test.ts
    • 20 pass, 0 fail
  • cd gui && bun run lint
  • cd gui && bun run lint:i18n
  • cd gui && bun run build
  • cd docs-site && bun run build
  • bun x --yes react-doctor@0.9.11 --verbose --scope changed --base origin/dev --no-telemetry
    • 10 changed GUI files scanned, no issues found
  • bun run privacy:scan
  • Full bun run test
    • 10,656 pass, 7 skip, 7 timeout failures across 10,670 tests
    • The suite took 1,196 seconds versus the runner's approximately 210-second idle baseline.
    • All six files containing the seven unrelated timeout failures passed when rerun in isolation: 141 pass, 0 fail.

Screenshot

Automatic prompt routing with fast, balanced, and powerful model tiers

Live local dashboard capture from opencodex v2.10.2 showing Automatic prompt routing enabled, the auto alias, and explicit fast / balanced / powerful candidate assignments. The profile was also dry-run locally for all three tiers plus image input.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c42ce604-2ca1-4c72-be84-3c63818cba8e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • review readiness checklist open (0/4 boxes ticked).

What to do

  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This PR stays in draft until every box above is ticked.

@mounir0672230294-alt mounir0672230294-alt changed the title feat(routing): add per-prompt smart model selection feat(routing): add configurable per-prompt model routing Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant