A3M Router is an open-source LLM proxy that analyzes every query and routes it to the cheapest capable model — without you changing a line of code. 96.77% accuracy on RouterArena at $0.08 per 1K tokens.
Analyzes query complexity using keyword-based classification and routes to the cheapest capable provider. Code queries go to code models. Trivial queries use free models. Premium only when needed.
Call multiple providers simultaneously and score every response with weighted signals: domain match, specificity, structure alignment, verb matching, and cost tier. Cheapest that fully satisfies wins.
Trigram Jaccard similarity cache eliminates redundant API calls. Exact duplicates return instantly for free. Near-duplicates use fuzzy matching to maximize cache hit rate.
Built-in prompt injection detection, PII redaction, content filtering, and rate limiting. Optional NeMo Guardrails integration for jailbreak detection and hallucination prevention.
Monitor spend, latency, cache hits, and provider health in real-time. Set per-provider budgets and get alerts when thresholds are exceeded.
Automatic failover when providers degrade or fail. Circuit breaker pattern keeps your app resilient. Exponential backoff with jitter for transient failures.
Works on macOS, Linux, and Windows. No Docker required. Runs locally or on a server.
A3M starts an OpenAI-compatible proxy on port 8787. Set your API key once and forget it.
Point your OpenAI SDK base URL to A3M's proxy. Everything else works automatically.
| Feature | A3M Router | OpenRouter | LiteLLM |
|---|---|---|---|
✓ Open-source (Apache 2.0) |
✓ | ✗ Closed | ✓ |
✓ Intelligent cost-based routing |
✓ Keyword classifier | ~ Latent routing | ~ Configurable fallbacks |
✓ Parallel ensemble execution |
✓ Multi-provider scoring | ✗ | ✗ |
✓ Semantic cache (Jaccard trigram) |
✓ Built-in | ✗ | ~ Redis external |
✓ Security guardrails & PII redaction |
✓ Built-in + NeMo | ✗ | ~ Virtual keys only |
✓ Real-time cost analytics |
✓ Built-in dashboard | ~ Usage tracking only | ~ LangSmith hook |
✓ RouterArena benchmark |
✓ 96.77% | ✗ | ✗ |
✓ Zero-config drop-in OpenAI proxy |
✓ | ✓ | ✓ |
✓ Self-hosted / local models |
✓ Ollama, LM Studio, vLLM | ~ OpenRouter only | ✓ |
✓ Circuit breaker & retry logic |
✓ Built-in | ✗ | ✓ |
The live demo runs in your browser. Enter any prompt and watch A3M route it to the optimal provider in real time. See the confidence score, routing decision, and response.
Open Live Demo on HuggingFaceFree to use. No API key required for the demo.
Ollama, LM Studio, and vLLM as free local providers. A3M will route simple or repetitive queries to your local models, reserving paid APIs for complex tasks. This gives you a free tier that costs nothing to run.
Open source, self-hostable, and works with your existing code in minutes.