π Multi-Model Router
/ecosystem--integrations/multi-model-router
Route tasks to optimal models based on complexity:
typescript
import { ModelRouter } from 'agentic-flow/router';
const router = new ModelRouter();
// Automatic routing based on task complexity
const result = await router.route({
task: 'Add console.log to function',
preferCost: true
});
// Returns: { model: 'haiku', reason: 'simple task, low complexity' }
const result2 = await router.route({
task: 'Design distributed caching architecture'
});
// Returns: { model: 'opus', reason: 'complex architecture, high reasoning' }| Complexity | Model | Cost | Use Case |
|---|---|---|---|
| Agent Booster intent | Skip LLM | $0 | varβconst, add-types |
| Low (<30%) | Haiku | $0.0002 | Simple fixes, docs |
| Medium (30-70%) | Sonnet | $0.003 | Features, debugging |
| High (>70%) | Opus | $0.015 | Architecture, security |
Savings: 30-50% on LLM costs through intelligent routing