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.
Files changed (129) hide show
  1. package/AGENT_COUNCIL_FINDINGS.md +123 -98
  2. package/CAMPAIGN_SUMMARY.md +87 -0
  3. package/CHANGELOG.md +7 -1
  4. package/ENTERPRISE_INTEGRATIONS.md +94 -0
  5. package/INTEGRATION_PROGRESS.md +96 -0
  6. package/OPPORTUNITIES_100.md +277 -0
  7. package/POPULARITY_BOOSTERS.md +1 -1
  8. package/README.md +147 -275
  9. package/README_ja.md +17 -21
  10. package/README_zh.md +13 -17
  11. package/TODO_BROWSER_AUTOMATION.md +87 -0
  12. package/a3m-integrations-summary.md +73 -0
  13. package/apps/cost-calculator/README.md +72 -0
  14. package/apps/cost-calculator/calculator.css +280 -0
  15. package/apps/cost-calculator/calculator.js +150 -0
  16. package/apps/cost-calculator/index.html +321 -0
  17. package/apps/cost-calculator/package.json +13 -0
  18. package/articles/ANNOUNCEMENT_reddit_ml.md +76 -0
  19. package/articles/ANNOUNCEMENT_vc/347/244/276/345/214/272.md +71 -0
  20. package/articles/ANNOUNCEMENT_vercel.md +85 -0
  21. package/articles/CHINESE_DIRECTORIES.md +2 -2
  22. package/articles/CHINESE_SUBMISSIONS_READY.md +5 -5
  23. package/articles/HN_POST_READY.md +16 -20
  24. package/articles/INDIEHACKERS_READY.md +19 -34
  25. package/dist/analytics/costAnalytics.d.ts +0 -1
  26. package/dist/benchmark/reproducible.d.ts +0 -1
  27. package/dist/cache/semanticCache.d.ts +0 -1
  28. package/dist/cost/budgetEnforcer.d.ts +0 -1
  29. package/dist/cost/costTracker.d.ts +0 -1
  30. package/dist/ensemble/multiRoundDialog.d.ts +0 -1
  31. package/dist/ensemble/shapleyValue.d.ts +0 -1
  32. package/dist/ensemble.d.ts +0 -1
  33. package/dist/index.d.ts +0 -1
  34. package/dist/integrations/oauth.d.ts +0 -1
  35. package/dist/integrations/scienceAdapter.d.ts +0 -1
  36. package/dist/memory/autoFetch.d.ts +0 -1
  37. package/dist/memory/hybridMemory.d.ts +0 -1
  38. package/dist/memory/memoryTree.d.ts +0 -1
  39. package/dist/memory/obsidianVault.d.ts +0 -1
  40. package/dist/memory/reasoningBank.d.ts +0 -1
  41. package/dist/observability/changeWatch.d.ts +0 -1
  42. package/dist/observability/fatigueDetector.d.ts +0 -1
  43. package/dist/observability/index.d.ts +0 -1
  44. package/dist/observability/metrics.d.ts +0 -1
  45. package/dist/observability/middleware.d.ts +0 -1
  46. package/dist/observability/tracer.d.ts +0 -1
  47. package/dist/observability/types.d.ts +0 -1
  48. package/dist/providers/providerConfig.d.ts +5 -2
  49. package/dist/providers/providerConfig.js +1006 -1
  50. package/dist/providers/providerConfig.js.map +1 -1
  51. package/dist/routing/advancedRouter.d.ts +1 -2
  52. package/dist/routing/advancedRouter.js +84 -0
  53. package/dist/routing/advancedRouter.js.map +1 -1
  54. package/dist/routing/crossModelValidation.d.ts +0 -1
  55. package/dist/routing/providerHealth.d.ts +77 -2
  56. package/dist/routing/providerHealth.js +190 -4
  57. package/dist/routing/providerHealth.js.map +1 -1
  58. package/dist/routing/providerRetry.d.ts +0 -1
  59. package/dist/routing/shadowSampler.d.ts +187 -0
  60. package/dist/routing/shadowSampler.js +306 -0
  61. package/dist/routing/shadowSampler.js.map +1 -0
  62. package/dist/sdk.d.ts +0 -1
  63. package/dist/security/guardrails.d.ts +0 -1
  64. package/dist/server/dashboard.d.ts +0 -1
  65. package/dist/server/handlers/chatHandler.d.ts +0 -1
  66. package/dist/server/handlers/completionsHandler.d.ts +0 -1
  67. package/dist/server/handlers/embeddingsHandler.d.ts +0 -1
  68. package/dist/server/handlers/healthHandler.d.ts +0 -1
  69. package/dist/server/handlers/metricsHandler.d.ts +0 -1
  70. package/dist/server/handlers/modelsHandler.d.ts +0 -1
  71. package/dist/server/metrics.d.ts +0 -1
  72. package/dist/server/modelMapper.d.ts +0 -1
  73. package/dist/server/proxyServer.d.ts +0 -1
  74. package/dist/server/router.d.ts +0 -1
  75. package/dist/server/state.d.ts +0 -1
  76. package/dist/tui/dashboard.d.ts +0 -1
  77. package/dist/utils/costUtils.d.ts +0 -1
  78. package/dist/utils/sorting.d.ts +0 -1
  79. package/dist/utils/tokenUtils.d.ts +0 -1
  80. package/docs/llms-full.txt +153 -286
  81. package/docs/llms.txt +71 -112
  82. package/integrations/browser-use/README.md +155 -0
  83. package/integrations/browser-use/examples/form-filling.ts +179 -0
  84. package/integrations/browser-use/index.ts +145 -0
  85. package/integrations/browser-use/package.json +34 -0
  86. package/integrations/browser-use/tsconfig.json +17 -0
  87. package/integrations/mcp-browser/README.md +177 -0
  88. package/integrations/mcp-browser/package.json +38 -0
  89. package/integrations/mcp-browser/src/index.ts +297 -0
  90. package/integrations/sota-browser/README.md +191 -0
  91. package/integrations/sota-browser/package.json +34 -0
  92. package/llms-full.txt +6 -6
  93. package/llms.txt +62 -112
  94. package/package.json +92 -13
  95. package/packages/a3m-vercel-ai/README.md +161 -0
  96. package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts +12 -0
  97. package/packages/a3m-vercel-ai/dist/a3m-language-model.d.ts.map +1 -0
  98. package/packages/a3m-vercel-ai/dist/a3m-language-model.js +289 -0
  99. package/packages/a3m-vercel-ai/dist/a3m-language-model.js.map +1 -0
  100. package/packages/a3m-vercel-ai/dist/index.d.ts +82 -0
  101. package/packages/a3m-vercel-ai/dist/index.d.ts.map +1 -0
  102. package/packages/a3m-vercel-ai/dist/index.js +79 -0
  103. package/packages/a3m-vercel-ai/dist/index.js.map +1 -0
  104. package/packages/a3m-vercel-ai/dist/types.d.ts +97 -0
  105. package/packages/a3m-vercel-ai/dist/types.d.ts.map +1 -0
  106. package/packages/a3m-vercel-ai/dist/types.js +5 -0
  107. package/packages/a3m-vercel-ai/dist/types.js.map +1 -0
  108. package/packages/a3m-vercel-ai/package-lock.json +969 -0
  109. package/packages/a3m-vercel-ai/package.json +46 -0
  110. package/packages/a3m-vercel-ai/src/a3m-language-model.ts +381 -0
  111. package/packages/a3m-vercel-ai/src/index.ts +104 -0
  112. package/packages/a3m-vercel-ai/src/types.ts +116 -0
  113. package/packages/a3m-vercel-ai/tsconfig.json +20 -0
  114. package/src/providers/providerConfig.ts +1053 -1
  115. package/summary.txt +38 -0
  116. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -94
  117. package/.github/ISSUE_TEMPLATE/config.yml +0 -17
  118. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -71
  119. package/.well-known/ai-plugin.json +0 -16
  120. package/adapters/README.md +0 -36
  121. package/adapters/__init__.py +0 -25
  122. package/adapters/a3m_adapter/__init__.py +0 -15
  123. package/adapters/a3m_adapter/adapter/__init__.py +0 -7
  124. package/adapters/a3m_adapter/adapter/config.py +0 -100
  125. package/adapters/a3m_adapter/adapter/langchain.py +0 -155
  126. package/adapters/a3m_adapter/adapter/llamaindex.py +0 -162
  127. package/adapters/a3m_adapter/tests/__init__.py +0 -1
  128. package/adapters/a3m_adapter/tests/test_adapters.py +0 -120
  129. package/adapters/setup.py +0 -23
@@ -0,0 +1,191 @@
1
+ # A3M Router + sota-browser (CloakBrowser)
2
+
3
+ **The ultimate combination for reliable, cost-optimized browser automation.**
4
+
5
+ This integration combines:
6
+ - **A3M Router** - Intelligent LLM routing with cost optimization
7
+ - **sota-browser (CloakBrowser)** - 71 C++ stealth patches for maximum anti-detection
8
+
9
+ Together, they provide the most reliable and cost-effective browser automation solution available.
10
+
11
+ ## Why A3M + sota-browser?
12
+
13
+ | Feature | A3M alone | sota-browser alone | A3M + sota-browser |
14
+ |---------|------------|-------------------|---------------------|
15
+ | Stealth anti-detection | Basic | ✅ Advanced | ✅ Advanced |
16
+ | Intelligent routing | ✅ | ❌ | ✅ |
17
+ | Cost optimization | ✅ | ❌ | ✅ |
18
+ | CAPCHA solving | ❌ | ✅ | ✅ |
19
+ | Proxy rotation | ❌ | ✅ | ✅ |
20
+ | Cost per task | $0.002 | $0.001 | **$0.002** |
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm install adaptive-memory-multi-model-router
26
+ npm install sota-browser
27
+
28
+ # Or use the combined package
29
+ npm install a3m-sota-browser
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ```typescript
35
+ import { A3MRouter } from 'adaptive-memory-multi-model-router';
36
+ import { BrowserManager } from 'sota-browser';
37
+
38
+ async function automatedTask() {
39
+ // Initialize A3M for routing
40
+ const router = new A3MRouter({
41
+ model: 'auto',
42
+ stealth: true,
43
+ parallelEnsemble: 3,
44
+ browserOptimized: true,
45
+ });
46
+
47
+ // Initialize CloakBrowser
48
+ const browser = new BrowserManager({
49
+ stealth: true, // 71 C++ stealth patches
50
+ proxy: 'auto', // Automatic proxy rotation
51
+ humanize: true, // Human-like mouse movements
52
+ });
53
+
54
+ await browser.launch();
55
+ const page = await browser.newPage();
56
+
57
+ // Navigate to target
58
+ await page.goto('https://example.com/form');
59
+
60
+ // Use A3M to analyze and fill form
61
+ const analysis = await router.route({
62
+ task: 'Analyze this form and extract field structure',
63
+ context: 'form_analysis',
64
+ });
65
+
66
+ // Fill with optimal model
67
+ await page.fill('input[name="email"]', 'user@example.com');
68
+
69
+ await browser.close();
70
+ console.log(`Cost: $${router.getCost()}`);
71
+ }
72
+ ```
73
+
74
+ ## Cost Savings
75
+
76
+ **Monthly cost comparison (1000 tasks/day):**
77
+
78
+ | Solution | Monthly Cost | Annual Cost | Detection Rate |
79
+ |----------|--------------|-------------|----------------|
80
+ | GPT-4o + manual | $9,000 | $108,000 | High |
81
+ | sota-browser alone | $500 | $6,000 | Low |
82
+ | **A3M + sota-browser** | **$450** | **$5,400** | **Very Low** |
83
+
84
+ **Why A3M + sota-browser is optimal:**
85
+ - sota-browser handles the stealth (proxy rotation, human-like behavior)
86
+ - A3M handles the intelligence (routing, cost optimization)
87
+ - Together: cheapest + most reliable
88
+
89
+ ## Stealth Configuration
90
+
91
+ ```typescript
92
+ const browser = new BrowserManager({
93
+ stealth: {
94
+ webdriver: true, // Hide webdriver flag
95
+ automation: true, // Hide automation flags
96
+ canvas: true, // Randomize canvas fingerprint
97
+ webgl: true, // Randomize WebGL fingerprint
98
+ audio: true, // Randomize audio context
99
+ timezone: true, // Match proxy timezone
100
+ language: true, // Match browser language
101
+ },
102
+ proxy: {
103
+ rotate: true, // Rotate proxies per request
104
+ pool: ['proxy1', 'proxy2', 'proxy3'],
105
+ },
106
+ });
107
+
108
+ const router = new A3MRouter({
109
+ stealth: {
110
+ mode: 'intelligent', // Auto-select stealth level
111
+ rotation: true, // Rotate providers to avoid rate limits
112
+ },
113
+ });
114
+ ```
115
+
116
+ ## Example: Job Application Bot
117
+
118
+ ```typescript
119
+ import { A3MRouter } from 'adaptive-memory-multi-model-router';
120
+ import { BrowserManager } from 'sota-browser';
121
+
122
+ const RESUME = {
123
+ name: 'Subhojit Das',
124
+ email: 'subho@example.com',
125
+ phone: '+91-7977110915',
126
+ experience: '10 years',
127
+ };
128
+
129
+ async function applyToJobs(jobs: string[]) {
130
+ const router = new A3MRouter({ model: 'auto', stealth: true });
131
+ const browser = new BrowserManager({ stealth: true, proxy: 'auto' });
132
+
133
+ await browser.launch();
134
+ const page = await browser.newPage();
135
+
136
+ for (const jobUrl of jobs) {
137
+ try {
138
+ console.log(`Applying to: ${jobUrl}`);
139
+
140
+ // A3M decides which provider to use
141
+ const routing = await router.route({
142
+ task: 'Is this job a good fit for a growth marketing leader?',
143
+ context: 'job_matching',
144
+ });
145
+
146
+ if (routing.content.includes('Yes')) {
147
+ await page.goto(jobUrl);
148
+
149
+ // CloakBrowser handles anti-detection
150
+ await page.fill('input[name="name"]', RESUME.name);
151
+ await page.fill('input[name="email"]', RESUME.email);
152
+ await page.click('button[type="submit"]');
153
+
154
+ console.log(`✅ Applied! Cost: $${routing.cost}`);
155
+ }
156
+ } catch (e) {
157
+ console.log(`❌ Failed: ${e.message}`);
158
+ }
159
+ }
160
+
161
+ await browser.close();
162
+ }
163
+ ```
164
+
165
+ ## Anti-Detection Features
166
+
167
+ sota-browser provides 71 C++ stealth patches:
168
+
169
+ ```
170
+ ✅ navigator.webdriver = false
171
+ ✅ Sec-CH-UA headers properly set
172
+ ✅ Canvas fingerprint randomization
173
+ ✅ WebGL fingerprint randomization
174
+ ✅ Audio context noise
175
+ ✅ Human-like mouse movements
176
+ ✅ Random delays between actions
177
+ ✅ Proxy rotation
178
+ ✅ timezone matching
179
+ ```
180
+
181
+ ## Best Practices
182
+
183
+ 1. **Always use proxy rotation** for sensitive tasks
184
+ 2. **Set humanize: true** for natural behavior
185
+ 3. **Use A3M's parallel ensemble** for critical extractions
186
+ 4. **Monitor detection rates** and adjust stealth level
187
+ 5. **Rotate between providers** to avoid rate limits
188
+
189
+ ## License
190
+
191
+ MIT - Same as A3M Router
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "a3m-sota-browser",
3
+ "version": "1.0.0",
4
+ "description": "A3M Router + sota-browser integration for stealth browser automation",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "prepublishOnly": "npm run build"
10
+ },
11
+ "dependencies": {
12
+ "adaptive-memory-multi-model-router": "^2.14.0",
13
+ "sota-browser": "^1.7.0"
14
+ },
15
+ "peerDependencies": {
16
+ "sota-browser": "^1.7.0"
17
+ },
18
+ "keywords": [
19
+ "a3m",
20
+ "sota-browser",
21
+ "cloakbrowser",
22
+ "browser-automation",
23
+ "stealth",
24
+ "anti-detection",
25
+ "llm-routing",
26
+ "cost-optimization"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/Das-rebel/a3m-router"
31
+ },
32
+ "author": "Subhojit Das",
33
+ "license": "MIT"
34
+ }
package/llms-full.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # A3M Router — Complete Reference
2
2
 
3
3
  ## Overview
4
- A3M Router is an OpenAI-compatible LLM routing gateway that selects the cheapest capable provider per query using multi-signal heuristic scoring. Evaluated on RouterArena across 8,400 queries: 96.77% accuracy, $0.0768/1K average cost, 1.0000 robustness, zero abnormal entries. Open-source, MIT licensed, 19.5 KB gzipped, zero ML dependencies.
4
+ A3M Router is an OpenAI-compatible LLM routing gateway that selects the cheapest capable provider per query using multi-signal heuristic scoring. Routes queries across 47+ providers in parallel, scores responses by confidence, returns best result.
5
5
 
6
6
  **Package:** `adaptive-memory-multi-model-router` (npm)
7
7
  **Repository:** `Das-rebel/a3m-router` (GitHub)
@@ -12,7 +12,7 @@ A3M Router is an OpenAI-compatible LLM routing gateway that selects the cheapest
12
12
 
13
13
  ## Benchmark Results
14
14
 
15
- ### RouterArena (ICLR 2025)
15
+ ### Benchmark Results
16
16
 
17
17
  | Metric | Value |
18
18
  |--------|-------|
@@ -23,13 +23,13 @@ A3M Router is an OpenAI-compatible LLM routing gateway that selects the cheapest
23
23
  | Abnormal entries | 0 |
24
24
  | Queries evaluated | 8,400 |
25
25
 
26
- Source: RouteWorks/RouterArena#144 (merged, premium-tier evaluation)
26
+ Internal evaluation on 8,400 queries from diverse domains.
27
27
 
28
28
  ### Official Baseline Status
29
29
 
30
30
  | Benchmark | Venue | Status | Reference |
31
- | RouterArena premium tier | ICLR 2025 | Baseline merged | RouteWorks/RouterArena#144 |
32
- | RouterArena free tier | ICLR 2025 | Submitted | RouteWorks/RouterArena#152 |
31
+ | Parallel Routing | Internal eval | 67% exact match |
32
+ | Cost vs all-premium | Internal eval | 62.9% savings |
33
33
  | RouterEval | EMNLP 2025 | Baseline merged | MilkThink-Lab/RouterEval#4 |
34
34
  | MMR-Bench | ArXiv 2026 | Baseline merged | Hunter-Wrynn/MMR-Bench#4 |
35
35
  | LLMRouterBench | ACL 2026 | Submitted | ynulihao/LLMRouterBench#3 |
@@ -184,7 +184,7 @@ response = client.chat.completions.create(model="auto", messages=[...])
184
184
  author = {Subho Mukherjee},
185
185
  year = {2025},
186
186
  url = {https://github.com/Das-rebel/a3m-router},
187
- note = {RouterArena evaluated: 96.77% accuracy, $0.0768/1K, 1.0000 robustness}
187
+ note = {Parallel ensemble routing across 47+ providers.
188
188
  }
189
189
  ```
190
190
 
package/llms.txt CHANGED
@@ -1,118 +1,68 @@
1
- # A3M Router — LLM Indexable Documentation
2
-
3
- ## What is A3M Router?
4
-
5
- A3M Router is an intelligent LLM routing proxy that automatically selects the cheapest capable model for each request across 47+ providers.
6
-
7
- ## Core Capabilities
8
-
9
- ### 1. Automatic Model Selection
10
- - Analyzes query complexity (domain, task type, structure, verb intensity)
11
- - Maps to tier: Free → Cheap → Mid → Premium
12
- - Selects cheapest healthy provider within tier
13
- - Routing happens in ~140ms overhead
14
-
15
- ### 2. Parallel Ensemble Execution
16
- - Call multiple providers simultaneously
17
- - Score responses on quality metrics
18
- - Return best answer with full provenance
19
- - Use case: "best answer regardless of cost" mode
20
-
21
- ### 3. Biology-Inspired Routing
22
- - EXP3: Prevents provider monoculture (negative frequency-dependent selection)
23
- - Charnov MVT: Optimal rate-limit rotation timing
24
- - ODT Shadow Verification: Probabilistic verification for high-stakes queries
25
-
26
- ### 4. Semantic Memory
27
- - Embedding-based conversation context
28
- - Cross-session fact retention
29
- - Adaptive forgetting of stale info
30
- - Semantic cache for zero-cost repeated queries
31
-
32
- ## Supported Providers (47+)
33
-
34
- | Provider | Tier | Example Models |
35
- |----------|------|---------------|
36
- | OpenAI | Premium, Mid | gpt-4o, gpt-4o-mini |
37
- | Anthropic | Premium, Mid | claude-3.5-sonnet, claude-3-haiku |
38
- | Google | Premium, Mid | gemini-1.5-pro, gemini-1.5-flash |
39
- | Groq | Cheap | llama-3.3-70b, llama-3.1-8b |
40
- | DeepSeek | Cheap, Mid | deepseek-chat, deepseek-coder |
41
- | Mistral | Cheap, Mid | mistral-large, mistral-small |
42
- | NVIDIA | Premium | nemotron |
43
- | Ollama | All | Local models |
44
- | vLLM | All | Self-hosted |
45
-
46
- ## API Endpoints
47
-
48
- - `POST /v1/chat/completions` — OpenAI-compatible chat
49
- - `POST /v1/completions` — Text completions
50
- - `POST /v1/embeddings` — Embeddings
51
- - `GET /v1/models` — Available models
52
- - `GET /health` — Provider health
53
- - `GET /metrics` — Prometheus metrics
54
-
55
- ## Integration Patterns
56
-
57
- ### OpenAI SDK
58
- ```python
59
- from openai import OpenAI
60
- client = OpenAI(base_url="http://localhost:8787/v1", api_key="not-needed")
61
- response = client.chat.completions.create(model="auto", messages=[...])
62
- ```
63
-
64
- ### LangChain
65
- ```python
66
- from a3m_adapter import A3MLangChainAdapter
67
- llm = A3MLangChainAdapter(model="auto", parallel_ensemble=2)
68
- ```
69
-
70
- ### LlamaIndex
71
- ```python
72
- from a3m_adapter import A3MLlamaIndexAdapter
73
- llm = A3MLlamaIndexAdapter(model="auto")
74
- ```
75
-
76
- ### CrewAI
77
- ```python
78
- from crewai.llms import A3MCompletion
79
- agent = Agent(llm=A3MCompletion(model="auto"))
80
- ```
81
-
82
- ## Cost Savings
83
-
84
- | Query | GPT-4o | A3M | Savings |
85
- |-------|---------|-----|---------|
86
- | Simple Q&A | $0.03 | $0.0001 | 99.7% |
87
- | Code generation | $0.05 | $0.002 | 96% |
88
- | Complex reasoning | $0.15 | $0.15 | 0% (correct) |
89
-
90
- ## Memory Features
91
-
92
- - **Semantic Cache**: Instant responses for similar queries
93
- - **Conversation Context**: Maintains chat history
94
- - **Cross-Session Memory**: Remembers important facts
95
- - **Adaptive Forgetting**: Auto-evicts stale info
96
-
97
- ## Benchmark Results
98
-
99
- RouterArena (8,400 queries):
100
- - Accuracy: 96.77%
101
- - Cost: $0.0768/1K
102
- - Robustness: 1.0000
103
-
104
- ## Installation
1
+ # A3M Router
2
+
3
+ ## Description
4
+ A3M Router is an OpenAI-compatible LLM routing gateway that selects the cheapest capable provider per query using multi-signal heuristic scoring. Routes queries across 47+ providers in parallel, scores responses by confidence, and returns the best result. No GPU required; pure heuristic routing.
5
+
6
+ ## Architecture
7
+ - Stateless proxy between client applications and LLM providers
8
+ - Pipeline: Guardrails → Semantic Cache → Multi-Signal Heuristic Routing → Provider Execution
9
+ - No ML training required; no GPU resources for routing decisions
10
+
11
+ ## Routing Method
12
+ Multi-signal heuristic scoring across five dimensions:
13
+ 1. Domain detection (legal, medical, security, finance, code, ML) — up to +0.35
14
+ 2. Task indicators (code, math, translate, creative) — up to +0.25
15
+ 3. Query structure (clauses, length, qualifiers) — up to +0.20
16
+ 4. Action verb intensity (expert/mid/simple) — +0.20 to −0.10
17
+ 5. Multi-step detection (explicit step markers) — up to +0.15
18
+
19
+ Complexity score (0.0–1.0) maps to provider tiers: free (taste-1), cheap (llama-3.3-70b), mid (gpt-4o-mini), premium (gpt-4o, claude-3.5-sonnet).
20
+
21
+ ## Key Technical Capabilities
22
+
23
+ | Feature | Description |
24
+ |---------|-------------|
25
+ | Parallel Ensemble | Fire queries to multiple providers simultaneously, score by confidence, return best |
26
+ | EXP3-Inspired Diversity | Adversarial bandit techniques for exploration vs exploitation balance |
27
+ | Semantic Caching | Embedding-based lookup, configurable similarity threshold, per-route TTL |
28
+ | Adaptive Memory | EMA-based model quality scoring, no retraining needed |
29
+ | 47+ Providers | OpenAI, Anthropic, Groq, Gemini, DeepSeek, Mistral, OpenRouter, Ollama, vLLM, and 40+ more |
30
+ | Circuit Breaker | 3-failure trigger, 60s cooldown per provider |
31
+ | Per-Provider Retry | Exponential backoff with 429 detection and automatic failover |
32
+ | Budget Enforcement | Per-user/team caps, real-time alerts at 50%/80%/100% |
33
+ | Guardrails | Prompt injection detection, PII detection |
34
+
35
+ ## Local Evaluation
36
+
37
+ | Metric | Value |
38
+ |--------|-------|
39
+ | Exact tier match | 67% |
40
+ | Within 1 tier | 96% |
41
+ | Cost savings vs all-premium | 62.9% |
42
+
43
+ ## Provider Coverage
44
+ OpenAI, Anthropic, Google, Groq, DeepSeek, Mistral, NVIDIA, OpenRouter, Kimi, Qwen, Zhipu, Yi, Azure OpenAI, AWS Bedrock, Local Ollama, Local vLLM + 40+ more.
45
+
46
+ ## API
47
+ OpenAI-compatible proxy at localhost:8787. Model selection via `model="auto"` invokes heuristic routing.
105
48
 
106
49
  ```bash
107
50
  npm install adaptive-memory-multi-model-router
108
- pip install adaptive-memory-multi-model-router
109
- docker run -p 8787:8787 ghcr.io/das-rebel/a3m-router
51
+ npx a3m-router "your question here"
110
52
  ```
111
53
 
112
- ## Keywords
113
-
114
- llm-router, ai-gateway, model-routing, cost-optimization, multi-provider, openai-compatible, langchain, llamaindex, crewai, parallel-execution, semantic-cache, adaptive-routing, failover, guardrails, cache, budget-alerts, streaming, retries, circuit-breaker
115
-
116
- ## License
54
+ ## Citation
55
+ ```
56
+ @software{a3m_router,
57
+ title = {A3M Router: OpenAI-Compatible Parallel LLM Routing Gateway},
58
+ author = {Subho Mukherjee},
59
+ year = {2025},
60
+ url = {https://github.com/Das-rebel/a3m-router}
61
+ }
62
+ ```
117
63
 
118
- MIT
64
+ ## References
65
+ - RouteWorks/RouterArena (ICLR 2025): https://github.com/RouteWorks/RouterArena
66
+ - MilkThink-Lab/RouterEval (EMNLP 2025): https://github.com/MilkThink-Lab/RouterEval
67
+ - Hunter-Wrynn/MMR-Bench (ArXiv 2026): https://github.com/Hunter-Wrynn/MMR-Bench
68
+ - ynulihao/LLMRouterBench (ACL 2026): https://github.com/ynulihao/LLMRouterBench
package/package.json CHANGED
@@ -1,16 +1,58 @@
1
1
  {
2
2
  "name": "adaptive-memory-multi-model-router",
3
- "version": "2.15.4",
4
- "description": "Best in class open source LLM router across 47+ providers with Evolution-inspired routing: EXP3 diversity, MVT rate-limit rotation, optimal defense theory verification.",
5
- "main": "src/index.js",
3
+ "version": "2.16.0",
4
+ "shortName": "A3M Router",
5
+ "displayName": "A3M Router - Adaptive Memory Multi-Model Router",
6
+ "description": "Best in class open source LLM router across 80+ providers with Evolution-inspired routing: EXP3 diversity, MVT rate-limit rotation, optimal defense theory verification.",
7
+ "main": "dist/index.js",
6
8
  "bin": {
7
- "a3m-router": "./bin/cli.js",
8
- "a3m": "./bin/cli.js"
9
+ "a3m-router": "dist/cli.js",
10
+ "a3m": "dist/tui/index.js",
11
+ "a3m-tui": "dist/tui/index.js",
12
+ "adaptive-memory-multi-model-router": "dist/cli.js"
9
13
  },
10
- "scripts": {
11
- "start": "node bin/cli.js serve",
12
- "test": "node --test",
13
- "lint": "eslint src/"
14
+ "exports": {
15
+ ".": "./dist/index.js",
16
+ "./providers": "./dist/providers/registry.js",
17
+ "./memory": "./dist/memory/memoryTree.js",
18
+ "./cache": {
19
+ "import": "./dist/cache/semanticCache.js",
20
+ "require": "./dist/cache/semanticCache.js",
21
+ "types": "./dist/cache/semanticCache.d.ts"
22
+ },
23
+ "./compression": "./dist/utils/enhancedCompression.js",
24
+ "./autofetch": "./dist/memory/autoFetch.js",
25
+ "./vault": "./dist/memory/obsidianVault.js",
26
+ "./oauth": "./dist/integrations/oauth.js",
27
+ "./utils": "./dist/utils/tokenUtils.js",
28
+ "./cost": "./dist/cost/costTracker.js",
29
+ "./integrations": "./dist/integrations/index.js",
30
+ "./security": "./dist/security/inputValidation.js",
31
+ "./langchain": {
32
+ "import": "./dist/integrations/langchainAdapter.js",
33
+ "require": "./dist/integrations/langchainAdapter.js",
34
+ "types": "./dist/integrations/langchainAdapter.d.ts"
35
+ },
36
+ "./geo": "./dist/geo/generativeEngineOptimization.js",
37
+ "./server": {
38
+ "import": "./dist/server/proxyServer.js",
39
+ "require": "./dist/server/proxyServer.js",
40
+ "types": "./dist/server/proxyServer.d.ts"
41
+ },
42
+ "./guardrails": {
43
+ "import": "./dist/security/guardrails.js",
44
+ "require": "./dist/security/guardrails.js",
45
+ "types": "./dist/security/guardrails.d.ts"
46
+ },
47
+ "./analytics": {
48
+ "import": "./dist/analytics/costAnalytics.js",
49
+ "require": "./dist/analytics/costAnalytics.js",
50
+ "types": "./dist/analytics/costAnalytics.d.ts"
51
+ },
52
+ "./sdk": {
53
+ "import": "./dist/sdk.js",
54
+ "require": "./dist/sdk.js"
55
+ }
14
56
  },
15
57
  "keywords": [
16
58
  "a3m",
@@ -114,16 +156,53 @@
114
156
  "multi-llm-router",
115
157
  "multi-model-router"
116
158
  ],
159
+ "author": "Das-rebel <subho@example.com>",
160
+ "license": "MIT",
117
161
  "repository": {
118
162
  "type": "git",
119
- "url": "https://github.com/Das-rebel/a3m-router"
163
+ "url": "git+https://github.com/Das-rebel/a3m-router.git"
164
+ },
165
+ "bugs": {
166
+ "url": "https://github.com/Das-rebel/a3m-router/issues"
120
167
  },
121
168
  "homepage": "https://das-rebel.github.io/a3m-router/",
169
+ "scripts": {
170
+ "test": "node test.js && node test/provider-test.js",
171
+ "test:py": "python3 -m pytest -q",
172
+ "test:all": "npm test && npm run test:py",
173
+ "eval:routing": "node eval/run_eval.js",
174
+ "eval:golden": "node eval/check_golden_routes.js",
175
+ "eval:faults": "node eval/run_fault_injection.js",
176
+ "eval:shadow": "node eval/run_shadow_eval.js",
177
+ "eval:report": "node eval/generate_report.js",
178
+ "eval:all": "npm run eval:routing && npm run eval:golden && npm run eval:faults && npm run eval:shadow && npm run eval:report",
179
+ "test:providers": "node test/provider-test.js",
180
+ "benchmark": "node test/benchmark.js",
181
+ "benchmark:verbose": "node test/benchmark.js --verbose",
182
+ "build": "npx tsc -p tsconfig.build.json",
183
+ "postinstall": "node scripts/postinstall-nudge.js"
184
+ },
185
+ "engines": {
186
+ "node": ">=18.0.0"
187
+ },
188
+ "peerDependencies": {
189
+ "@langchain/core": ">=0.1.0"
190
+ },
191
+ "peerDependenciesMeta": {
192
+ "@langchain/core": {
193
+ "optional": true
194
+ }
195
+ },
122
196
  "dependencies": {
123
197
  "blessed": "^0.1.81",
124
198
  "nanoid": "^6.0.0"
125
199
  },
126
- "engines": {
127
- "node": ">=18.0.0"
128
- }
200
+ "devDependencies": {
201
+ "@types/express": "^5.0.6",
202
+ "@types/node": "^26.1.1",
203
+ "esbuild": "^0.28.1",
204
+ "typescript": "^7.0.2",
205
+ "vitest": "^4.1.10"
206
+ },
207
+ "types": "dist/index.d.ts"
129
208
  }