DEV Community

Farid Chowdhury
Farid Chowdhury

Posted on

πŸ”€ I built an AI agent router that picks the right model for the job β€” and it changed how I code 🦞

I got tired of one model doing everything badly.

πŸ’Έ Expensive reasoning on simple searches.
πŸƒ Fast models hallucinating on architecture.
🚫 Rate limits with no fallback.

So I built a task router. One prompt, zero config hell.

⚑ What it does:

  • 🧠 Smart routing β€” says "plan this", "debug that", "review this PR" and sends it to the specialist that handles it best
  • ⚑ Instant response β€” you never wait at a blank screen. Agents work async, results appear when done
  • πŸ“Š Live status β€” every 2 minutes, a heartbeat tree shows exactly which agent is running, blocked, or done
  • πŸ”„ Auto fallback β€” rate limit hit? Switches to the next best model. You never notice
  • πŸ›‘οΈ No hallucination β€” hard constraints: never invent files, never guess imports, always search first
  • πŸ’°Cost smart β€” simple tasks get cheap fast models, complex ones get deep reasoning. No waste

πŸ‘€ What a session looks like:

πŸ”€ Router

β”œβ”€β”€ πŸ—οΈ plan (Microservices arch) β†’ [RUNNING]

β”œβ”€β”€ ⚑ fast (Find auth module) β†’ [FINISHED: src/auth/]

└── πŸ“‹ Summary: Architecture in progress, auth found

πŸ› οΈ Setup:

Drop 2 files in your OpenClaw workspace. That's it.

  • AGENTS.md β†’ the router prompt

  • openclaw.json β†’ the agent definitions with fallback chains

Works with OpenCode models out of the box, or swap in any provider you want.

πŸ”— Full config + docs: https://github.com/FaridLU/openclaw-task-router

MIT licensed. Questions and suggestions are welcome πŸ‘‡

Top comments (0)