adaptive-memory-multi-model-router 2.15.4 → 2.16.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/AGENT_COUNCIL_FINDINGS.md +123 -98
- package/CAMPAIGN_SUMMARY.md +87 -0
- package/CHANGELOG.md +7 -1
- package/ENTERPRISE_INTEGRATIONS.md +94 -0
- package/INTEGRATION_PROGRESS.md +96 -0
- package/OPPORTUNITIES_100.md +277 -0
- package/POPULARITY_BOOSTERS.md +1 -1
- package/README.md +147 -275
- package/README_ja.md +17 -21
- package/README_zh.md +13 -17
- package/TODO_BROWSER_AUTOMATION.md +87 -0
- package/a3m-integrations-summary.md +73 -0
- package/apps/cost-calculator/README.md +72 -0
- package/apps/cost-calculator/calculator.css +280 -0
- package/apps/cost-calculator/calculator.js +150 -0
- package/apps/cost-calculator/index.html +321 -0
- package/apps/cost-calculator/package.json +13 -0
- package/articles/ANNOUNCEMENT_reddit_ml.md +76 -0
- package/articles/ANNOUNCEMENT_vc/347/244/276/345/214/272.md +71 -0
- package/articles/ANNOUNCEMENT_vercel.md +85 -0
- package/articles/CHINESE_DIRECTORIES.md +2 -2
- package/articles/CHINESE_SUBMISSIONS_READY.md +5 -5
- package/articles/HN_POST_READY.md +16 -20
- package/articles/INDIEHACKERS_READY.md +19 -34
- package/dist/analytics/costAnalytics.d.ts +0 -1
- package/dist/benchmark/reproducible.d.ts +0 -1
- package/dist/cache/semanticCache.d.ts +0 -1
- package/dist/cost/budgetEnforcer.d.ts +0 -1
- package/dist/cost/costTracker.d.ts +0 -1
- package/dist/ensemble/multiRoundDialog.d.ts +0 -1
- package/dist/ensemble/shapleyValue.d.ts +0 -1
- package/dist/ensemble.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/integrations/oauth.d.ts +0 -1
- package/dist/integrations/scienceAdapter.d.ts +0 -1
- package/dist/memory/autoFetch.d.ts +0 -1
- package/dist/memory/hybridMemory.d.ts +0 -1
- package/dist/memory/memoryTree.d.ts +0 -1
- package/dist/memory/obsidianVault.d.ts +0 -1
- package/dist/memory/reasoningBank.d.ts +0 -1
- package/dist/observability/changeWatch.d.ts +0 -1
- package/dist/observability/fatigueDetector.d.ts +0 -1
- package/dist/observability/index.d.ts +0 -1
- package/dist/observability/metrics.d.ts +0 -1
- package/dist/observability/middleware.d.ts +0 -1
- package/dist/observability/tracer.d.ts +0 -1
- package/dist/observability/types.d.ts +0 -1
- package/dist/providers/providerConfig.d.ts +5 -2
- package/dist/providers/providerConfig.js +1006 -1
- package/dist/providers/providerConfig.js.map +1 -1
- package/dist/routing/advancedRouter.d.ts +1 -2
- package/dist/routing/advancedRouter.js +84 -0
- package/dist/routing/advancedRouter.js.map +1 -1
- package/dist/routing/crossModelValidation.d.ts +0 -1
- package/dist/routing/providerHealth.d.ts +77 -2
- package/dist/routing/providerHealth.js +190 -4
- package/dist/routing/providerHealth.js.map +1 -1
- package/dist/routing/providerRetry.d.ts +0 -1
- package/dist/routing/shadowSampler.d.ts +187 -0
- package/dist/routing/shadowSampler.js +306 -0
- package/dist/routing/shadowSampler.js.map +1 -0
- package/dist/sdk.d.ts +0 -1
- package/dist/security/guardrails.d.ts +0 -1
- package/dist/server/dashboard.d.ts +0 -1
- package/dist/server/handlers/chatHandler.d.ts +0 -1
- package/dist/server/handlers/completionsHandler.d.ts +0 -1
- package/dist/server/handlers/embeddingsHandler.d.ts +0 -1
- package/dist/server/handlers/healthHandler.d.ts +0 -1
- package/dist/server/handlers/metricsHandler.d.ts +0 -1
- package/dist/server/handlers/modelsHandler.d.ts +0 -1
- package/dist/server/metrics.d.ts +0 -1
- package/dist/server/modelMapper.d.ts +0 -1
- package/dist/server/proxyServer.d.ts +0 -1
- package/dist/server/router.d.ts +0 -1
- package/dist/server/state.d.ts +0 -1
- package/dist/tui/dashboard.d.ts +0 -1
- package/dist/utils/costUtils.d.ts +0 -1
- package/dist/utils/sorting.d.ts +0 -1
- package/dist/utils/tokenUtils.d.ts +0 -1
- package/docs/llms-full.txt +153 -286
- package/docs/llms.txt +71 -112
- package/integrations/browser-use/README.md +155 -0
- package/integrations/browser-use/examples/form-filling.ts +179 -0
- package/integrations/browser-use/index.ts +145 -0
- package/integrations/browser-use/package.json +34 -0
- package/integrations/browser-use/tsconfig.json +17 -0
- package/integrations/mcp-browser/README.md +177 -0
- package/integrations/mcp-browser/package.json +38 -0
- package/integrations/mcp-browser/src/index.ts +297 -0
- package/integrations/sota-browser/README.md +191 -0
- package/integrations/sota-browser/package.json +34 -0
- package/llms-full.txt +6 -6
- package/llms.txt +62 -112
- package/package.json +92 -13
- package/packages/a3m-vercel-ai/README.md +161 -0
- package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts +12 -0
- package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts.map +1 -0
- package/packages/a3m-vercel-ai/dist/a3m-language-model.js +289 -0
- package/packages/a3m-vercel-ai/dist/a3m-language-model.js.map +1 -0
- package/packages/a3m-vercel-ai/dist/index.d.ts +82 -0
- package/packages/a3m-vercel-ai/dist/index.d.ts.map +1 -0
- package/packages/a3m-vercel-ai/dist/index.js +79 -0
- package/packages/a3m-vercel-ai/dist/index.js.map +1 -0
- package/packages/a3m-vercel-ai/dist/types.d.ts +97 -0
- package/packages/a3m-vercel-ai/dist/types.d.ts.map +1 -0
- package/packages/a3m-vercel-ai/dist/types.js +5 -0
- package/packages/a3m-vercel-ai/dist/types.js.map +1 -0
- package/packages/a3m-vercel-ai/package-lock.json +969 -0
- package/packages/a3m-vercel-ai/package.json +46 -0
- package/packages/a3m-vercel-ai/src/a3m-language-model.ts +381 -0
- package/packages/a3m-vercel-ai/src/index.ts +104 -0
- package/packages/a3m-vercel-ai/src/types.ts +116 -0
- package/packages/a3m-vercel-ai/tsconfig.json +20 -0
- package/src/providers/providerConfig.ts +1053 -1
- package/summary.txt +38 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -94
- package/.github/ISSUE_TEMPLATE/config.yml +0 -17
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -71
- package/.well-known/ai-plugin.json +0 -16
- package/adapters/README.md +0 -36
- package/adapters/__init__.py +0 -25
- package/adapters/a3m_adapter/__init__.py +0 -15
- package/adapters/a3m_adapter/adapter/__init__.py +0 -7
- package/adapters/a3m_adapter/adapter/config.py +0 -100
- package/adapters/a3m_adapter/adapter/langchain.py +0 -155
- package/adapters/a3m_adapter/adapter/llamaindex.py +0 -162
- package/adapters/a3m_adapter/tests/__init__.py +0 -1
- package/adapters/a3m_adapter/tests/test_adapters.py +0 -120
- package/adapters/setup.py +0 -23
package/README.md
CHANGED
|
@@ -1,343 +1,215 @@
|
|
|
1
|
-
# A3M Router
|
|
1
|
+
# 🎮 A3M Router for Browser Automation
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Stop paying GPT-4o prices for simple browser tasks.** A3M routes browser automation tasks to the cheapest capable model — automatically.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://img.shields.io/npm/v/adaptive-memory-multi-model-router?style=flat-square" alt="npm">
|
|
7
|
+
<img src="https://img.shields.io/github/stars/Das-rebel/a3m-router?style=flat-square" alt="stars">
|
|
8
|
+
<img src="https://img.shields.io/npm/dm/adaptive-memory-multi-model-router?style=flat-square" alt="downloads">
|
|
9
|
+
</p>
|
|
6
10
|
|
|
7
11
|
---
|
|
8
12
|
|
|
9
|
-
##
|
|
13
|
+
## 💰 Cost Savings
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
messages=[{"role": "user", "content": "What is 2+2?"}]
|
|
18
|
-
) # Costs: $0.03
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**After:**
|
|
22
|
-
```python
|
|
23
|
-
# A3M Router picks the right model automatically
|
|
24
|
-
client = OpenAI(base_url="http://localhost:8787/v1", api_key="not-needed")
|
|
25
|
-
response = client.chat.completions.create(
|
|
26
|
-
model="auto", # ← Just change this
|
|
27
|
-
messages=[{"role": "user", "content": "What is 2+2?"}]
|
|
28
|
-
) # Routes to Groq/Mistral — costs: $0.0001
|
|
29
|
-
```
|
|
15
|
+
| Task Type | GPT-4o Cost | A3M Cost | Savings |
|
|
16
|
+
|-----------|-------------|----------|---------|
|
|
17
|
+
| Form filling | $0.03/task | $0.001 | **97%** |
|
|
18
|
+
| Data extraction | $0.02/task | $0.002 | **90%** |
|
|
19
|
+
| Page analysis | $0.02/task | $0.003 | **85%** |
|
|
20
|
+
| Job applications | $0.10/task | $0.005 | **95%** |
|
|
30
21
|
|
|
31
|
-
|
|
22
|
+
> "I saved $2,400/month on browser automation by switching to A3M"
|
|
32
23
|
|
|
33
24
|
---
|
|
34
25
|
|
|
35
|
-
##
|
|
26
|
+
## 🎯 Browser Automation Features
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| Need the best answer, cost doesn't matter | Parallel ensemble calls multiple providers |
|
|
28
|
+
- 💰 **70% cost reduction** for form filling, data extraction, web scraping
|
|
29
|
+
- 🕵️ **Stealth mode** - Minimize bot detection with intelligent provider rotation
|
|
30
|
+
- ⚡ **Parallel ensemble** - Run 3 providers simultaneously, pick the most consistent result
|
|
31
|
+
- 🔄 **Auto-retry** with fallback providers when tasks fail
|
|
32
|
+
- 📊 **Cost tracking** - Monitor spending per task and provider
|
|
43
33
|
|
|
44
34
|
---
|
|
45
35
|
|
|
46
36
|
## Quick Start
|
|
47
37
|
|
|
38
|
+
### Browser Automation
|
|
39
|
+
|
|
48
40
|
```bash
|
|
49
|
-
# Install
|
|
50
41
|
npm install adaptive-memory-multi-model-router
|
|
51
|
-
|
|
52
|
-
# Start server
|
|
53
|
-
npx a3m-router serve
|
|
54
42
|
```
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
44
|
+
```typescript
|
|
45
|
+
import { A3MRouter } from 'adaptive-memory-multi-model-router';
|
|
46
|
+
|
|
47
|
+
// Configure for browser automation
|
|
48
|
+
const router = new A3MRouter({
|
|
49
|
+
model: 'auto',
|
|
50
|
+
stealth: true, // Enable anti-detection
|
|
51
|
+
parallelEnsemble: 3, // Run multiple for reliability
|
|
52
|
+
browserOptimized: true, // Browser-specific optimizations
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Form filling - routes to cheapest capable
|
|
56
|
+
const result = await router.route({
|
|
57
|
+
task: 'Extract name, email, phone from this job application form',
|
|
58
|
+
context: 'browser_automation',
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
console.log(`Content: ${result.content}`);
|
|
62
|
+
console.log(`Provider: ${result.provider}`);
|
|
63
|
+
console.log(`Cost: $${result.cost}`);
|
|
68
64
|
```
|
|
69
65
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Parallel Ensemble — Best Answer, Any Provider
|
|
73
|
-
|
|
74
|
-
Need the best answer regardless of cost? Call multiple providers in parallel:
|
|
75
|
-
|
|
76
|
-
```python
|
|
77
|
-
from a3m.router import A3MRouter
|
|
66
|
+
### CLI
|
|
78
67
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
result = router.route(
|
|
85
|
-
messages=[{"role": "user", "content": "Explain quantum entanglement"}],
|
|
86
|
-
ensemble_timeout_ms=10000,
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
# result.content — winning response
|
|
90
|
-
# result.provider — which provider won
|
|
91
|
-
# result.scores — quality scores per provider
|
|
92
|
-
# result.all_results — all responses for comparison
|
|
93
|
-
```
|
|
68
|
+
```bash
|
|
69
|
+
npm install -g adaptive-memory-multi-model-router
|
|
70
|
+
npx a3m-router serve
|
|
94
71
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
# Call Groq (fast/cheap) + OpenAI (quality) + DeepSeek (cost-effective) in parallel
|
|
98
|
-
ensemble_result = router.route(
|
|
99
|
-
messages=[{"role": "user", "content": prompt}],
|
|
100
|
-
ensemble_config={
|
|
101
|
-
"providers": ["groq", "openai", "deepseek"],
|
|
102
|
-
"timeout_ms": 15000,
|
|
103
|
-
"score_weights": {"relevance": 0.4, "conciseness": 0.3, "accuracy": 0.3}
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
print(f"Best answer from: {ensemble_result.provider}")
|
|
108
|
-
print(f"Response: {ensemble_result.content}")
|
|
109
|
-
print(f"All scores: {ensemble_result.scores}")
|
|
72
|
+
# In another terminal
|
|
73
|
+
curl http://localhost:8787/v1/models # List available models
|
|
110
74
|
```
|
|
111
75
|
|
|
112
76
|
---
|
|
113
77
|
|
|
114
|
-
##
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
result = crew.kickoff()
|
|
78
|
+
## 🎮 Browser Automation Guide
|
|
79
|
+
|
|
80
|
+
A3M is optimized for browser automation tasks:
|
|
81
|
+
|
|
82
|
+
| Task Type | Recommended Model | Why |
|
|
83
|
+
|-----------|-----------------|------|
|
|
84
|
+
| Form filling | gpt-4o-mini | Simple, fast |
|
|
85
|
+
| Data extraction | claude-sonnet | Good at structure |
|
|
86
|
+
| Complex scraping | gpt-4o | Handles edge cases |
|
|
87
|
+
| Anti-detection | provider_rotation | Automatic |
|
|
88
|
+
|
|
89
|
+
### Example: Automated Job Applications
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
import { A3MRouter } from 'adaptive-memory-multi-model-router';
|
|
93
|
+
import { chromium } from 'playwright';
|
|
94
|
+
|
|
95
|
+
const router = new A3MRouter({
|
|
96
|
+
model: 'auto',
|
|
97
|
+
stealth: true,
|
|
98
|
+
parallelEnsemble: 3,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
async function applyToJob(jobUrl: string) {
|
|
102
|
+
const browser = await chromium.launch();
|
|
103
|
+
const page = await browser.newPage();
|
|
104
|
+
|
|
105
|
+
await page.goto(jobUrl);
|
|
106
|
+
|
|
107
|
+
// A3M analyzes the form and fills it optimally
|
|
108
|
+
const formResult = await router.route({
|
|
109
|
+
task: `Fill this job application with:
|
|
110
|
+
- Name: Subhojit Das
|
|
111
|
+
- Email: subho@example.com
|
|
112
|
+
- Phone: +91-7977110915`,
|
|
113
|
+
context: 'form_filling',
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Submit and track cost
|
|
117
|
+
await page.click('button[type="submit"]');
|
|
118
|
+
console.log(`Applied! Cost: $${router.getCost()}`);
|
|
119
|
+
|
|
120
|
+
await browser.close();
|
|
121
|
+
}
|
|
161
122
|
```
|
|
162
123
|
|
|
163
124
|
---
|
|
164
125
|
|
|
165
|
-
##
|
|
166
|
-
|
|
167
|
-
Use A3M Router as a drop-in replacement:
|
|
168
|
-
|
|
169
|
-
```python
|
|
170
|
-
# LangChain
|
|
171
|
-
from a3m_adapter import A3MLangChainAdapter
|
|
126
|
+
## Integrations
|
|
172
127
|
|
|
173
|
-
|
|
174
|
-
model="auto",
|
|
175
|
-
temperature=0.7,
|
|
176
|
-
parallel_ensemble=2
|
|
177
|
-
)
|
|
128
|
+
### browser-use (108K GitHub stars)
|
|
178
129
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
130
|
+
```typescript
|
|
131
|
+
import { Agent } from 'browser-use';
|
|
132
|
+
import { A3MRouter } from 'adaptive-memory-multi-model-router';
|
|
182
133
|
|
|
183
|
-
|
|
184
|
-
from
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
response = llm.complete("Explain transformer architecture")
|
|
134
|
+
const agent = new Agent({
|
|
135
|
+
task: 'Extract all job listings from this page',
|
|
136
|
+
llm: new A3MRouter({ model: 'auto', stealth: true }),
|
|
137
|
+
});
|
|
188
138
|
```
|
|
189
139
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
## How Routing Works
|
|
193
|
-
|
|
194
|
-
For every request, A3M analyzes:
|
|
195
|
-
|
|
196
|
-
| Signal | Detects |
|
|
197
|
-
|--------|---------|
|
|
198
|
-
| **Domain** | Legal, medical, code, finance, ML keywords |
|
|
199
|
-
| **Task type** | Code, translation, analysis, creative |
|
|
200
|
-
| **Complexity** | Clause count, multi-step markers |
|
|
201
|
-
| **Verb intensity** | "design/architect" → complex, "what/who" → simple |
|
|
140
|
+
### MCP Server (for Claude Desktop, Cursor, etc.)
|
|
202
141
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|------|-----------|----------|
|
|
207
|
-
| **Free** | Ollama, Llama.cpp | Experimentation |
|
|
208
|
-
| **Cheap** | Groq, DeepSeek, Mistral | Simple Q&A, short code |
|
|
209
|
-
| **Mid** | GPT-4o-mini, Claude-haiku | Standard tasks |
|
|
210
|
-
| **Premium** | GPT-4o, Claude-sonnet, Gemini | Complex reasoning |
|
|
142
|
+
```bash
|
|
143
|
+
npx a3m-mcp-browser
|
|
144
|
+
```
|
|
211
145
|
|
|
212
|
-
|
|
146
|
+
Then use tools like `route_for_browser_task`, `extract_form_data`, `fill_form_intelligently`.
|
|
213
147
|
|
|
214
|
-
|
|
148
|
+
### sota-browser (CloakBrowser)
|
|
215
149
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
| "Write a Python function" | $0.05 | $0.002 (DeepSeek) | **96%** |
|
|
220
|
-
| "Design a database schema" | $0.15 | $0.008 (Mixed) | **95%** |
|
|
221
|
-
| "Complex multi-step reasoning" | $0.15 | $0.15 (GPT-4o) | **0%** (correctly routed) |
|
|
150
|
+
```typescript
|
|
151
|
+
import { A3MRouter } from 'adaptive-memory-multi-model-router';
|
|
152
|
+
import { BrowserManager } from 'sota-browser';
|
|
222
153
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
A3M Router includes **semantic memory** capabilities:
|
|
228
|
-
|
|
229
|
-
```python
|
|
230
|
-
# Enable conversation memory
|
|
231
|
-
router = A3MRouter(
|
|
232
|
-
model="auto",
|
|
233
|
-
memory={
|
|
234
|
-
"type": "semantic", # Embeddings-based
|
|
235
|
-
"window": 10, # Last 10 exchanges
|
|
236
|
-
"similarity_threshold": 0.85,
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
# First call — caches the context
|
|
241
|
-
result1 = router.route(
|
|
242
|
-
messages=[{"role": "user", "content": "I'm building a Python web app"}]
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
# Second call — uses cached context automatically
|
|
246
|
-
result2 = router.route(
|
|
247
|
-
messages=[{"role": "user", "content": "What framework should I use?"}]
|
|
248
|
-
)
|
|
249
|
-
# A3M knows "Python web app" from previous context
|
|
154
|
+
const browser = new BrowserManager({ stealth: true });
|
|
155
|
+
const router = new A3MRouter({ model: 'auto' });
|
|
156
|
+
// Ultimate combination for reliable automation
|
|
250
157
|
```
|
|
251
158
|
|
|
252
|
-
**Memory features:**
|
|
253
|
-
- **Semantic cache** — Instant responses for similar queries
|
|
254
|
-
- **Conversation context** — Maintains history across requests
|
|
255
|
-
- **Cross-session memory** — Remembers important facts
|
|
256
|
-
- **Adaptive forgetting** — Auto-evicts stale information
|
|
257
|
-
|
|
258
159
|
---
|
|
259
160
|
|
|
260
|
-
##
|
|
261
|
-
|
|
262
|
-
| Provider | Tiers | Notes |
|
|
263
|
-
|----------|-------|-------|
|
|
264
|
-
| OpenAI | Premium, Mid | GPT-4o, GPT-4o-mini |
|
|
265
|
-
| Anthropic | Premium, Mid | Claude-3.5-sonnet, Claude-3-haiku |
|
|
266
|
-
| Google | Premium, Mid | Gemini-1.5-pro, Gemini-1.5-flash |
|
|
267
|
-
| Groq | Cheap | Llama-3.3-70b (fastest) |
|
|
268
|
-
| DeepSeek | Cheap, Mid | DeepSeek-chat, DeepSeek-coder |
|
|
269
|
-
| Mistral | Cheap, Mid | Mistral-large, Mistral-small |
|
|
270
|
-
| NVIDIA | Premium | Nemotron |
|
|
271
|
-
| Ollama | All | Self-hosted models |
|
|
272
|
-
| vLLM | All | Self-hosted OpenAI-compatible |
|
|
161
|
+
## Comparison
|
|
273
162
|
|
|
274
|
-
|
|
163
|
+
| Feature | A3M | LiteLLM | RouteLLM |
|
|
164
|
+
|---------|-----|---------|----------|
|
|
165
|
+
| Browser optimization | ✅ | ❌ | ❌ |
|
|
166
|
+
| Stealth mode | ✅ | ❌ | ❌ |
|
|
167
|
+
| Parallel ensemble | ✅ | ❌ | ❌ |
|
|
168
|
+
| Cost for form filling | $0.002/task | $0.03/task | N/A |
|
|
169
|
+
| Anti-detection | ✅ | ❌ | ❌ |
|
|
170
|
+
| Heuristic routing | ✅ | ❌ | ✅ |
|
|
275
171
|
|
|
276
172
|
---
|
|
277
173
|
|
|
278
|
-
##
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
npx a3m-router serve # Start server (port 8787)
|
|
282
|
-
npx a3m-router route "query" # See routing decision
|
|
283
|
-
npx a3m-router health # Provider status
|
|
284
|
-
npx a3m-router benchmark # Local accuracy test
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
---
|
|
174
|
+
## How Routing Works
|
|
288
175
|
|
|
289
|
-
|
|
176
|
+
For every request, A3M scores complexity across five signals:
|
|
290
177
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
178
|
+
| Signal | What it detects |
|
|
179
|
+
|--------|----------------|
|
|
180
|
+
| **Domain** | Legal, medical, code, finance, ML keywords |
|
|
181
|
+
| **Task type** | Code generation, translation, analysis, creative |
|
|
182
|
+
| **Query structure** | Clause count, length, qualifier words |
|
|
183
|
+
| **Verb intensity** | "design/architect" → complex, "what/who" → simple |
|
|
184
|
+
| **Multi-step** | Explicit step markers (first...then, step 1/2/3) |
|
|
297
185
|
|
|
298
|
-
|
|
299
|
-
- **Semantic Cache** — Instant hits for repeated queries (zero cost)
|
|
300
|
-
- **Router** — Scores query, selects tier, picks cheapest healthy provider
|
|
301
|
-
- **Ensemble** — Optional parallel calls for best-answer mode
|
|
186
|
+
The combined score maps to a tier (free → cheap → mid → premium). Within that tier, A3M picks the cheapest available provider.
|
|
302
187
|
|
|
303
188
|
---
|
|
304
189
|
|
|
305
|
-
##
|
|
190
|
+
## Biology-Inspired Provider Selection
|
|
306
191
|
|
|
307
|
-
|
|
308
|
-
# npm
|
|
309
|
-
npm install adaptive-memory-multi-model-router
|
|
310
|
-
|
|
311
|
-
# Python
|
|
312
|
-
pip install adaptive-memory-multi-model-router
|
|
192
|
+
A3M applies ecological theory to routing:
|
|
313
193
|
|
|
314
|
-
|
|
315
|
-
docker run -p 8787:8787 ghcr.io/das-rebel/a3m-router
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
---
|
|
194
|
+
**EXP3 Diversity** — Prevents any single provider from dominating traffic.
|
|
319
195
|
|
|
320
|
-
|
|
196
|
+
**Charnov MVT** — Optimizes rate-limit rotation using Marginal Value Theorem.
|
|
321
197
|
|
|
322
|
-
**
|
|
323
|
-
- **Accuracy:** 96.77%
|
|
324
|
-
- **Cost:** $0.0768/1K tokens
|
|
325
|
-
- **Robustness:** 1.0000
|
|
326
|
-
- **Queries tested:** 8,400
|
|
198
|
+
**ODT Shadow Verification** — For high-stakes queries, probabilistically verifies with a shadow provider.
|
|
327
199
|
|
|
328
200
|
---
|
|
329
201
|
|
|
330
|
-
##
|
|
202
|
+
## Documentation
|
|
331
203
|
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
-
|
|
335
|
-
-
|
|
204
|
+
- [API Reference](https://das-rebel.github.io/a3m-router/api)
|
|
205
|
+
- [Integrations](https://github.com/Das-rebel/a3m-router/tree/main/integrations)
|
|
206
|
+
- [browser-use](https://github.com/Das-rebel/a3m-router/tree/main/integrations/browser-use)
|
|
207
|
+
- [MCP Server](https://github.com/Das-rebel/a3m-router/tree/main/integrations/mcp-browser)
|
|
208
|
+
- [sota-browser](https://github.com/Das-rebel/a3m-router/tree/main/integrations/sota-browser)
|
|
209
|
+
- [Examples](https://github.com/Das-rebel/a3m-router/tree/main/examples)
|
|
336
210
|
|
|
337
211
|
---
|
|
338
212
|
|
|
339
|
-
##
|
|
213
|
+
## License
|
|
340
214
|
|
|
341
|
-
|
|
342
|
-
- 🐛 [Issues](https://github.com/Das-rebel/a3m-router/issues)
|
|
343
|
-
- 💬 [Discussions](https://github.com/Das-rebel/a3m-router/discussions)
|
|
215
|
+
MIT
|
package/README_ja.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# A3M Router 🔀 —
|
|
1
|
+
# A3M Router 🔀 — 成本最优的LLMRouter & 并行执行
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**💰 $0.0768/1Kリクエスト · 80+プロバイダー · メモリ付きルーティング**
|
|
4
4
|
|
|
5
5
|
[English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md)
|
|
6
6
|
|
|
@@ -8,15 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
| メトリクス | A3M Router | Sqwish | Azure (Microsoft) | GPT-5 (OpenAI) | RouteLLM (Berkeley) |
|
|
10
10
|
|------------|:----------:|:------:|:------------------:|:---------------:|:-------------------:|
|
|
11
|
-
| **ランキング** | **🏆 #1** | #2 | #3 | #4 | #5 |
|
|
12
|
-
| **スコア** | **96.77%** | 75.27 | 71.87 | 64.32 | 48.07 |
|
|
13
11
|
| **コスト** | **$0.0768** | $0.18 | $0.22 | $10.02 | $0.27 |
|
|
14
12
|
|
|
15
|
-
>
|
|
13
|
+
> メモリ機能付きLLMRouter、独立評価で検証済み
|
|
16
14
|
|
|
17
15
|
## 独自機能:並列マルチLLM実行
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
従来のRouterは1つずつモデルを試します(シーケンシャルフォールバック)。A3Mは**複数プロバイダーを並列実行**し、信頼度スコアリングで最良の結果選択します。
|
|
20
18
|
|
|
21
19
|
```
|
|
22
20
|
従来: モデルA ❌ → モデルB ❌ → モデルC ✅ (3倍レイテンシ)
|
|
@@ -28,7 +26,7 @@ A3M: モデルA ║ モデルB ║ モデルC → スコアリングで最良
|
|
|
28
26
|
| プロバイダー | モデル | 強み |
|
|
29
27
|
|------------|--------|------|
|
|
30
28
|
| **DeepSeek** | V3, Coder, Reasoner | コード+推論、オープンウェイト |
|
|
31
|
-
| **Kimi (Moonshot)** | Kimi-1.5 | 128K
|
|
29
|
+
| **Kimi (Moonshot)** | Kimi-1.5 | 128Kコンテキスト,中国語最強 |
|
|
32
30
|
| **Zhipu AI (GLM)** | GLM-4, GLM-4V | 中国語+バイリンガル |
|
|
33
31
|
| **Qwen (Alibaba)** | Qwen2, Qwen2.5-Coder | 汎用+コード |
|
|
34
32
|
| **Yi (01.AI)** | Yi-1.5, 34B | バイリンガル+長コンテキスト |
|
|
@@ -36,14 +34,13 @@ A3M: モデルA ║ モデルB ║ モデルC → スコアリングで最良
|
|
|
36
34
|
|
|
37
35
|
## コア機能
|
|
38
36
|
|
|
39
|
-
- 🏆 **RouterArena #1** — 19ルーター中1位
|
|
40
37
|
- 🔀 **並列マルチLLM実行** — 複数プロバイダー同時実行、信頼度投票
|
|
41
|
-
- 💰 **最安値** — $0.0768/1K
|
|
38
|
+
- 💰 **最安値** — $0.0768/1Kリクエスト
|
|
42
39
|
- 🧠 **メモリ付きルーティング** — エピソードック記憶でセッション越えコンテキスト保存
|
|
43
|
-
- 🔄 **セマンティックキャッシュ** — 30
|
|
44
|
-
- 🛡️ **予算強制** —
|
|
40
|
+
- 🔄 **セマンティックキャッシュ** — 30%+ヒット率コスト節約
|
|
41
|
+
- 🛡️ **予算強制** — クエリごとコスト追跡,超過防止
|
|
45
42
|
- ⚡ **高速起動** — <100ms、19.5KB、ML依存なし
|
|
46
|
-
- 🌐 **
|
|
43
|
+
- 🌐 **80+プロバイダー** — OpenAI, Anthropic, DeepSeek, Groq, NVIDIA等
|
|
47
44
|
|
|
48
45
|
## クイックスタート
|
|
49
46
|
|
|
@@ -77,20 +74,19 @@ await router.route('私の名前は?'); // 応答:太郎です!
|
|
|
77
74
|
|
|
78
75
|
## ベンチマーク結果
|
|
79
76
|
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
| **A3M Router** |
|
|
83
|
-
| Sqwish |
|
|
84
|
-
| Azure-Model-Router |
|
|
85
|
-
| GPT-5 |
|
|
86
|
-
| RouteLLM |
|
|
77
|
+
| Router | コスト/1K | オープンソース |
|
|
78
|
+
|----------|:--------:|:------------:|
|
|
79
|
+
| **A3M Router** | **$0.0768** | ✅ |
|
|
80
|
+
| Sqwish | $0.18 | ❌ |
|
|
81
|
+
| Azure-Model-Router | $0.22 | ❌ |
|
|
82
|
+
| GPT-5 | $10.02 | ❌ |
|
|
83
|
+
| RouteLLM | $0.27 | ✅ |
|
|
87
84
|
|
|
88
|
-
詳細 [BENCHMARK.md](./docs/BENCHMARK.md)
|
|
85
|
+
詳細 [BENCHMARK.md](./docs/BENCHMARK.md)
|
|
89
86
|
|
|
90
87
|
## リンク
|
|
91
88
|
|
|
92
89
|
- 📖 [ドキュメント](https://das-rebel.github.io/a3m-router/)
|
|
93
|
-
- 🏆 [ベンチマーク](https://das-rebel.github.io/a3m-router/benchmark)
|
|
94
90
|
- 🚀 [クイックスタート](https://das-rebel.github.io/a3m-router/quick-start)
|
|
95
91
|
- 🤖 [APIリファレンス](https://das-rebel.github.io/a3m-router/api)
|
|
96
92
|
- 💬 [ディスカッション](https://github.com/Das-rebel/a3m-router/discussions)
|
package/README_zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# A3M Router 🔀 — LLM
|
|
1
|
+
# A3M Router 🔀 — 最便宜的LLM路由 & 并行执行
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**💰 $0.0768/1K请求 · 80+提供商 · 带记忆路由**
|
|
4
4
|
|
|
5
5
|
[English](./README.md) | [日本語](./README_ja.md) | [中文](./README_zh.md)
|
|
6
6
|
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
| 指标 | A3M Router | Sqwish | Azure (微软) | GPT-5 (OpenAI) | RouteLLM (伯克利) |
|
|
10
10
|
|------|:-----------:|:------:|:------------:|:--------------:|:-----------------:|
|
|
11
|
-
| **排名** | **🏆 #1** | #2 | #3 | #4 | #5 |
|
|
12
|
-
| **评分** | **96.77%** | 75.27 | 71.87 | 64.32 | 48.07 |
|
|
13
11
|
| **成本** | **$0.0768** | $0.18 | $0.22 | $10.02 | $0.27 |
|
|
14
12
|
|
|
15
|
-
>
|
|
13
|
+
> 带记忆功能的LLM路由器,独立评估验证
|
|
16
14
|
|
|
17
15
|
## 独特优势:并行多LLM执行
|
|
18
16
|
|
|
@@ -36,9 +34,8 @@ A3M路由: 模型A ║ 模型B ║ 模型C → 评分选最佳 ✅ (1次延迟
|
|
|
36
34
|
|
|
37
35
|
## 核心功能
|
|
38
36
|
|
|
39
|
-
- 🏆 **RouterArena #1** — 19个路由器中排名第一
|
|
40
37
|
- 🔀 **并行多LLM执行** — 同时运行多个提供商,置信度投票选最佳
|
|
41
|
-
- 💰 **最便宜** — $0.0768/1K
|
|
38
|
+
- 💰 **最便宜** — $0.0768/1K请求
|
|
42
39
|
- 🧠 **带记忆的路由** — 情景记忆跨会话保存,越用越懂你
|
|
43
40
|
- 🔄 **语义缓存** — 30%+命中率,节省成本
|
|
44
41
|
- 🛡️ **预算强制** — 每查询成本追踪,防止超支
|
|
@@ -71,26 +68,25 @@ const router = createRouter({
|
|
|
71
68
|
|
|
72
69
|
// 第一次对话
|
|
73
70
|
await router.route('我叫小明'); // 记住:用户叫小明
|
|
74
|
-
// 第二次对话
|
|
71
|
+
// 第二次对话
|
|
75
72
|
await router.route('我叫什么?'); // 回复:你叫小明!
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
## 基准测试结果
|
|
79
76
|
|
|
80
|
-
| 路由器 |
|
|
81
|
-
|
|
82
|
-
| **A3M Router** |
|
|
83
|
-
| Sqwish |
|
|
84
|
-
| Azure-Model-Router |
|
|
85
|
-
| GPT-5 |
|
|
86
|
-
| RouteLLM |
|
|
77
|
+
| 路由器 | 成本/1K | 开源 |
|
|
78
|
+
|--------|:-------:|:----:|
|
|
79
|
+
| **A3M Router** | **$0.0768** | ✅ |
|
|
80
|
+
| Sqwish | $0.18 | ❌ |
|
|
81
|
+
| Azure-Model-Router | $0.22 | ❌ |
|
|
82
|
+
| GPT-5 | $10.02 | ❌ |
|
|
83
|
+
| RouteLLM | $0.27 | ✅ |
|
|
87
84
|
|
|
88
|
-
详见 [BENCHMARK.md](./docs/BENCHMARK.md)
|
|
85
|
+
详见 [BENCHMARK.md](./docs/BENCHMARK.md)
|
|
89
86
|
|
|
90
87
|
## 链接
|
|
91
88
|
|
|
92
89
|
- 📖 [文档](https://das-rebel.github.io/a3m-router/)
|
|
93
|
-
- 🏆 [基准测试](https://das-rebel.github.io/a3m-router/benchmark)
|
|
94
90
|
- 🚀 [快速开始](https://das-rebel.github.io/a3m-router/quick-start)
|
|
95
91
|
- 🤖 [API参考](https://das-rebel.github.io/a3m-router/api)
|
|
96
92
|
- 💬 [讨论区](https://github.com/Das-rebel/a3m-router/discussions)
|