Intelligent LLM Routing Proxy — Drop-in OpenAI Replacement
Route queries to the cheapest capable model • Save 50-80% on API costs
Analyzes query complexity and routes to the cheapest capable model. Code queries go to code models. Simple queries use budget providers. Premium models only when needed.
Save 50-80% on API costs. Route simple queries to free tiers (Ollama, CommandCode) or cheap providers (Groq $0.59/1M tokens). Real-time cost analytics dashboard.
When a provider fails, automatically retry with the next best option. Circuit breaker pattern keeps your app resilient. Zero downtime.
Monitor spending across all providers in real-time. Set budgets. Get alerts. Cost analytics with savings reports. Never get surprised by an API bill again.
Built-in prompt injection detection, PII redaction, content filtering, and rate limiting. Production-ready security out of the box.
Trigram Jaccard similarity cache eliminates redundant API calls. Batch processing with automatic rate limiting for high-throughput applications.
39 providers from free to premium. Always pick the cheapest capable option.
One-line installation, instant routing. Drop-in replacement for api.openai.com.
# Install npm install adaptive-memory-multi-model-router # Start the OpenAI-compatible proxy npx a3m-router serve # Now listening on http://localhost:8787/v1 # Or use programmatically const { createA3MRouter } = require('adaptive-memory-multi-model-router'); const router = createA3MRouter(); const result = await router.route("Explain quantum computing"); console.log(result.primary_model); // "groq/llama-3.3-70b" (cheapest capable) console.log(result.savings); // "$0.024 saved vs GPT-4"
A3M Router is an OpenAI-compatible proxy that analyzes each LLM query and routes it to the cheapest capable provider. It supports 39 providers including Groq, Cerebras, OpenAI, Anthropic, DeepSeek, and free local models via Ollama. Drop-in replacement for api.openai.com.
A3M Router saves 50-80% on LLM API costs by routing simple queries to cheap or free providers (Groq at $0.59/1M tokens, Cerebras at $0.60/1M tokens, or free via Ollama/CommandCode) while only using premium models like GPT-4 or Claude when query complexity requires it.
Yes, A3M Router is MIT-licensed open source software. It's free to use. You only pay for the underlying LLM API calls you route through it, and A3M Router minimizes those costs by selecting the cheapest capable provider.
Install with npm install adaptive-memory-multi-model-router, then run npx a3m-router serve to start the OpenAI-compatible proxy on port 8787. Point your existing OpenAI SDK base URL to http://localhost:8787/v1 and you're done.
39 providers including OpenAI, Anthropic (Claude), Google (Gemini), Groq, Cerebras, DeepSeek, Mistral, Fireworks, Together AI, Perplexity, Cohere, xAI (Grok), Ollama, OpenRouter, and more. Free options include CommandCode, Ollama, LM Studio, and vLLM.
A3M Router focuses on intelligent cost-based routing with semantic caching, guardrails, and real-time cost analytics built in. Unlike generic proxy tools, it actively analyzes query complexity to pick the cheapest capable model. Zero config needed for basic usage.