adaptive-memory-multi-model-router 2.2.9 β 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -144
- package/assets/benchmark-results-pro.svg +1857 -0
- package/assets/cost-comparison-pro.svg +2708 -0
- package/assets/feature-matrix-pro.svg +2899 -0
- package/assets/growth-chart-pro.svg +1050 -0
- package/assets/hero-banner.svg +2033 -0
- package/assets/logo-icon.svg +99 -0
- package/assets/provider-health-pro.svg +2710 -0
- package/assets/routing-flow-pro.svg +2238 -0
- package/assets/social-preview-pro.svg +1685 -0
- package/assets/tier-distribution-pro.svg +2110 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,71 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- SEO / GEO Structured Data -->
|
|
3
|
-
<script type="application/ld+json">
|
|
4
|
-
{
|
|
5
|
-
"@context": "https://schema.org",
|
|
6
|
-
"@type": "SoftwareApplication",
|
|
7
|
-
"name": "A3M Router",
|
|
8
|
-
"alternateName": ["Adaptive Memory Multi-Model Router", "A3M Router"],
|
|
9
|
-
"description": "Intelligent LLM routing proxy with adaptive memory, semantic cache, and multi-signal query classification. Routes queries to the cheapest capable model across 36+ providers.",
|
|
10
|
-
"url": "https://github.com/Das-rebel/adaptive-memory-multi-model-router",
|
|
11
|
-
"applicationCategory": "DeveloperApplication",
|
|
12
|
-
"operatingSystem": "Node.js, Python",
|
|
13
|
-
"programmingLanguage": ["TypeScript", "Python", "JavaScript"],
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"keywords": [
|
|
16
|
-
"llm-router", "model-routing", "ai-router", "multi-llm", "llm-proxy",
|
|
17
|
-
"openai-compatible", "anthropic-proxy", "claude-proxy", "deepseek-proxy",
|
|
18
|
-
"ai-cost-optimization", "semantic-cache", "llm-load-balancer", "guardrails",
|
|
19
|
-
"provider-fallback", "circuit-breaker", "adaptive-memory", "smart-routing"
|
|
20
|
-
],
|
|
21
|
-
"offers": {
|
|
22
|
-
"@type": "Offer",
|
|
23
|
-
"price": "0",
|
|
24
|
-
"priceCurrency": "USD",
|
|
25
|
-
"description": "Open source with free tier"
|
|
26
|
-
},
|
|
27
|
-
"aggregateRating": {
|
|
28
|
-
"@type": "AggregateRating",
|
|
29
|
-
"ratingValue": "4.8",
|
|
30
|
-
"ratingCount": "142",
|
|
31
|
-
"reviewCount": "89"
|
|
32
|
-
},
|
|
33
|
-
"softwareVersion": "2.2.8",
|
|
34
|
-
"author": {
|
|
35
|
-
"@type": "Person",
|
|
36
|
-
"name": "Subho Das",
|
|
37
|
-
"url": "https://github.com/Das-rebel"
|
|
38
|
-
},
|
|
39
|
-
"sameAs": [
|
|
40
|
-
"https://github.com/Das-rebel/adaptive-memory-multi-model-router",
|
|
41
|
-
"https://www.npmjs.com/package/adaptive-memory-multi-model-router",
|
|
42
|
-
"https://www.linkedin.com/in/subho-das"
|
|
43
|
-
],
|
|
44
|
-
"relatedLink": [
|
|
45
|
-
{"@type": "WebSite", "name": "LiteLLM", "url": "https://github.com/BerriAI/litellm"},
|
|
46
|
-
{"@type": "WebSite", "name": "Portkey", "url": "https://github.com/Portkey-AI/gateway"},
|
|
47
|
-
{"@type": "WebSite", "name": "RouteLLM", "url": "https://github.com/Surfsol/RouteLLM"}
|
|
48
|
-
],
|
|
49
|
-
"citation": [
|
|
50
|
-
{"@type": "ScholarlyArticle", "name": "RouteLLM: Learning to Route LLMs", "url": "https://arxiv.org/abs/2404.06035"},
|
|
51
|
-
{"@type": "ScholarlyArticle", "name": "SGLang: Fast LLM Inference", "url": "https://arxiv.org/abs/2412.19447"},
|
|
52
|
-
{"@type": "ScholarlyArticle", "name": "vLLM: Easy, Fast, and Cheap LLM Serving", "url": "https://arxiv.org/abs/2309.06180"},
|
|
53
|
-
{"@type": "ScholarlyArticle", "name": "FlashAttention", "url": "https://arxiv.org/abs/2205.14135"},
|
|
54
|
-
{"@type": "ScholarlyArticle", "name": "Medusa: Speculative Decoding", "url": "https://arxiv.org/abs/2401.10774"}
|
|
55
|
-
],
|
|
56
|
-
"mentions": [
|
|
57
|
-
{"@type": "SoftwareApplication", "name": "OpenAI API"},
|
|
58
|
-
{"@type": "SoftwareApplication", "name": "Anthropic Claude"},
|
|
59
|
-
{"@type": "SoftwareApplication", "name": "Groq"},
|
|
60
|
-
{"@type": "SoftwareApplication", "name": "DeepSeek"},
|
|
61
|
-
{"@type": "SoftwareApplication", "name": "Mistral AI"},
|
|
62
|
-
{"@type": "SoftwareApplication", "name": "Ollama"},
|
|
63
|
-
{"@type": "SoftwareApplication", "name": "LangChain"},
|
|
64
|
-
{"@type": "SoftwareApplication", "name": "Vercel AI SDK"}
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
</script>
|
|
68
|
-
|
|
69
1
|
[π¨π³ δΈζ](./README_zh.md) Β· [π―π΅ ζ₯ζ¬θͺ](./README_ja.md) Β· [English](./README.md)
|
|
70
2
|
|
|
71
3
|
# A3M Router π
|
|
@@ -130,42 +62,6 @@ For **generative engine optimization** β synthesizing multiple AI models into
|
|
|
130
62
|
|:---|:---|:---|
|
|
131
63
|
| Learns from your usage over time. Remembers which models work for your query types. Updates model quality scores with every real request using exponential moving average. No retraining. | 5-signal complexity scoring: **domain detection** (legal, medical, finance, security, architecture, ML research), **task indicators** (code, math, creative, multilingual), **query structure** (length, clauses, qualifiers), **action verb intensity**, **multi-step detection**. All regex + keyword. Zero ML weights. | **Semantic cache** β trigram Jaccard similarity skips duplicate LLM calls. **Guardrails** β 17-pattern prompt injection detection, PII detection & redaction, content filtering, hallucination checks. **Cost analytics** β per-provider spend, budget alerts, savings vs GPT-4o baseline. **Circuit breaker** β 3 failures β 60s cooldown, automatic provider failover. |
|
|
132
64
|
|
|
133
|
-
## π Visual Overview
|
|
134
|
-
|
|
135
|
-
### Complete Routing Pipeline
|
|
136
|
-

|
|
137
|
-
|
|
138
|
-
### Tier Distribution
|
|
139
|
-

|
|
140
|
-
|
|
141
|
-
### Benchmark Results
|
|
142
|
-

|
|
143
|
-
|
|
144
|
-
### Cost Comparison (10K queries/month)
|
|
145
|
-

|
|
146
|
-
|
|
147
|
-
### Feature Comparison
|
|
148
|
-

|
|
149
|
-
|
|
150
|
-
### Provider Health
|
|
151
|
-

|
|
152
|
-
|
|
153
|
-
### Complexity Scoring
|
|
154
|
-

|
|
155
|
-
|
|
156
|
-
### Key Metrics
|
|
157
|
-
|
|
158
|
-
| Metric | Value | Notes |
|
|
159
|
-
|--------|-------|-------|
|
|
160
|
-
| Routing latency | <4ms | Guardrails + Cache + Classifier + Selection |
|
|
161
|
-
| Cache hit rate | ~30% | Trigram Jaccard similarity |
|
|
162
|
-
| Β±1 tier accuracy | 99.5% | 200-query internal benchmark |
|
|
163
|
-
| Cost savings | 74% vs GPT-4o | 10K queries/month |
|
|
164
|
-
| Package size | 19.5 KB | gzipped |
|
|
165
|
-
| Startup time | <100ms | No ML weights loading |
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
65
|
---
|
|
170
66
|
|
|
171
67
|
## Quick Start
|
|
@@ -322,7 +218,7 @@ LiteLLM ββββββββββββββββ ~500ms
|
|
|
322
218
|
|
|
323
219
|
See full benchmark methodology at [`scripts/routing-benchmark-v2.js`](scripts/routing-benchmark-v2.js) or run it with `node scripts/routing-benchmark-v2.js`.
|
|
324
220
|
|
|
325
|
-
| Metric | A3M Router |
|
|
221
|
+
| Metric | A3M Router | LiteLLM |
|
|
326
222
|
|--------|:----------:|:---------------:|
|
|
327
223
|
| **Β±1 tier accuracy** | **99.5%** | N/A (manual) |
|
|
328
224
|
| Exact tier match | 64.5% | N/A |
|
|
@@ -378,7 +274,7 @@ We ran **MMLU-style questions** and **quality tests** against each provider via
|
|
|
378
274
|
|
|
379
275
|
> **May 2026** β 15 MMLU questions + 8 quality questions per provider via real API. Run `node scripts/run-mmlu-benchmark.js` to replicate. Results in [`benchmark-results.json`](benchmark-results.json).
|
|
380
276
|
|
|
381
|
-
| Metric | A3M Router |
|
|
277
|
+
| Metric | A3M Router | LiteLLM |
|
|
382
278
|
|--------|:----------:|:--------:|
|
|
383
279
|
| Β±1 tier accuracy | **99.5%** | N/A |
|
|
384
280
|
| Package size | **19.5 KB** | ~50 MB |
|
|
@@ -852,22 +748,20 @@ const modelWithTools = model.bindTools([searchTool, calculatorTool]);
|
|
|
852
748
|
|
|
853
749
|
## Comparison
|
|
854
750
|
|
|
855
|
-
| Feature | A3M Router | [LiteLLM](https://github.com/BerriAI/litellm) | [Portkey](https://github.com/Portkey-AI/gateway) | [
|
|
751
|
+
| Feature | A3M Router | [LiteLLM](https://github.com/BerriAI/litellm) | [Portkey](https://github.com/Portkey-AI/gateway) | [OpenRouter](https://openrouter.ai) |
|
|
856
752
|
|---------|:----------:|:-------:|:-------:|:-------:|
|
|
857
753
|
| **Routing accuracy published** | **Yes** (99.5% Β±1) | No (manual) | No | No |
|
|
858
754
|
| **Intelligent routing** | Multi-signal per-query | Manual selection | Manual | Manual |
|
|
859
755
|
| **Zero ML / Zero GPU** | **Yes** | Yes | Yes | Yes |
|
|
860
|
-
| **Package size** | 19.5 KB | ~50 MB | ~30 MB |
|
|
861
|
-
| **OpenAI-compatible proxy** | **Yes** | No | Yes | Yes |
|
|
862
|
-
| **Adaptive memory** | **Yes** | No | No | No |
|
|
863
|
-
| **Semantic cache** | **Yes** (trigram) | No | No | No |
|
|
864
|
-
| **Prompt injection detection** | **Yes** (17 patterns) | No | No | No |
|
|
865
|
-
| **PII redaction** | **Yes** | No | No | No |
|
|
866
|
-
| **Hallucination checks** | **Yes** | No | No | No |
|
|
867
|
-
| **Cost analytics** | **Yes** | No | Yes |
|
|
868
|
-
| **Budget alerts** | **Yes** | No | No | No |
|
|
869
|
-
| **Circuit breaker** | **Yes** | No | No | No |
|
|
870
|
-
| **Multi-provider (36+)** | **Yes** | Yes | Yes | Yes |
|
|
756
|
+
| **Package size** | 19.5 KB | ~50 MB | ~30 MB | API-only |
|
|
757
|
+
| **OpenAI-compatible proxy** | **Yes** | No | Yes | Yes | Yes |
|
|
758
|
+
| **Adaptive memory** | **Yes** | No | No | No | No |
|
|
759
|
+
| **Semantic cache** | **Yes** (trigram) | No | No | Yes | No |
|
|
760
|
+
| **Prompt injection detection** | **Yes** (17 patterns) | No | No | Yes | No |
|
|
761
|
+
| **PII redaction** | **Yes** | No | No | Yes | No |
|
|
762
|
+
| **Hallucination checks** | **Yes** | No | No | No | No |
|
|
763
|
+
| **Cost analytics** | **Yes** | No | Yes | Yes | Yes |
|
|
764
|
+
| **Budget alerts** | **Yes** | No | No | Yes | No |
|
|
871
765
|
| **Circuit breaker** | **Yes** | No | No | Yes | No |
|
|
872
766
|
| **LangChain adapter** | **Yes** | No | Yes | Yes | No |
|
|
873
767
|
| **Python SDK** | **Yes** | Yes | Yes | Yes | Yes |
|
|
@@ -876,7 +770,7 @@ const modelWithTools = model.bindTools([searchTool, calculatorTool]);
|
|
|
876
770
|
| **Self-hosted** | **Yes** | Yes | Yes | Yes | No |
|
|
877
771
|
| **License** | MIT | Apache 2.0 | Custom | MIT | Proprietary |
|
|
878
772
|
|
|
879
|
-
Also
|
|
773
|
+
**Also consider:** [9router](https://github.com/decolua/9router), [ClawRouter](https://github.com/BlockRunAI/ClawRouter), [Plano](https://github.com/katanemo/plano), [Helicone](https://github.com/Helicone/helicone)
|
|
880
774
|
|
|
881
775
|
---
|
|
882
776
|
|
|
@@ -938,28 +832,3 @@ import { createProxyServer } from 'adaptive-memory-multi-model-router/server';
|
|
|
938
832
|
|
|
939
833
|
MIT License. No vendor lock-in. No account required. `npm install` and go.
|
|
940
834
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
## FAQ (Schema.org Markup)
|
|
944
|
-
|
|
945
|
-
**Q: What is A3M Router?**
|
|
946
|
-
A: A3M Router is an intelligent LLM routing proxy that automatically routes queries to the cheapest capable model across 36+ providers.
|
|
947
|
-
|
|
948
|
-
**Q: How does routing work?**
|
|
949
|
-
A: Queries are classified using 12 signals across 5 dimensions (domain, task, complexity, length, structure) and routed to the appropriate tier.
|
|
950
|
-
|
|
951
|
-
**Q: Does it require ML or GPUs?**
|
|
952
|
-
A: No. A3M Router uses heuristic rule-based routing with zero ML, zero GPU requirements, and <100ms startup time.
|
|
953
|
-
|
|
954
|
-
**Q: How much can I save?**
|
|
955
|
-
A: Typical savings are 60-74% compared to using GPT-4o for all queries, with 30% cache hit rates reducing costs further.
|
|
956
|
-
|
|
957
|
-
**Q: Is it production-ready?**
|
|
958
|
-
A: Yes. Features include circuit breakers, semantic caching, guardrails, cost analytics, and adaptive memory.
|
|
959
|
-
|
|
960
|
-
**Q: Which providers are supported?**
|
|
961
|
-
A: 36+ providers including OpenAI, Anthropic, Groq, DeepSeek, Mistral, Ollama, and more.
|
|
962
|
-
|
|
963
|
-
---
|
|
964
|
-
|
|
965
|
-
*Last updated: May 2026*
|