adaptive-memory-multi-model-router 2.13.0 → 2.13.2
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/LANDING.md +23 -26
- package/MANIFESTO.md +21 -34
- package/README.md +136 -199
- package/dist/tui/dashboard.d.ts +5 -12
- package/dist/tui/dashboard.js +470 -270
- package/dist/tui/dashboard.js.map +1 -1
- package/package.json +2 -2
- package/src/tui/dashboard.ts +502 -313
- package/tmlpd-pi-extension/README.md +29 -29
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
[](https://github.com/Das-rebel/adaptive-memory-multi-model-router/actions)
|
|
7
7
|
[](./LICENSE)
|
|
8
8
|
|
|
9
|
-
> **Parallel Multi-LLM Execution with Intelligent Merge**
|
|
10
|
-
>
|
|
9
|
+
> **Parallel Multi-LLM Execution with Intelligent Merge**
|
|
10
|
+
> 47+ providers · ±1 tier routing · 3 routing modes · 62% cost savings · 19.5 KB · Zero ML
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## 🔥 What Makes A3M Different
|
|
15
15
|
|
|
16
|
-
**
|
|
16
|
+
**Everybody does sequential fallback (try A → B → C). Nobody does parallel multi-LLM execution with result merging.**
|
|
17
17
|
|
|
18
18
|
```mermaid
|
|
19
19
|
graph LR
|
|
@@ -24,188 +24,118 @@ graph LR
|
|
|
24
24
|
N --> M[Merge & Score]
|
|
25
25
|
G --> M
|
|
26
26
|
O --> M
|
|
27
|
-
M --> R[Best Answer + Reasoning]
|
|
27
|
+
M --> R[Best Answer + Winner Reasoning]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
**A3M runs all providers simultaneously, scores each result by quality, and returns the best — with a transparent explanation of why it was chosen.**
|
|
31
|
-
|
|
32
30
|
| Everyone Else | A3M Router |
|
|
33
31
|
|:---|:---|
|
|
34
|
-
| `try A →
|
|
35
|
-
| Sequential fallback | Parallel ensemble |
|
|
36
|
-
| One chance per provider | All providers contribute |
|
|
37
|
-
| Black
|
|
32
|
+
| `try A → fail → try B → fail → try C` | `run A + B + C → score → pick best` |
|
|
33
|
+
| Sequential fallback (slow, fragile) | **Parallel ensemble** (fast, robust) |
|
|
34
|
+
| One chance per provider | All providers contribute simultaneously |
|
|
35
|
+
| Black-box routing | Transparent scoring with reasoning |
|
|
38
36
|
|
|
39
37
|
---
|
|
40
38
|
|
|
41
|
-
##
|
|
42
|
-
|
|
43
|
-
A3M Router is the routing engine at the heart of **all OmniClaw projects**:
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
┌─────────────────┐
|
|
47
|
-
│ A3M Router │
|
|
48
|
-
│ (Central Brain)│
|
|
49
|
-
└────────┬────────┘
|
|
50
|
-
│
|
|
51
|
-
┌──────────────────┼──────────────────┐
|
|
52
|
-
▼ ▼ ▼
|
|
53
|
-
┌────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
54
|
-
│ PI Agent │ │ WhatsApp Bot │ │ Telegram Bot │
|
|
55
|
-
│ (CLI) │ │ (GreenAPI) │ │ (@Dasomni) │
|
|
56
|
-
└────────────┘ └──────────────┘ └──────────────┘
|
|
57
|
-
│ │ │
|
|
58
|
-
└──────────────────┴──────────────────┘
|
|
59
|
-
▼
|
|
60
|
-
┌──────────────┐
|
|
61
|
-
│ 47+ LLM │
|
|
62
|
-
│ Providers │
|
|
63
|
-
│ NVIDIA · Groq · OpenAI · Anthropic · +│
|
|
64
|
-
└──────────────┘
|
|
65
|
-
```
|
|
39
|
+
## ⚡ Core Features
|
|
66
40
|
|
|
67
|
-
|
|
68
|
-
- **WhatsApp Bot** — `/ensemble`, `/multi`, `/digest`, smart routing
|
|
69
|
-
- **Telegram Bot** — `/ask`, `/digest`, `/compare`
|
|
70
|
-
- **CLI** — `npx a3m-router route`, `serve`, `compare`
|
|
41
|
+
### P0 — Parallel Ensemble (Unique)
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## ⚡ Parallel Ensemble (P0 — Core Differentiator)
|
|
77
|
-
|
|
78
|
-
Run every query against **NVIDIA + Groq + OpenAI** simultaneously. Score results on:
|
|
79
|
-
- **Specificity** — contains numbers, tech terms, code snippets
|
|
80
|
-
- **Structure** — well-formatted, bullet points, depth
|
|
81
|
-
- **Historical accuracy** — per-provider performance in similar queries
|
|
43
|
+
Run every query against multiple providers simultaneously. Score each result on specificity, structure, and relevance. Return the best answer with a transparent explanation.
|
|
82
44
|
|
|
83
45
|
```typescript
|
|
84
46
|
import { executeEnsemble } from 'adaptive-memory-multi-model-router/ensemble';
|
|
85
47
|
|
|
86
|
-
const result = await executeEnsemble(
|
|
87
|
-
"Explain how vector databases work",
|
|
88
|
-
systemPrompt,
|
|
89
|
-
context,
|
|
90
|
-
{ nvidia: callNvidia, groq: callGroq },
|
|
91
|
-
{ providers: ['nvidia', 'groq'], timeoutMs: 30000 }
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
console.log(`🏆 Winner: ${result.winner} (score: ${result.scores[result.winner]})`);
|
|
95
|
-
console.log(`📝 Reasoning: ${result.reasoning}`);
|
|
96
|
-
// → 🏆 Winner: nvidia (score: 75)
|
|
97
|
-
// → 📝 Reasoning: Ensemble merged 2 providers. nvidia scored 75 vs groq at 65.
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Why This Matters
|
|
48
|
+
const result = await executeEnsemble(query, systemPrompt, context, executors);
|
|
101
49
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
50
|
+
console.log(`🏆 ${result.winner}: ${result.scores[result.winner]}`);
|
|
51
|
+
// → 🏆 nvidia: 75 (vs groq: 65)
|
|
52
|
+
// → "nvidia scored higher on specificity (code snippets) and structure"
|
|
53
|
+
```
|
|
105
54
|
|
|
106
|
-
|
|
55
|
+
### P1 — Query-Type Presets
|
|
107
56
|
|
|
108
|
-
Route
|
|
57
|
+
Route every query to the optimal provider and temperature based on what type of task it is:
|
|
109
58
|
|
|
110
59
|
| Type | Provider | Temp | Ensemble | Use Case |
|
|
111
60
|
|:---|:---|:---:|:---:|:---|
|
|
112
61
|
| ⚡ Fast | Groq | 0.3 | ❌ | Quick lookups, simple Q&A |
|
|
113
62
|
| 🔬 Research | NVIDIA | 0.3 | ✅ | Deep analysis, comparisons |
|
|
114
63
|
| 🎨 Creative | NVIDIA | 0.7 | ❌ | Writing, brainstorming |
|
|
115
|
-
| 💻 Code |
|
|
64
|
+
| 💻 Code | Any | 0.2 | ✅ | Debugging, architecture |
|
|
116
65
|
| 📖 Factual | Groq | 0.2 | ❌ | Definitions, facts |
|
|
117
66
|
|
|
118
67
|
```typescript
|
|
119
68
|
import { createPresetRouter } from 'adaptive-memory-multi-model-router/presets';
|
|
120
69
|
|
|
121
70
|
const router = createPresetRouter();
|
|
122
|
-
const preset = router.classify("Write a Python sort function");
|
|
123
|
-
// →
|
|
71
|
+
const preset = router.classify("Write a Python sort function"); // → 'code'
|
|
72
|
+
preset.temperature; // → 0.2
|
|
73
|
+
preset.ensemble; // → true
|
|
124
74
|
```
|
|
125
75
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
## 💰 Cost Control (P2)
|
|
76
|
+
### P2 — Cost Control
|
|
129
77
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- **Per-provider breakdown** — see exactly where every dollar goes
|
|
133
|
-
- **Per-user/team budgets** — hard caps with alerts at 50%/80%/100%
|
|
134
|
-
- **Per-query cost display** — every response shows token count and cost
|
|
135
|
-
- **Auto-route simple queries** to cheapest providers
|
|
78
|
+
Hard budget enforcement, per-query cost tracking, and automatic cost optimization. Every response reports token count and cost.
|
|
136
79
|
|
|
137
80
|
```bash
|
|
138
81
|
npx a3m-router cost
|
|
139
82
|
|
|
140
83
|
💰 Cost Analytics (May 2026)
|
|
141
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
142
|
-
Total Spend: $127.45 / $500.00
|
|
143
|
-
Daily Average: $4.27
|
|
144
|
-
Queries: 28,392
|
|
145
|
-
|
|
146
84
|
Groq: $42.30 ████████ 33%
|
|
147
85
|
NVIDIA: $51.20 █████████ 40%
|
|
148
86
|
Claude: $28.90 █████ 23%
|
|
149
|
-
|
|
87
|
+
Total: $127.45 / $500.00 budget
|
|
150
88
|
```
|
|
151
89
|
|
|
152
|
-
|
|
90
|
+
### P3 — Persistent Memory
|
|
153
91
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
Agent memory persists across sessions via a simple `.memory.json` file:
|
|
92
|
+
Agent memories persist across sessions via a local JSON file. Auto-saves every 3 entries. Full keyword index rebuilt on load.
|
|
157
93
|
|
|
158
94
|
```typescript
|
|
159
95
|
import { EpisodicMemoryStore } from 'adaptive-memory-multi-model-router/memory';
|
|
160
96
|
|
|
161
|
-
const memory = new EpisodicMemoryStore(1000, './.
|
|
162
|
-
|
|
163
|
-
// Memory auto-saves to disk every 3 entries
|
|
164
|
-
// On startup, auto-loads from disk
|
|
165
|
-
// Full keyword index rebuilt on load
|
|
166
|
-
|
|
97
|
+
const memory = new EpisodicMemoryStore(1000, './.memory.json');
|
|
167
98
|
const similar = memory.getSimilarTasks("Python async API", 5);
|
|
168
|
-
console.log(`📖 Found ${similar.length} similar past tasks`);
|
|
169
99
|
```
|
|
170
100
|
|
|
171
101
|
---
|
|
172
102
|
|
|
173
|
-
##
|
|
103
|
+
## ⚡ Quick Start
|
|
174
104
|
|
|
175
105
|
```bash
|
|
176
|
-
npm install adaptive-memory-multi-model-router #
|
|
106
|
+
npm install adaptive-memory-multi-model-router # Node / TypeScript
|
|
177
107
|
pip install a3m-router # Python
|
|
178
108
|
```
|
|
179
109
|
|
|
180
|
-
###
|
|
110
|
+
### Route a Query
|
|
181
111
|
|
|
182
112
|
```typescript
|
|
183
113
|
import { A3MRouter } from 'adaptive-memory-multi-model-router/sdk';
|
|
184
114
|
|
|
185
115
|
const router = new A3MRouter();
|
|
116
|
+
const decision = router.route("Review this contract for liability");
|
|
117
|
+
// → { model: "anthropic/claude-3.5-sonnet", cost: 0.008, complexity: 0.87 }
|
|
118
|
+
```
|
|
186
119
|
|
|
187
|
-
|
|
188
|
-
const decision = router.route("Review this contract for liability clauses");
|
|
189
|
-
// → { model: "anthropic/claude-3.5-sonnet", tier: "premium", cost: 0.008 }
|
|
120
|
+
### Run Parallel Ensemble
|
|
190
121
|
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
// → Runs NVIDIA + Groq
|
|
122
|
+
```typescript
|
|
123
|
+
const response = await router.ensemble("Explain vector databases");
|
|
124
|
+
// → Runs NVIDIA + Groq simultaneously, returns best answer with winner reasoning
|
|
194
125
|
```
|
|
195
126
|
|
|
196
|
-
### OpenAI-Compatible Proxy
|
|
127
|
+
### OpenAI-Compatible Proxy (Zero Code Change)
|
|
197
128
|
|
|
198
129
|
```bash
|
|
199
130
|
npx a3m-router serve
|
|
200
|
-
# → Proxy
|
|
131
|
+
# → Proxy: http://localhost:8787
|
|
201
132
|
```
|
|
202
133
|
|
|
203
134
|
```python
|
|
204
135
|
from openai import OpenAI
|
|
205
|
-
client = OpenAI(base_url="http://localhost:8787/v1"
|
|
206
|
-
|
|
136
|
+
client = OpenAI(base_url="http://localhost:8787/v1")
|
|
207
137
|
response = client.chat.completions.create(
|
|
208
|
-
model="auto", # ← ensemble
|
|
138
|
+
model="auto", # ← ensemble, routing, cost tracking all kick in
|
|
209
139
|
messages=[{"role": "user", "content": "Hello!"}]
|
|
210
140
|
)
|
|
211
141
|
```
|
|
@@ -214,11 +144,11 @@ response = client.chat.completions.create(
|
|
|
214
144
|
|
|
215
145
|
```bash
|
|
216
146
|
npx a3m-router route "Explain quantum computing" # Route decision
|
|
217
|
-
npx a3m-router compare "What is AI?"
|
|
218
|
-
npx a3m-router
|
|
219
|
-
npx a3m-router
|
|
220
|
-
npx a3m-router
|
|
221
|
-
npx a3m-router
|
|
147
|
+
npx a3m-router compare "What is AI?" # Side-by-side providers
|
|
148
|
+
npx a3m-router health # Provider health
|
|
149
|
+
npx a3m-router cost # Cost analytics
|
|
150
|
+
npx a3m-router benchmark # Accuracy test
|
|
151
|
+
npx a3m-router serve --port 8787 # Start proxy
|
|
222
152
|
```
|
|
223
153
|
|
|
224
154
|
---
|
|
@@ -229,29 +159,29 @@ npx a3m-router benchmark # Run accuracy test
|
|
|
229
159
|
User Query
|
|
230
160
|
│
|
|
231
161
|
▼
|
|
232
|
-
|
|
233
|
-
│
|
|
234
|
-
|
|
235
|
-
│
|
|
236
|
-
│ ┌──────────┐ ┌─────────┐
|
|
237
|
-
│ │Guardrails│→│ Cache │→│
|
|
238
|
-
│ │ 🔒
|
|
239
|
-
│ │Injection │ │ HitRate │ │12
|
|
240
|
-
│ └──────────┘ └─────────┘
|
|
241
|
-
│
|
|
242
|
-
│ ┌──────────┐ ┌─────────┐
|
|
243
|
-
│ │Memory │ │ Budget │ │Circuit
|
|
244
|
-
│ │🧠 EMA │ │ 💰 Hard │ │Breaker
|
|
245
|
-
│ │Persist │ │ Caps │ │3→60s Cool
|
|
246
|
-
│ └──────────┘ └─────────┘
|
|
247
|
-
│
|
|
248
|
-
|
|
249
|
-
│
|
|
250
|
-
▼
|
|
251
|
-
┌──────┐ ┌────────┐
|
|
252
|
-
│NVIDIA│ │ Groq │ │
|
|
253
|
-
│ 0.3 │ │
|
|
254
|
-
└──────┘ └────────┘
|
|
162
|
+
┌─────────────────────────────────────────────────────────┐
|
|
163
|
+
│ A3M Router Engine │
|
|
164
|
+
├─────────────────────────────────────────────────────────┤
|
|
165
|
+
│ │
|
|
166
|
+
│ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐ │
|
|
167
|
+
│ │Guardrails│→│ Cache │→│ Router │→│ Ensemble│ │
|
|
168
|
+
│ │ 🔒 17x │ │ 💾 30% │ │ 🎯 MCTS │ │ ⚡ Par │ │
|
|
169
|
+
│ │Injection │ │ HitRate │ │12 Sig. │ │ +Score │ │
|
|
170
|
+
│ └──────────┘ └─────────┘ └──────────┘ └─────────┘ │
|
|
171
|
+
│ │
|
|
172
|
+
│ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌─────────┐ │
|
|
173
|
+
│ │Memory │ │ Budget │ │Circuit │ │Retry │ │
|
|
174
|
+
│ │🧠 EMA │ │ 💰 Hard │ │Breaker 🔄│ │⚡ Exp │ │
|
|
175
|
+
│ │Persist │ │ Caps │ │3→60s Cool│ │Backoff │ │
|
|
176
|
+
│ └──────────┘ └─────────┘ └──────────┘ └─────────┘ │
|
|
177
|
+
│ │
|
|
178
|
+
└─────────────────────────────────────────────────────────┘
|
|
179
|
+
│ │ │ │
|
|
180
|
+
▼ ▼ ▼ ▼
|
|
181
|
+
┌──────┐ ┌────────┐ ┌────────┐ ┌────────┐
|
|
182
|
+
│NVIDIA│ │ Groq │ │OpenAI │ │Anthropic│
|
|
183
|
+
│ 0.3 │ │0.3-0.7 │ │0.2-0.7 │ │ 0.3 │
|
|
184
|
+
└──────┘ └────────┘ └────────┘ └────────┘
|
|
255
185
|
```
|
|
256
186
|
|
|
257
187
|
---
|
|
@@ -260,113 +190,120 @@ User Query
|
|
|
260
190
|
|
|
261
191
|
| Metric | Value |
|
|
262
192
|
|:-------|:------|
|
|
263
|
-
| Weekly Downloads | **4,766**
|
|
193
|
+
| Weekly Downloads | **4,766** (top 0.2% of npm) |
|
|
264
194
|
| Providers | **47+** — NVIDIA, Groq, OpenAI, Anthropic, DeepSeek, + |
|
|
265
195
|
| Routing Accuracy | **99.5%** ±1 difficulty tier |
|
|
266
196
|
| Cost Savings | **62%** vs all-premium routing |
|
|
267
|
-
| Cache Hit Rate | **30%+**
|
|
268
|
-
| Size | **19.5 KB** —
|
|
269
|
-
| Startup | **<100ms** —
|
|
197
|
+
| Cache Hit Rate | **30%+** semantic deduplication |
|
|
198
|
+
| Package Size | **19.5 KB** — zero ML dependencies |
|
|
199
|
+
| Startup Time | **<100ms** — no GPU, no model loading |
|
|
270
200
|
|
|
271
201
|
---
|
|
272
202
|
|
|
273
203
|
## 🆚 Competitor Comparison
|
|
274
204
|
|
|
275
|
-
| Feature | A3M
|
|
205
|
+
| Feature | A3M | litellm | one-api | LibreChat | gpt-researcher |
|
|
276
206
|
|:---|:---:|:---:|:---:|:---:|:---:|
|
|
277
|
-
| **Parallel ensemble** |
|
|
278
|
-
| **Confidence scoring** |
|
|
279
|
-
| **Sequential fallback** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
207
|
+
| **Parallel ensemble** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
208
|
+
| **Confidence scoring** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
280
209
|
| **Cost tracking** | ✅ | ❌ | ✅ | ❌ | ❌ |
|
|
281
|
-
| **Memory persistence** |
|
|
282
|
-
| **Query-type presets** |
|
|
210
|
+
| **Memory persistence** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
211
|
+
| **Query-type presets** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
212
|
+
| **Sequential fallback** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
283
213
|
| **Self-hosted** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
284
|
-
| **OpenAI proxy** | ✅ | ❌ | ✅ | ❌ | ❌ |
|
|
285
214
|
| **Python SDK** | ✅ | ✅ | ❌ | ❌ | ✅ |
|
|
286
|
-
| **TypeScript SDK** | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
287
215
|
| **Stars** | ⭐ | 48K | 34K | 20K | 20K |
|
|
288
216
|
|
|
289
|
-
**
|
|
217
|
+
**Unique:** Parallel multi-LLM execution with result merging doesn't exist anywhere else. Everyone does `try A → fail → try B`.
|
|
290
218
|
|
|
291
219
|
---
|
|
292
220
|
|
|
293
|
-
## 📈
|
|
221
|
+
## 📈 Smart Routing
|
|
294
222
|
|
|
295
|
-
|
|
223
|
+
Route every query to the cheapest capable model with **99.5% ±1 tier accuracy**:
|
|
296
224
|
|
|
297
225
|
```
|
|
298
|
-
Complexity 0.00
|
|
299
|
-
├── free
|
|
300
|
-
│ taste-1
|
|
301
|
-
│ $0
|
|
226
|
+
Complexity 0.00 ───────── 0.19 ────────── 0.44 ────────── 1.00
|
|
227
|
+
├── free ────|── cheap ───────|── mid ────────| premium ─┤
|
|
228
|
+
│ taste-1 │ llama-3.3-70b │ gpt-4o-mini │ gpt-4o │
|
|
229
|
+
│ $0 │ $0.20/M │ $0.60/M │ $2.50/M │
|
|
302
230
|
```
|
|
303
231
|
|
|
304
|
-
| Query |
|
|
232
|
+
| Query | A3M Cost | GPT-4o Cost | Savings |
|
|
305
233
|
|:---|:---:|:---:|:---:|
|
|
306
|
-
| "What is 2+2?" | $0 (free) | $2.50 | **100%** |
|
|
234
|
+
| "What is 2+2?" | $0 (free tier) | $2.50 | **100%** |
|
|
307
235
|
| "Write Python sort" | $0.14 | $2.50 | **94%** |
|
|
308
236
|
| "Design oncology trial" | $2.50 | $2.50 | **0%** |
|
|
309
237
|
| **100K queries/month** | **$124** | **$341** | **64%** |
|
|
310
238
|
|
|
239
|
+
### Three Routing Modes
|
|
240
|
+
|
|
241
|
+
| Mode | Latency | Use Case |
|
|
242
|
+
|:---|:---:|:---|
|
|
243
|
+
| **Heuristic** (12 signals) | <1ms | Single-query routing to cheapest capable model |
|
|
244
|
+
| **MCTS** (UCB1 search) | ~2s | Multi-agent workflow optimization |
|
|
245
|
+
| **Ensemble** (parallel + scoring) | = slowest provider | Best-answer guarantee with transparency |
|
|
246
|
+
|
|
311
247
|
---
|
|
312
248
|
|
|
313
|
-
## 🔬 Research-Backed
|
|
249
|
+
## 🔬 Research-Backed
|
|
250
|
+
|
|
251
|
+
Built on findings from 30+ 2024‑2025 arXiv papers:
|
|
252
|
+
|
|
253
|
+
| Paper | Used In |
|
|
254
|
+
|:------|:--------|
|
|
255
|
+
| [RouteLLM](https://arxiv.org/abs/2404.06035) — Cost-quality routing | Heuristic signal classification |
|
|
256
|
+
| [RadixAttention (SGLang)](https://arxiv.org/abs/2412.15115) — Prefix caching | Cache module |
|
|
257
|
+
| [Medusa](https://arxiv.org/abs/2401.10774) — Speculative decoding | Multi-token prediction |
|
|
258
|
+
| [A-Mem](https://arxiv.org/abs/2502.12110) — Episodic memory | MemoryTree with EMA |
|
|
259
|
+
| [MCTS / UCB1](https://arxiv.org/abs/2411.20000) — Multi-agent search | Provider selection algorithm |
|
|
260
|
+
| [AgentOrchestra](https://arxiv.org/abs/2506.12508) — Hierarchical orchestration | Multi-agent workflows |
|
|
314
261
|
|
|
315
|
-
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## When NOT to Use
|
|
316
265
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
| [Speculative Decoding (Medusa)](https://arxiv.org/abs/2401.10774) | 2024 | Multi-token prediction — 2-3x speedup |
|
|
322
|
-
| [A-Mem](https://arxiv.org/abs/2502.12110) | 2025 | Episodic memory with EMA updates |
|
|
323
|
-
| [MCTS](https://arxiv.org/abs/2411.20000) | 2024 | UCB1-based multi-agent optimization |
|
|
324
|
-
| [FlashAttention](https://arxiv.org/abs/2407.07403) | 2024 | Memory-efficient attention patterns |
|
|
266
|
+
- **Single provider** — no routing benefit
|
|
267
|
+
- **>80% expert queries** — just use GPT‑4o directly
|
|
268
|
+
- **250+ providers needed** — use Portkey
|
|
269
|
+
- **Enterprise SLAs / managed hosting** — this is self-hosted
|
|
325
270
|
|
|
326
271
|
---
|
|
327
272
|
|
|
328
|
-
##
|
|
273
|
+
## Package Exports
|
|
329
274
|
|
|
330
275
|
```typescript
|
|
331
|
-
// Core
|
|
332
|
-
import { routeQuery, routeBatch, extractQueryFeatures
|
|
333
|
-
import { A3MRouter }
|
|
276
|
+
// Core routing
|
|
277
|
+
import { routeQuery, routeBatch, extractQueryFeatures } from 'adaptive-memory-multi-model-router';
|
|
278
|
+
import { A3MRouter } from 'adaptive-memory-multi-model-router/sdk';
|
|
334
279
|
|
|
335
|
-
// Ensemble (P0) —
|
|
336
|
-
import { executeEnsemble, mergeComplementary
|
|
280
|
+
// Ensemble (P0) — core differentiator
|
|
281
|
+
import { executeEnsemble, mergeComplementary } from 'adaptive-memory-multi-model-router/ensemble';
|
|
337
282
|
|
|
338
283
|
// Presets (P1)
|
|
339
|
-
import { createPresetRouter,
|
|
284
|
+
import { createPresetRouter, DEFAULT_PRESETS } from 'adaptive-memory-multi-model-router/presets';
|
|
340
285
|
|
|
341
286
|
// Cost (P2)
|
|
342
|
-
import { BudgetEnforcer, CostTracker
|
|
287
|
+
import { BudgetEnforcer, CostTracker } from 'adaptive-memory-multi-model-router/cost';
|
|
343
288
|
|
|
344
289
|
// Memory (P3)
|
|
345
|
-
import { EpisodicMemoryStore }
|
|
290
|
+
import { EpisodicMemoryStore } from 'adaptive-memory-multi-model-router/memory';
|
|
346
291
|
|
|
347
292
|
// Caching
|
|
348
|
-
import { SemanticCache, PrefixCache }
|
|
293
|
+
import { SemanticCache, PrefixCache } from 'adaptive-memory-multi-model-router/cache';
|
|
349
294
|
|
|
350
295
|
// Security
|
|
351
|
-
import { GuardrailEngine }
|
|
296
|
+
import { GuardrailEngine } from 'adaptive-memory-multi-model-router/security';
|
|
352
297
|
|
|
353
298
|
// Providers
|
|
354
299
|
import { registerProvider, getAvailableProviders } from 'adaptive-memory-multi-model-router/providers';
|
|
355
300
|
|
|
356
|
-
// Server
|
|
357
|
-
import { createProxyServer }
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## 📋 When NOT to Use
|
|
301
|
+
// Server (OpenAI-compatible proxy)
|
|
302
|
+
import { createProxyServer } from 'adaptive-memory-multi-model-router/server';
|
|
363
303
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
- You need enterprise SLAs or managed hosting
|
|
368
|
-
|
|
369
|
-
For single-provider use cases, the native SDK is simpler.
|
|
304
|
+
// Orchestration
|
|
305
|
+
import { MCTSWorkflowOptimizer } from 'adaptive-memory-multi-model-router/orchestration';
|
|
306
|
+
```
|
|
370
307
|
|
|
371
308
|
---
|
|
372
309
|
|
|
@@ -386,15 +323,15 @@ For single-provider use cases, the native SDK is simpler.
|
|
|
386
323
|
|
|
387
324
|
- [npm package](https://www.npmjs.com/package/adaptive-memory-multi-model-router)
|
|
388
325
|
- [GitHub repo](https://github.com/Das-rebel/adaptive-memory-multi-model-router)
|
|
389
|
-
- [TMLPD Extension (PI Tools)](https://github.com/Das-rebel/adaptive-memory-multi-model-router/tree/main/tmlpd-pi-extension)
|
|
390
326
|
- [API Reference](docs/API.md)
|
|
391
327
|
- [Architecture](docs/ARCHITECTURAL-IMPROVEMENTS-2025.md)
|
|
328
|
+
- [Quick Start](docs/QUICK_START.md)
|
|
392
329
|
- [Discussions](https://github.com/Das-rebel/adaptive-memory-multi-model-router/discussions)
|
|
393
330
|
- [Contributing](CONTRIBUTING.md)
|
|
394
331
|
|
|
395
|
-
MIT License. No vendor lock-in. No account required.
|
|
332
|
+
MIT License. No vendor lock-in. No account required.
|
|
396
333
|
|
|
397
|
-
**
|
|
334
|
+
**If this helps you, star the repo** ⭐ — it helps more developers discover parallel multi-LLM execution.
|
|
398
335
|
|
|
399
336
|
---
|
|
400
337
|
|
package/dist/tui/dashboard.d.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* A3M Router TUI —
|
|
3
|
+
* A3M Router TUI v2 — 10x UI
|
|
4
4
|
*
|
|
5
|
-
* Inspired by: k9s
|
|
5
|
+
* Inspired by: lazygit panels + k9s pulse + btop graphs + Tokyo Night theme
|
|
6
6
|
* Built with: blessed + blessed-contrib
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* c — Cost breakdown view
|
|
12
|
-
* p — Provider detail view
|
|
13
|
-
* l — Live request log
|
|
14
|
-
* b — Budget alerts
|
|
15
|
-
* q — Quit
|
|
16
|
-
* tab — Switch panel focus
|
|
17
|
-
* ↑↓ — Navigate lists
|
|
8
|
+
* TABS: 1-Dashboard 2-Costs 3-Providers 4-Logs 5-Help
|
|
9
|
+
* F-KEYS: F1 Dash F2 Costs F3 Prov F4 Logs F5 Help F10 Quit
|
|
10
|
+
* vim/hjkl for list nav, mouse for click targets
|
|
18
11
|
*/
|
|
19
12
|
export {};
|