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 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
- LLM infrastructure has a dirty secret: most "solutions" solve imaginary problems while ignoring the real ones.
3
+ ---
10
4
 
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.
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
- ## Problem 1: Your LLM Bill Is 3x Higher Than It Should Be
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
- Most teams route every query to GPT-4. Not because every query needs GPT-4 โ€” because nobody has time to configure per-query routing.
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 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.
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
- **What we built:** A router that classifies every query by complexity (12 signals across 5 dimensions) and routes it to the cheapest capable model.
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" โ†’ cheap ($0.20/M tokens)
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
- The result: **62% cost savings**. Not theoretical โ€” measured across 200 real API calls in our benchmark suite.
23
+ Result: **62% cost savings** measured across 200 real API calls. Not theoretical.
30
24
 
31
25
  ---
32
26
 
33
- ## Problem 2: Sequential Fallback Is a Design Flaw
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
- This is sequential fallback. It's the default. And it's wrong for three reasons:
31
+ You always get one provider's answer. Never the best across all. If A is slow, everything waits.
42
32
 
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**
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
- **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.
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, systemPrompt, context, {
38
+ const result = await executeEnsemble(query, context, {
51
39
  nvidia: callNvidia,
52
40
  groq: callGroq,
53
41
  openai: callOpenAI
54
42
  });
55
- console.log(`Winner: ${result.winner}`); // โ†’ nvidia (scored 75)
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 Gateway Claims "Negligible Overhead" โ€” None Publish Numbers
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
- 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.
50
+ It's the standard line. "Negligible overhead" followed by zero data.
68
51
 
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.
52
+ We ran ours through a third-party benchmark tool (llm-gateway-bench) and published everything:
70
53
 
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) |
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
- The overhead is real. It's also documented, reproducible, and pays for itself โ€” 236ms saves 62% on API costs.
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 Developers Switched
63
+ ## Why it grew
82
64
 
83
- The three pain points above keep coming up in the same pattern:
65
+ 10,024 downloads in 14 days. Zero marketing. Developers found it on npm, tried it, told other developers.
84
66
 
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.
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
- *Benchmark methodology: [docs/BENCHMARK.md](https://github.com/Das-rebel/a3m-router/blob/main/docs/BENCHMARK.md)*
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
- We built an open-source LLM router that solves three real problems developers keep hitting:
1
+ Three LLM infrastructure problems nobody's fixing properly:
2
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.
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
- **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.
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
- **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.
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. 47 providers. 10K downloads in 14 days.
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 shouldn't exist in 2026:
1
+ 1/7 Three LLM infrastructure problems that keep coming up:
2
2
 
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
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 something that fixes all three.
7
+ We built the thing that fixes all three.
8
8
 
9
- 2/7 Problem 1: Your LLM bill is 3x higher than it should be.
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
- Every query goes to GPT-4 because configuring per-query routing is a pain.
11
+ Another: "Vectorized 27K notes for $0.07. That's pretty amazing."
12
12
 
13
- A3M classifies every query by complexity (12 signals) and routes to the cheapest capable model.
13
+ Everyone's looking for cheaper options. The hard part is doing it per-query without wasting time.
14
14
 
15
- Simple Q&A โ†’ free ($0)
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
- 62% cost savings.
17
+ 3/7 Every LLM "router" does: try A โ†’ fail โ†’ try B โ†’ fail โ†’ try C.
20
18
 
21
- 3/7 Problem 2: Sequential fallback is a design flaw.
19
+ You always get whatever A gave you. Nobody runs them all and picks the best.
22
20
 
23
- Every gateway does: try A โ†’ fail โ†’ try B โ†’ fail โ†’ try C.
21
+ Someone already built `ai-retry` just for the fallback part โ€” that's how common this pain is.
24
22
 
25
- You always get one provider's answer. Never the best across all.
23
+ We run all providers in parallel. Score results. Return the best answer. With reasoning why it won.
26
24
 
27
- A3M runs ALL providers in parallel, scores every result, and returns the best answer with reasoning.
25
+ 4/7 "Negligible overhead" โ€” every gateway claims this. Zero publish numbers.
28
26
 
29
- We call it parallel ensemble. No other router does this.
27
+ We ran ours through llm-gateway-bench (third-party, not our tool) and published everything.
30
28
 
31
- 4/7 Problem 3: "Negligible overhead" with zero data.
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 saves 62% on API costs. Reproducible by anyone.
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
- They told us they were hacking these solutions together manually โ€” running prompts through multiple providers in separate browser tabs, comparing outputs by hand.
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
- We automated what they were already doing.
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
- GitHub: github.com/Das-rebel/a3m-router
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.
@@ -1,8 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  /**
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.
3
+ * A3M Router โ€” Overlay Box (blessed, non-fullscreen)
7
4
  */
8
5
  export {};