Repository navigation
feat(core): configure model routing by request complexity - #1
Open
ivanmilevtues wants to merge 1 commit into
Open
ivanmilevtues wants to merge 1 commit into
ivanmilevtues wants to merge 1 commit into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow users to map request complexity scores to model IDs or aliases through
routing.numericalRules. For example, simple requests can use a lightweight model while more complex requests use Pro. Without custom rules, existing threshold-based behavior remains.This is a CodeBoarding demonstration PR, not intended to merge, following the approach of CodeBoarding/pi#2. It contains 802 additions and 18 deletions across 13 files.
Details
Adapted directly from google-gemini/gemini-cli#29959 by gitseraj, preserving the original commit and authorship.
Custom score bands are sorted by their inclusive upper boundaries, resolve model aliases, and respect model availability. Scores above the final band use that band's model. Custom numerical routing is prioritized ahead of the generic classifier when configured; the existing numerical-routing enablement gate still applies.
Useful paths to explore in the architecture analysis:
Config.ModelRouterService.The fork currently has no CodeBoarding Actions workflow. This PR provides the code change for analysis; no successful CodeBoarding analysis is claimed.
Related Issues
Related to google-gemini/gemini-cli#21805. This demonstration does not close the upstream issue.
How to Validate
Completed locally on macOS:
npm run generate && npm run build -w @google/gemini-cli-core— passed.packages/core:npx vitest run --coverage.enabled=false src/routing/strategies/numericalClassifierStrategy.test.ts src/routing/modelRouterService.test.ts src/config/config.test.ts— 305 tests passed.packages/cli:npx vitest run --coverage.enabled=false src/config/settings-validation.test.ts— 37 tests passed.git diff --check main...HEAD— passed.Coverage includes score boundaries, unsorted rules, invalid rules, final-band fallback, default behavior, strategy precedence, and settings validation. Full repository preflight and live model API tests were not run for this time-sensitive demo.
Pre-Merge Checklist