# 🔀 A3M Router

One prompt in. The right model out.

100% Routing Accuracy 47+ Providers Zero ML 19.5KB MIT License

## Quick Start

`npm install adaptive-memory-multi-model-router` `npx a3m-router serve`

### 💰 Cost Optimization

Route simple queries to free tiers (Ollama, Groq) or budget providers ($0.59/1M tokens). Save 62% on API costs.

### 🔄 Smart Fallback

When a provider fails, automatically retry with the next best option. Circuit breaker pattern keeps your app resilient.

### 📊 Semantic Cache

Trigram Jaccard similarity cache eliminates redundant API calls with 95%+ hit rate.

### 🔒 Security Guardrails

Built-in prompt injection detection, PII redaction, content filtering, and rate limiting.

100%
Routing Accuracy
62%
Cost Savings
47+
Providers
19.5KB
Package Size

## Provider Tiers

Free: Ollama, CommandCode, LM Studio
Budget ($0.59-0.60/1M): Groq, Cerebras
Mid ($1.50-2.80/1M): DeepSeek, Mistral, Qwen
Premium ($10-30/1M): OpenAI, Anthropic, Google

## Links

GitHub • npm • Docs