Skip to content

ModelRouter

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/agent-core/src/runtime/model-router.ts

Resolves the model to use for a given task.

Usage:

typescript
const router = new ModelRouter(GPT54_FAMILY_ROUTING_TABLE, 'gpt-5.6-terra');
const model = router.route('explore');  // → 'gpt-5.6-luna'
const model = router.route('plan');     // → 'gpt-5.6-terra'
const model = router.route();           // → 'gpt-5.6-terra' (default)

Methods

MethodSignatureReturns
routeroute(category: TaskCategory, explicitModel: string)string
isActiveisActive()boolean
summarysummary()Record<string, string>

Where it refuses work

  • ModelRouter stops the work with an early return when explicitModel.
  • ModelRouter stops the work with an early return when category && this.table.routes[category].
  • ModelRouter stops the work with an early return when this.table.default.

Was this page helpful?

Download as PDF