adaptive-memory-multi-model-router 2.13.7 → 2.13.9
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/articles/FRESH_devto_2026_05.md +95 -0
- package/articles/POSTING_KIT_2026_05.md +67 -0
- package/articles/hn_show_2026_05.md +14 -0
- package/articles/twitter-thread-cost-savings.md +39 -59
- package/dist/tui/dashboard.d.ts +4 -4
- package/dist/tui/dashboard.js +226 -239
- package/dist/tui/dashboard.js.map +1 -1
- package/package.json +5 -2
- package/src/tui/dashboard.ts +251 -221
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
---
|
|
8
|
+
|
|
9
|
+
LLM infrastructure has a dirty secret: most "solutions" solve imaginary problems while ignoring the real ones.
|
|
10
|
+
|
|
11
|
+
After building and shipping an open-source LLM router that hit 10K downloads in two weeks with zero marketing, here are the three actual problems developers told us they were trying to solve.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Problem 1: Your LLM Bill Is 3x Higher Than It Should Be
|
|
16
|
+
|
|
17
|
+
Most teams route every query to GPT-4. Not because every query needs GPT-4 — because nobody has time to configure per-query routing.
|
|
18
|
+
|
|
19
|
+
The result is predictable: monthly bills that are 3-5x higher than they need to be, with zero visibility into which team or query type is driving costs.
|
|
20
|
+
|
|
21
|
+
**What we built:** A router that classifies every query by complexity (12 signals across 5 dimensions) and routes it to the cheapest capable model.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
"Design a clinical trial protocol" → premium ($2.50/M tokens)
|
|
25
|
+
"Write a Python sort function" → cheap ($0.20/M tokens)
|
|
26
|
+
"What is 2+2?" → free ($0.00/M tokens)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The result: **62% cost savings**. Not theoretical — measured across 200 real API calls in our benchmark suite.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Problem 2: Sequential Fallback Is a Design Flaw
|
|
34
|
+
|
|
35
|
+
Every LLM gateway uses the same pattern:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
try Provider A → fails → wait → try Provider B → fails → wait → try Provider C
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This is sequential fallback. It's the default. And it's wrong for three reasons:
|
|
42
|
+
|
|
43
|
+
1. **You always get one provider's answer** — never the best across all
|
|
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**
|
|
46
|
+
|
|
47
|
+
**What we built:** Parallel ensemble execution. Fire all providers at once. Score every result on specificity, structure, and relevance. Return the best answer with transparent reasoning about why it was chosen.
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
const result = await executeEnsemble(query, systemPrompt, context, {
|
|
51
|
+
nvidia: callNvidia,
|
|
52
|
+
groq: callGroq,
|
|
53
|
+
openai: callOpenAI
|
|
54
|
+
});
|
|
55
|
+
console.log(`Winner: ${result.winner}`); // → nvidia (scored 75)
|
|
56
|
+
console.log(`Reason: ${result.reasoning}`); // → higher specificity on code
|
|
57
|
+
```
|
|
58
|
+
|
|
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
|
+
---
|
|
62
|
+
|
|
63
|
+
## Problem 3: Every Gateway Claims "Negligible Overhead" — None Publish Numbers
|
|
64
|
+
|
|
65
|
+
Gateways add latency. Everyone knows this. Nobody publishes the actual numbers.
|
|
66
|
+
|
|
67
|
+
The standard line is "negligible overhead" followed by zero data. When we started building A3M, we couldn't find a single competitor that published independent latency benchmarks for their own proxy.
|
|
68
|
+
|
|
69
|
+
**What we did:** Ran our proxy through [llm-gateway-bench](https://github.com/taffy-owo/llm-gateway-bench) — a third-party benchmarking tool — and published every number.
|
|
70
|
+
|
|
71
|
+
| Scenario | TTFT | What happens |
|
|
72
|
+
|:---------|:----:|:-------------|
|
|
73
|
+
| Direct to Groq | **138ms** | Raw provider call |
|
|
74
|
+
| Through A3M (forced) | **234ms** | Guardrails + cache + cost tracking |
|
|
75
|
+
| Through A3M (auto) | **374ms** | Above + routing decision (12 signals) |
|
|
76
|
+
|
|
77
|
+
The overhead is real. It's also documented, reproducible, and pays for itself — 236ms saves 62% on API costs.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Why Developers Switched
|
|
82
|
+
|
|
83
|
+
The three pain points above keep coming up in the same pattern:
|
|
84
|
+
|
|
85
|
+
1. **"My bill is out of control"** → They try the routing → 62% savings
|
|
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.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
*GitHub: [github.com/Das-rebel/a3m-router](https://github.com/Das-rebel/a3m-router)*
|
|
94
|
+
*npm: `npm install adaptive-memory-multi-model-router`*
|
|
95
|
+
*Benchmark methodology: [docs/BENCHMARK.md](https://github.com/Das-rebel/a3m-router/blob/main/docs/BENCHMARK.md)*
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# 🌐 A3M Router — Cross-Platform Posting Kit (May 2026)
|
|
2
|
+
|
|
3
|
+
All posts focus on the **three pain points** developers actually told us about.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📺 dev.to
|
|
8
|
+
|
|
9
|
+
**Title:** Three LLM Infrastructure Problems That Shouldn't Exist in 2026
|
|
10
|
+
|
|
11
|
+
**Tags:** llm, devops, infrastructure, ai, opensource
|
|
12
|
+
|
|
13
|
+
**Content:** `articles/FRESH_devto_2026_05.md`
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 🐙 Hacker News (Show HN)
|
|
18
|
+
|
|
19
|
+
**Title:** Show HN: A3M – Fixing three LLM infrastructure problems (10K downloads, 62% savings)
|
|
20
|
+
|
|
21
|
+
**URL:** https://github.com/Das-rebel/a3m-router
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🔴 Reddit
|
|
26
|
+
|
|
27
|
+
**r/javascript**
|
|
28
|
+
> Three LLM infrastructure problems that shouldn't exist:
|
|
29
|
+
> 1. Bills 3x higher than needed (62% savings with smart routing)
|
|
30
|
+
> 2. Sequential fallback (we run providers in parallel + score results)
|
|
31
|
+
> 3. No real benchmarks (we published third-party latency data)
|
|
32
|
+
>
|
|
33
|
+
> Built in TypeScript, 19.5 KB, open-source. 10K downloads, zero marketing.
|
|
34
|
+
> https://github.com/Das-rebel/a3m-router
|
|
35
|
+
|
|
36
|
+
**r/typescript**
|
|
37
|
+
> A3M Router — 19.5 KB TypeScript LLM router solving three real problems:
|
|
38
|
+
> 62% cost savings, parallel ensemble (unique), independent benchmarks.
|
|
39
|
+
> https://github.com/Das-rebel/a3m-router
|
|
40
|
+
|
|
41
|
+
**r/opensource**
|
|
42
|
+
> Open-source LLM router (MIT) that solves real pain points instead of imaginary ones.
|
|
43
|
+
> 47 providers, 19.5 KB, zero ML. 10K downloads in 14 days.
|
|
44
|
+
> https://github.com/Das-rebel/a3m-router
|
|
45
|
+
|
|
46
|
+
**r/LLMDevs**
|
|
47
|
+
> Three LLM infrastructure problems we fixed with an open-source router:
|
|
48
|
+
> - Budget overruns (62% savings)
|
|
49
|
+
> - Sequential fallback (parallel + scoring instead)
|
|
50
|
+
> - Black box benchmarks (published independent latency data)
|
|
51
|
+
> https://github.com/Das-rebel/a3m-router
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 🐦 Twitter / X
|
|
56
|
+
|
|
57
|
+
Thread in `articles/twitter-thread-cost-savings.md`
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 📧 Newsletters
|
|
62
|
+
|
|
63
|
+
| Newsletter | Submit URL | Title |
|
|
64
|
+
|:-----------|:-----------|:------|
|
|
65
|
+
| TLDR | https://tldr.tech/submit | Three LLM Infrastructure Problems That Shouldn't Exist in 2026 |
|
|
66
|
+
| Node Weekly | https://nodeweekly.com/submit | A3M Router — 19.5 KB LLM router with parallel ensemble |
|
|
67
|
+
| JavaScript Weekly | https://javascriptweekly.com/submit | Three LLM infrastructure problems solved with 19.5 KB of TypeScript |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
We built an open-source LLM router that solves three real problems developers keep hitting:
|
|
2
|
+
|
|
3
|
+
**Problem 1 — LLM bills are 3x higher than they should be.**
|
|
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.
|
|
5
|
+
|
|
6
|
+
**Problem 2 — Sequential fallback gives you one provider's answer, not the best one.**
|
|
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.
|
|
8
|
+
|
|
9
|
+
**Problem 3 — Every gateway claims "negligible overhead" without publishing numbers.**
|
|
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.
|
|
11
|
+
|
|
12
|
+
19.5 KB. Zero ML dependencies. 47 providers. 10K downloads in 14 days.
|
|
13
|
+
|
|
14
|
+
https://github.com/Das-rebel/a3m-router
|
|
@@ -1,84 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
1/7 Three LLM infrastructure problems that shouldn't exist in 2026:
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
• Your bill is 3x higher than it should be
|
|
4
|
+
• Sequential fallback gives you one provider's answer, not the best one
|
|
5
|
+
• Every gateway claims "negligible overhead" without publishing numbers
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
We built something that fixes all three.
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
2/7 Problem 1: Your LLM bill is 3x higher than it should be.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
Every query goes to GPT-4 because configuring per-query routing is a pain.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
A3M classifies every query by complexity (12 signals) and routes to the cheapest capable model.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
Simple Q&A → free ($0)
|
|
16
|
+
Code → cheap ($0.20/M)
|
|
17
|
+
Expert → premium ($2.50/M)
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
A3M Router: 82.5% (±1 tier) — Node.js + keywords + 0 bytes model
|
|
19
|
+
62% cost savings.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
3/7 Problem 2: Sequential fallback is a design flaw.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
Every gateway does: try A → fail → try B → fail → try C.
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
RouteLLM needs:
|
|
26
|
-
- Python + PyTorch + CUDA
|
|
27
|
-
- ~500MB BERT model download
|
|
28
|
-
- GPU for inference
|
|
29
|
-
- ~3s cold start
|
|
30
|
-
- ~2GB install
|
|
25
|
+
You always get one provider's answer. Never the best across all.
|
|
31
26
|
|
|
32
|
-
A3M
|
|
33
|
-
- Node.js
|
|
34
|
-
- 3MB install
|
|
35
|
-
- No GPU
|
|
36
|
-
- 50ms cold start
|
|
27
|
+
A3M runs ALL providers in parallel, scores every result, and returns the best answer with reasoning.
|
|
37
28
|
|
|
38
|
-
|
|
29
|
+
We call it parallel ensemble. No other router does this.
|
|
39
30
|
|
|
40
|
-
|
|
41
|
-
63.7% average cost reduction.
|
|
31
|
+
4/7 Problem 3: "Negligible overhead" with zero data.
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
After: queries routed to cheapest capable provider
|
|
33
|
+
Every gateway claims this. None publish numbers.
|
|
45
34
|
|
|
46
|
-
|
|
47
|
-
Code gen: $0.05 -> $0.0004 (Groq)
|
|
48
|
-
Complex reasoning: $0.03 -> $0.03 (stays premium)
|
|
35
|
+
We ran ours through a third-party benchmarking tool (llm-gateway-bench) and published everything:
|
|
49
36
|
|
|
50
|
-
|
|
37
|
+
Direct: 138ms
|
|
38
|
+
Through A3M: 374ms
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
Day 1: 552 downloads
|
|
54
|
-
Day 2: 320 downloads
|
|
55
|
-
Day 3: 1,903 downloads
|
|
40
|
+
236ms overhead saves 62% on API costs. Reproducible by anyone.
|
|
56
41
|
|
|
57
|
-
|
|
42
|
+
5/7 Why 10K developers downloaded it in 14 days (zero marketing):
|
|
58
43
|
|
|
59
|
-
|
|
60
|
-
```javascript
|
|
61
|
-
const { createA3MRouter } = require('adaptive-memory-multi-model-router');
|
|
62
|
-
const router = createA3MRouter();
|
|
44
|
+
They told us they were hacking these solutions together manually — running prompts through multiple providers in separate browser tabs, comparing outputs by hand.
|
|
63
45
|
|
|
64
|
-
|
|
65
|
-
await router.route("What is 2+2?");
|
|
66
|
-
// -> free provider ($0.00)
|
|
46
|
+
We automated what they were already doing.
|
|
67
47
|
|
|
68
|
-
|
|
69
|
-
// -> Groq ($0.0004, 0.4s)
|
|
70
|
-
```
|
|
48
|
+
6/7 What's inside the 19.5 KB package:
|
|
71
49
|
|
|
72
|
-
|
|
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
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
7/7 npm install adaptive-memory-multi-model-router
|
|
59
|
+
npx a3m-router serve
|
|
76
60
|
|
|
77
|
-
|
|
78
|
-
NPM: npmjs.com/package/adaptive-memory-multi-model-router
|
|
79
|
-
|
|
80
|
-
82.5% accuracy. Zero ML. Zero GPU. Matches BERT within 2.5%. 63.7% cost savings. 40 providers.
|
|
61
|
+
Point any OpenAI SDK at localhost:8787.
|
|
81
62
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#LLM #AI #RouteLLM #BenchmarkOrGTFO #OpenSource #JavaScript #CostOptimization
|
|
63
|
+
GitHub: github.com/Das-rebel/a3m-router
|
|
64
|
+
Docs: github.com/Das-rebel/a3m-router#benchmark-results-real-api-calls
|
package/dist/tui/dashboard.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* A3M Router
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* A3M Router — Terminal Overlay Box
|
|
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.
|
|
7
7
|
*/
|
|
8
8
|
export {};
|