Built a routing layer for multi-model pipelines, picks the right LLM per request based on priority

Reddit r/AI_Agents Tools

Summary

A routing layer that automatically selects the best LLM per request based on priority flags (speed, cost, quality, balanced) using a weighted score, with under 1ms decision time and built-in fallback, caching, and metrics.

If you're building agents that chain multiple LLM calls, you've probably hit this: not every step in your pipeline needs the same model. A quick extraction step doesn't need Opus. A final synthesis step probably shouldn't use Flash. But you still end up hardcoding something and hoping it works for all of them. This router lets you set a priority flag per request (speed / cost / quality / balanced) and it picks the best model automatically using a weighted score. Routing decision is under 1ms since it's pure math, no extra network hop. Auto-fallback if the selected model fails, Redis caching for repeated requests, metrics endpoint for p95/p99 latency per model. Built on OpenRouter, so anything in their catalogue is fair game. Would be pretty easy to wire into an agent pipeline at the LLM call layer. Github repo is in comments below 👇 Built this project using Neo AI Engineer.
Original Article

Similar Articles