Roo-Code/packages/types
Roo Code 6e090e7112 feat: add heuristic-based model routing for cost optimization
Adds an experimental feature that dynamically routes API calls to a
lighter/cheaper model when the task is in an information-gathering phase.

Addresses Issue #11269 - Choose Model Dynamically Based on Request.

## How it works

- New experiment flag: modelRouting (disabled by default)
- New setting: modelRoutingLightModelId - the cheaper model ID to use
- ModelRouter tracks tool usage per API turn
- If previous turn only used "read" group tools (read_file, list_files,
  search_files, codebase_search), the next API call uses the light model
- Edit, command, browser, and MCP tools always use the primary model
- First turn always uses the primary model

## Changes

- packages/types/src/experiment.ts: Add modelRouting experiment ID
- packages/types/src/global-settings.ts: Add modelRoutingLightModelId
- src/shared/experiments.ts: Add MODEL_ROUTING config
- src/core/task/ModelRouter.ts: New heuristic-based model router
- src/core/task/Task.ts: Integrate ModelRouter into task lifecycle
- src/core/task/__tests__/ModelRouter.spec.ts: 35 tests (all passing)
2026-02-06 20:29:26 +00:00
..
npm Release: v1.109.0 (#11241) 2026-02-05 18:00:16 -08:00
scripts Fix publish-npm script (#7093) 2025-08-14 03:17:56 -07:00
src feat: add heuristic-based model routing for cost optimization 2026-02-06 20:29:26 +00:00
.gitignore Task metadata (#7092) 2025-08-14 03:14:17 -07:00
eslint.config.mjs Task metadata (#7092) 2025-08-14 03:14:17 -07:00
package.json feat: add AI SDK dependencies and message conversion utilities (#11047) 2026-01-28 14:05:53 -05:00
tsconfig.json Task metadata (#7092) 2025-08-14 03:14:17 -07:00
tsup.config.ts Bump @roo-code/types to v1.42.0 (#6610) 2025-08-02 13:27:59 -07:00
vitest.config.ts Convert jest tests to vitest and disable default watch mode for vitest (#4568) 2025-06-11 14:48:01 -07:00