adaptive-memory-multi-model-router 2.13.11 โ 2.13.13
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 +2 -0
- package/_schema.html +34 -0
- package/articles/FRESH_devto_2026_05.md +31 -53
- package/articles/hn_show_2026_05.md +5 -8
- package/articles/twitter-thread-cost-savings.md +30 -44
- package/dist/tui/dashboard.d.ts +1 -4
- package/dist/tui/dashboard.js +128 -234
- package/dist/tui/dashboard.js.map +1 -1
- package/llms-full.txt +149 -120
- package/llms.txt +48 -45
- package/package.json +33 -527
- package/scripts/post-all.sh +41 -0
- package/src/tui/dashboard.ts +100 -272
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
**One prompt in. The right model out.** An open-source **AI gateway** that auto-routes every query to the cheapest capable model across **47+ LLM providers**. Features **parallel ensemble execution**, **semantic cache**, **budget enforcement**, **intelligent failover**, and **independent benchmark validation**. Start in <100ms. Python SDK + TypeScript SDK.
|
|
15
15
|
|
|
16
|
+
### ๐ AI-Friendly: [`llms.txt`](./llms.txt) ยท [`llms-full.txt`](./llms-full.txt)
|
|
17
|
+
|
|
16
18
|
### Quick Start: [`docs/QUICK_START.md`](./docs/QUICK_START.md)
|
|
17
19
|
|
|
18
20
|
### ๐ By the Numbers
|
package/_schema.html
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AI discoverability: Schema.org markup for LLM search engines
|
|
3
|
+
{
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "SoftwareApplication",
|
|
6
|
+
"name": "A3M Router",
|
|
7
|
+
"applicationCategory": "DeveloperApplication",
|
|
8
|
+
"operatingSystem": "Node.js",
|
|
9
|
+
"description": "Open-source LLM router with parallel multi-LLM execution, 47+ providers, 99.5% routing accuracy, 62% cost savings. 19.5 KB, zero ML dependencies.",
|
|
10
|
+
"url": "https://github.com/Das-rebel/a3m-router",
|
|
11
|
+
"downloadUrl": "https://www.npmjs.com/package/adaptive-memory-multi-model-router",
|
|
12
|
+
"softwareVersion": "2.14.0",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"author": {
|
|
15
|
+
"@type": "Person",
|
|
16
|
+
"name": "Das-rebel"
|
|
17
|
+
},
|
|
18
|
+
"offers": {
|
|
19
|
+
"@type": "Offer",
|
|
20
|
+
"price": "0",
|
|
21
|
+
"priceCurrency": "USD"
|
|
22
|
+
},
|
|
23
|
+
"featureList": [
|
|
24
|
+
"Parallel multi-LLM execution",
|
|
25
|
+
"RouteLLM-style routing with 12 signals",
|
|
26
|
+
"47+ LLM providers",
|
|
27
|
+
"Semantic cache (30%+ hit rate)",
|
|
28
|
+
"Budget enforcement",
|
|
29
|
+
"Circuit breaker with failover",
|
|
30
|
+
"Prompt injection guardrails",
|
|
31
|
+
"Independent benchmark validation"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
-->
|
|
@@ -1,95 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
title: "Three LLM Infrastructure Problems That Shouldn't Exist in 2026"
|
|
3
|
-
published: false
|
|
4
|
-
description: "Every LLM gateway claims to solve these. Most don't. Here's what actually works and why 10K developers downloaded a 19.5 KB router in two weeks."
|
|
5
|
-
tags: llm, devops, infrastructure, ai, opensource
|
|
6
|
-
cover_image: https://raw.githubusercontent.com/Das-rebel/a3m-router/main/docs/benchmark-chart.png
|
|
7
|
-
---
|
|
1
|
+
LLM infrastructure has three problems that shouldn't exist in 2026. Here's what we built because nobody else fixed them.
|
|
8
2
|
|
|
9
|
-
|
|
3
|
+
---
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
## Problem 1: Your LLM bill is unnecessarily high
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
Everyone routes everything to GPT-4 because who has time to configure per-query routing. The bill hits 3-5x what it should be for zero extra value.
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
People are already switching because of this. A dev on X: *"Cancelled both my Claude Code Pro and ChatGPT Pro. Kimi K2.6 is just as good for my side projects as Opus or GPT 5.4 were. The price for this is crazy low."*
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
Another one: *"Just used gemini-embedding-2 to vectorize 27,603 notes for semantic search. Total cost: $0.07. That's pretty amazing."*
|
|
18
12
|
|
|
19
|
-
The
|
|
13
|
+
The pattern is obvious โ developers are actively looking for cheaper alternatives. The problem is doing it query-by-query without wasting time.
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
We built a router that classifies every query by complexity and sends it to the cheapest capable model.
|
|
22
16
|
|
|
23
|
-
```
|
|
17
|
+
```javascript
|
|
24
18
|
"Design a clinical trial protocol" โ premium ($2.50/M tokens)
|
|
25
|
-
"Write a Python sort function" โ
|
|
19
|
+
"Write a Python sort function" โ groq ($0.20/M tokens)
|
|
26
20
|
"What is 2+2?" โ free ($0.00/M tokens)
|
|
27
21
|
```
|
|
28
22
|
|
|
29
|
-
|
|
23
|
+
Result: **62% cost savings** measured across 200 real API calls. Not theoretical.
|
|
30
24
|
|
|
31
25
|
---
|
|
32
26
|
|
|
33
|
-
## Problem 2: Sequential
|
|
34
|
-
|
|
35
|
-
Every LLM gateway uses the same pattern:
|
|
27
|
+
## Problem 2: Sequential fallback gives you one answer, not the best
|
|
36
28
|
|
|
37
|
-
|
|
38
|
-
try Provider A โ fails โ wait โ try Provider B โ fails โ wait โ try Provider C
|
|
39
|
-
```
|
|
29
|
+
Every gateway does: try A โ fail โ try B โ fail โ try C.
|
|
40
30
|
|
|
41
|
-
|
|
31
|
+
You always get one provider's answer. Never the best across all. If A is slow, everything waits.
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
2. **If the first provider is slow, everything waits**
|
|
45
|
-
3. **No way to know if a different model would have given a better answer**
|
|
33
|
+
Someone already built `ai-retry` โ a library for retry and fallback mechanisms โ because this is such a common pain. People are hacking around it manually.
|
|
46
34
|
|
|
47
|
-
|
|
35
|
+
We went further. Run all providers in parallel. Score every result on specificity, structure, and relevance. Return the best answer with reasons why it won.
|
|
48
36
|
|
|
49
37
|
```javascript
|
|
50
|
-
const result = await executeEnsemble(query,
|
|
38
|
+
const result = await executeEnsemble(query, context, {
|
|
51
39
|
nvidia: callNvidia,
|
|
52
40
|
groq: callGroq,
|
|
53
41
|
openai: callOpenAI
|
|
54
42
|
});
|
|
55
|
-
|
|
56
|
-
console.log(`Reason: ${result.reasoning}`); // โ higher specificity on code
|
|
43
|
+
// โ nvidia (scored 75, higher specificity on code)
|
|
57
44
|
```
|
|
58
45
|
|
|
59
|
-
This isn't a feature we added for marketing. It's what developers told us they were hacking together manually โ running the same prompt through multiple providers in separate browser tabs and comparing outputs.
|
|
60
|
-
|
|
61
46
|
---
|
|
62
47
|
|
|
63
|
-
## Problem 3: Every
|
|
64
|
-
|
|
65
|
-
Gateways add latency. Everyone knows this. Nobody publishes the actual numbers.
|
|
48
|
+
## Problem 3: Every gateway claims "negligible overhead." None publish numbers.
|
|
66
49
|
|
|
67
|
-
|
|
50
|
+
It's the standard line. "Negligible overhead" followed by zero data.
|
|
68
51
|
|
|
69
|
-
|
|
52
|
+
We ran ours through a third-party benchmark tool (llm-gateway-bench) and published everything:
|
|
70
53
|
|
|
71
|
-
| Scenario |
|
|
72
|
-
|
|
73
|
-
| Direct to Groq | **138ms** | Raw
|
|
74
|
-
| Through A3M
|
|
75
|
-
| Through A3M (auto) | **374ms** | Above + routing decision (12 signals) |
|
|
54
|
+
| Scenario | Time | What's included |
|
|
55
|
+
|:---------|:----:|:----------------|
|
|
56
|
+
| Direct to Groq | **138ms** | Raw API call |
|
|
57
|
+
| Through A3M | **374ms** | Routing + cache + guardrails + cost tracking |
|
|
76
58
|
|
|
77
|
-
|
|
59
|
+
236ms overhead. Not zero. But it saves 62% on API costs โ that's ~$2,600/year at 100K queries/month.
|
|
78
60
|
|
|
79
61
|
---
|
|
80
62
|
|
|
81
|
-
## Why
|
|
63
|
+
## Why it grew
|
|
82
64
|
|
|
83
|
-
|
|
65
|
+
10,024 downloads in 14 days. Zero marketing. Developers found it on npm, tried it, told other developers.
|
|
84
66
|
|
|
85
|
-
|
|
86
|
-
2. **"I'm tired of mediocre answers from the only model I can afford"** โ They try the ensemble โ better answers
|
|
87
|
-
3. **"I don't trust black-box gateways"** โ They see the benchmarks โ they trust it
|
|
88
|
-
|
|
89
|
-
10,024 downloads. 72 versions. Zero marketing budget.
|
|
67
|
+
The feedback loop was: *"My bill is too high"* โ 62% savings. *"I want the best answer, not the first one"* โ parallel ensemble. *"I don't trust your latency claims"* โ here's the third-party benchmark, run it yourself.
|
|
90
68
|
|
|
91
69
|
---
|
|
92
70
|
|
|
93
|
-
*GitHub: [github.com/Das-rebel/a3m-router](https://github.com/Das-rebel/a3m-router)*
|
|
94
71
|
*npm: `npm install adaptive-memory-multi-model-router`*
|
|
95
|
-
*
|
|
72
|
+
*GitHub: [github.com/Das-rebel/a3m-router](https://github.com/Das-rebel/a3m-router)*
|
|
73
|
+
*Benchmarks: third-party via [llm-gateway-bench](https://github.com/taffy-owo/llm-gateway-bench)*
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
Three LLM infrastructure problems nobody's fixing properly:
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
Every query goes to GPT-4 because nobody has time to configure per-query routing. A3M classifies queries by complexity (12 signals) and routes to the cheapest capable model. 62% cost savings.
|
|
3
|
+
**1. Your bill is unnecessarily high.** Devs are already switching โ one cancelled both Claude Code Pro and ChatGPT Pro because Kimi K2.6 is "just as good for side projects at a crazy low price." We automated that decision query-by-query. 62% savings.
|
|
5
4
|
|
|
6
|
-
**
|
|
7
|
-
Every other router does try-A-fail-try-B-fail-try-C. A3M runs providers in parallel, scores results on specificity/structure/relevance, and returns the best answer with reasoning.
|
|
5
|
+
**2. Sequential fallback gives you the first answer, not the best.** Every gateway does try-A-fail-try-B. Someone already built `ai-retry` as a library because this is such a common hack. We run providers in parallel, score results, return the best with reasoning.
|
|
8
6
|
|
|
9
|
-
**
|
|
10
|
-
We ran ours through llm-gateway-bench (third-party tool) and published everything: 138ms baseline โ 374ms through full routing. 236ms overhead saves 62% on API costs.
|
|
7
|
+
**3. "Negligible overhead" with zero data.** Every gateway says this. We published third-party benchmarks via llm-gateway-bench: 138ms โ 374ms. Real numbers you can reproduce.
|
|
11
8
|
|
|
12
|
-
19.5 KB. Zero ML dependencies.
|
|
9
|
+
19.5 KB. 47 providers. Zero ML dependencies. 10K downloads in 14 days, zero marketing.
|
|
13
10
|
|
|
14
11
|
https://github.com/Das-rebel/a3m-router
|
|
@@ -1,64 +1,50 @@
|
|
|
1
|
-
1/7 Three LLM infrastructure problems that
|
|
1
|
+
1/7 Three LLM infrastructure problems that keep coming up:
|
|
2
2
|
|
|
3
|
-
โข Your bill is 3x higher than it
|
|
4
|
-
โข Sequential fallback gives you one
|
|
5
|
-
โข Every gateway
|
|
3
|
+
โข Your bill is 3x higher than it needs to be
|
|
4
|
+
โข Sequential fallback gives you one answer, never the best
|
|
5
|
+
โข Every gateway says "negligible overhead" โ zero data
|
|
6
6
|
|
|
7
|
-
We built
|
|
7
|
+
We built the thing that fixes all three.
|
|
8
8
|
|
|
9
|
-
2/7
|
|
9
|
+
2/7 A dev on X: "Cancelled both my Claude Code Pro and ChatGPT Pro. Kimi K2.6 is just as good for side projects. Price is crazy low."
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Another: "Vectorized 27K notes for $0.07. That's pretty amazing."
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Everyone's looking for cheaper options. The hard part is doing it per-query without wasting time.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
Code โ cheap ($0.20/M)
|
|
17
|
-
Expert โ premium ($2.50/M)
|
|
15
|
+
We route every query to the cheapest capable model. 62% savings. Measured.
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
3/7 Every LLM "router" does: try A โ fail โ try B โ fail โ try C.
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
You always get whatever A gave you. Nobody runs them all and picks the best.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
Someone already built `ai-retry` just for the fallback part โ that's how common this pain is.
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
We run all providers in parallel. Score results. Return the best answer. With reasoning why it won.
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
4/7 "Negligible overhead" โ every gateway claims this. Zero publish numbers.
|
|
28
26
|
|
|
29
|
-
We
|
|
27
|
+
We ran ours through llm-gateway-bench (third-party, not our tool) and published everything.
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
Every gateway claims this. None publish numbers.
|
|
34
|
-
|
|
35
|
-
We ran ours through a third-party benchmarking tool (llm-gateway-bench) and published everything:
|
|
36
|
-
|
|
37
|
-
Direct: 138ms
|
|
29
|
+
Direct: 138ms
|
|
38
30
|
Through A3M: 374ms
|
|
39
31
|
|
|
40
|
-
236ms overhead
|
|
41
|
-
|
|
42
|
-
5/7 Why 10K developers downloaded it in 14 days (zero marketing):
|
|
32
|
+
236ms overhead. Real. Documented. Runs 62% cheaper.
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
5/7 The numbers since we shipped:
|
|
35
|
+
10,024 downloads in 14 days.
|
|
36
|
+
72 versions.
|
|
37
|
+
Zero marketing.
|
|
38
|
+
47 providers.
|
|
39
|
+
19.5 KB.
|
|
40
|
+
Zero ML dependencies.
|
|
45
41
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
6/7 What's inside the 19.5 KB package:
|
|
49
|
-
|
|
50
|
-
โข Parallel ensemble (the unique feature)
|
|
51
|
-
โข RouteLLM-style routing (99.5% accuracy)
|
|
52
|
-
โข 47 providers
|
|
53
|
-
โข Budget enforcement with alerts
|
|
54
|
-
โข Semantic cache (30%+ hit rate)
|
|
55
|
-
โข Circuit breaker + auto failover
|
|
56
|
-
โข Persistent memory
|
|
57
|
-
|
|
58
|
-
7/7 npm install adaptive-memory-multi-model-router
|
|
42
|
+
6/7 npm install adaptive-memory-multi-model-router
|
|
59
43
|
npx a3m-router serve
|
|
60
44
|
|
|
61
|
-
Point any OpenAI SDK at localhost:8787.
|
|
45
|
+
Point any OpenAI SDK at localhost:8787. Works.
|
|
46
|
+
|
|
47
|
+
7/7 GitHub: github.com/Das-rebel/a3m-router
|
|
48
|
+
Benchmarks: third-party via llm-gateway-bench
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
Docs: github.com/Das-rebel/a3m-router#benchmark-results-real-api-calls
|
|
50
|
+
Built because the existing stuff didn't fix the actual problems.
|
package/dist/tui/dashboard.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* A3M Router โ
|
|
4
|
-
* Draws a centered overlay ON TOP of existing terminal content.
|
|
5
|
-
* Does NOT clear the screen. Restores terminal when done.
|
|
6
|
-
* Pure ANSI โ no fullscreen, no alt-buffer.
|
|
3
|
+
* A3M Router โ Overlay Box (blessed, non-fullscreen)
|
|
7
4
|
*/
|
|
8
5
|
export {};
|