The Intelligence Layerfor Autonomous Agents
Agents shouldn't use the same model for every step. Our Smart Router automatically selects high-reasoning models for planning and fast models for execution.
Why Agents Need Dynamic Models
Planning
Requires deep reasoning and context window.
Target: o1, Claude 3.5 Sonnet, GPT-4
Execution
Requires speed and tool use.
Target: GPT-4o-mini, Haiku, Flash
Synthesis
Requires strong writing capabilities.
Target: Claude 3 Opus, GPT-4
Agentlify handles this switching automatically.
Why routing matters
Different tasks need different models. Code → DeepSeek. Writing → Claude. Simple tasks → GPT-4o-mini.
How it works
Four-step pipeline: classify, match, execute, fallback.
1. Task classification
Prompt is analyzed and classified into a task type: code generation, planning, summarization, extraction, creative writing, Q&A, etc.
2. Model matching
Task type is mapped to models with strong benchmark scores for that category. Code → DeepSeek/Codestral. Writing → Claude. Reasoning → o1/GPT-4.
3. Weighted selection
Final model is selected based on your router weights: cost, latency, quality, and optionally carbon impact. Configurable per router.
4. Automatic fallbacks
If the model returns an error (429, 500, timeout), the request is retried with a fallback model. Configurable retry count and escalation chain.
What you get
Benefits of task-aware routing over hardcoded model selection.
Start routing in 2 minutes
Create a router, change your baseURL, done. Free tier includes $5 in credits.
npm install agentlify • OpenAI SDK compatible