adaptive-memory-multi-model-router 2.14.17 β 2.14.18
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 +142 -0
- package/LAUNCH_CHECKLIST.md +141 -0
- package/README.md.bak +836 -0
- package/articles/CHINESE_SUBMISSIONS_READY.md +322 -0
- package/articles/DEVTO_READY.md +255 -0
- package/articles/HN_POST_READY.md +137 -0
- package/articles/INDIEHACKERS_READY.md +120 -0
- package/articles/NEWSLETTER_SEND_NOW.md +259 -0
- package/articles/PRODUCTHUNT_READY.md +106 -0
- package/articles/REDDIT_SUBMISSION_READY.md +348 -0
- package/articles/TWEET_STORM_READY.md +165 -0
- package/council-votes/architecture-vote.md +121 -0
- package/council-votes/coverage-vote.md +93 -0
- package/dist/cost/costTracker.d.ts +109 -44
- package/dist/cost/costTracker.js +321 -98
- package/dist/cost/costTracker.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/routing/advancedRouter.d.ts +38 -43
- package/dist/routing/advancedRouter.js +394 -408
- package/dist/routing/advancedRouter.js.map +1 -1
- package/dist/routing/providers/providerConfig.d.ts +49 -0
- package/dist/routing/providers/providerConfig.js +883 -0
- package/dist/routing/routing/advancedRouter.d.ts +62 -0
- package/dist/routing/routing/advancedRouter.js +447 -0
- package/dist/routing/utils/tokenUtils.d.ts +52 -0
- package/dist/routing/utils/tokenUtils.js +129 -0
- package/dist/server/proxyServer.d.ts +1 -1
- package/package.json +1 -1
- package/research-log.md +49 -0
- package/src/cost/costTracker.ts +576 -0
- package/src/routing/advancedRouter.ts +536 -0
- package/test-council/AGENT_COUNCIL_ARCHITECTURE.md +349 -0
- package/tests/security/guardrailEngine.test.ts +700 -0
- package/research/PUBLISH_LOG.md +0 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Agent Council Findings - A3M Router
|
|
2
|
+
**Date:** 2026-06-03
|
|
3
|
+
**Council:** Architecture Agent, Performance Agent, Test Coverage Agent
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## π¨ CRITICAL: Build is BROKEN
|
|
8
|
+
|
|
9
|
+
The TypeScript compilation fails with missing modules:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
src/index.ts(63,29): error TS2307: Cannot find module './cost/costTracker'
|
|
13
|
+
src/index.ts(110,58): error TS2307: Cannot find module './routing/advancedRouter'
|
|
14
|
+
src/sdk.ts(32,8): error TS2307: Cannot find module './routing/advancedRouter'
|
|
15
|
+
src/server/proxyServer.ts(20,29): error TS2307: Cannot find module '../cost/costTracker'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Missing TypeScript files:**
|
|
19
|
+
| File | Status |
|
|
20
|
+
|------|--------|
|
|
21
|
+
| `src/routing/advancedRouter.ts` | β MISSING (only `dist/` exists) |
|
|
22
|
+
| `src/cost/costTracker.ts` | β MISSING (only `dist/` exists) |
|
|
23
|
+
|
|
24
|
+
**Why tests pass:** Tests use `dist/` (compiled JS), not `src/` (TypeScript).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Council Votes
|
|
29
|
+
|
|
30
|
+
| Agent | Vote | Finding |
|
|
31
|
+
|-------|------|---------|
|
|
32
|
+
| **Architecture** | Finding #1 | Missing TypeScript source files break build |
|
|
33
|
+
| **Performance** | Finding #1 | Profile rebuilding on every routeQuery() |
|
|
34
|
+
| **Test Coverage** | Finding #1 | GuardrailEngine has zero tests |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Top 3 Improvements
|
|
39
|
+
|
|
40
|
+
### #1: Restore Missing TypeScript Source Files π΄ P0
|
|
41
|
+
**Agent Vote:** Architecture β
(unanimous)
|
|
42
|
+
|
|
43
|
+
**Problem:** `src/routing/advancedRouter.ts` and `src/cost/costTracker.ts` are missing. The `dist/` files exist but are orphaned from source.
|
|
44
|
+
|
|
45
|
+
**Solution:**
|
|
46
|
+
1. Create `src/cost/costTracker.ts` from the exported interface in `dist/`
|
|
47
|
+
2. Create `src/routing/advancedRouter.ts` - the core routing engine
|
|
48
|
+
3. Fix `src/index.ts` to import from existing source files
|
|
49
|
+
|
|
50
|
+
**Files needed:**
|
|
51
|
+
- `src/cost/costTracker.ts` (~100 lines)
|
|
52
|
+
- `src/routing/advancedRouter.ts` (~300 lines)
|
|
53
|
+
|
|
54
|
+
**Effort:** Medium | **Priority:** CRITICAL
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
### #2: Cache Profile Rebuilding in routeQuery() π‘ P1
|
|
59
|
+
**Agent Vote:** Performance β
|
|
60
|
+
|
|
61
|
+
**Problem:** `refreshModelProfiles()` is called on EVERY `routeQuery()` call, rebuilding O(n*m) provider/model objects unnecessarily.
|
|
62
|
+
|
|
63
|
+
**Current code:**
|
|
64
|
+
```javascript
|
|
65
|
+
function routeQuery(prompt, available_models, budget_multiplier = 1.0) {
|
|
66
|
+
refreshModelProfiles(); // CALLED EVERY TIME - O(n*m)
|
|
67
|
+
// ...
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Solution:** Add lazy cache with invalidation:
|
|
72
|
+
```typescript
|
|
73
|
+
let cachedProfiles: ModelProfile[] | null = null;
|
|
74
|
+
let cacheTimestamp = 0;
|
|
75
|
+
const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
76
|
+
|
|
77
|
+
function getModelProfiles() {
|
|
78
|
+
const now = Date.now();
|
|
79
|
+
if (!cachedProfiles || (now - cacheTimestamp) > CACHE_TTL_MS) {
|
|
80
|
+
cachedProfiles = buildModelProfiles();
|
|
81
|
+
cacheTimestamp = now;
|
|
82
|
+
}
|
|
83
|
+
return cachedProfiles;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Expected gain:** ~90% reduction in routing overhead (5-10ms β <1ms)
|
|
88
|
+
|
|
89
|
+
**Effort:** Low | **Priority:** High
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
### #3: Add GuardrailEngine Tests π΅ P2
|
|
94
|
+
**Agent Vote:** Test Coverage β
|
|
95
|
+
|
|
96
|
+
**Problem:** GuardrailEngine (~500 lines, security-critical) has ZERO tests. This is a major production risk.
|
|
97
|
+
|
|
98
|
+
**Coverage needed:**
|
|
99
|
+
- Pattern matching tests
|
|
100
|
+
- PII redaction tests
|
|
101
|
+
- Content filtering tests
|
|
102
|
+
- Bypass detection tests
|
|
103
|
+
|
|
104
|
+
**Solution:** Add `tests/security/guardrailEngine.test.ts`:
|
|
105
|
+
- 20+ test cases covering all 17 patterns
|
|
106
|
+
- Edge cases: empty input, malformed data, unicode
|
|
107
|
+
- Performance: <10ms per validation
|
|
108
|
+
|
|
109
|
+
**Effort:** Medium | **Priority:** High
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Other Findings (Lower Priority)
|
|
114
|
+
|
|
115
|
+
| Finding | Agent | Problem | Effort |
|
|
116
|
+
|---------|-------|---------|--------|
|
|
117
|
+
| Token counting no memoization | Performance | O(n) word split every call | Low |
|
|
118
|
+
| Memory O(n) linear search | Performance | No inverted index | Medium |
|
|
119
|
+
| EnsembleOrchestrator untested | Test Coverage | Missing integration tests | Medium |
|
|
120
|
+
| Provider config bloat | Architecture | 47+ providers in 1000+ line file | Low |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Implementation Plan
|
|
125
|
+
|
|
126
|
+
1. **Fix missing TS files** (Day 1) - CRITICAL
|
|
127
|
+
2. **Add profile caching** (Day 2) - Quick win
|
|
128
|
+
3. **Add GuardrailEngine tests** (Day 3) - Production safety
|
|
129
|
+
4. **Add token memoization** (Day 4) - Low effort
|
|
130
|
+
5. **Add memory inverted index** (Day 5) - Future scaling
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Council Summary
|
|
135
|
+
|
|
136
|
+
| Vote | Count | Topic |
|
|
137
|
+
|------|-------|-------|
|
|
138
|
+
| #1 | 3/3 | Missing TypeScript source files |
|
|
139
|
+
| #2 | 1/3 | Profile caching |
|
|
140
|
+
| #3 | 1/3 | GuardrailEngine tests |
|
|
141
|
+
|
|
142
|
+
**Unanimous verdict:** Restore missing source files FIRST (blocks everything else)
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# A3M Router β Master Launch Checklist
|
|
2
|
+
|
|
3
|
+
**Project:** adaptive-memory-multi-model-router (A3M Router)
|
|
4
|
+
**npm:** https://www.npmjs.com/package/adaptive-memory-multi-model-router
|
|
5
|
+
**GitHub:** https://github.com/Das-rebel/a3m-router
|
|
6
|
+
**Demo:** https://asciinema.org/a/RpqOZM9tFMALYWvs
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Reddit Posts
|
|
11
|
+
|
|
12
|
+
- [ ] **r/LocalLLaMA** β https://www.reddit.com/r/LocalLLaMA/submit/
|
|
13
|
+
- Post: [R] I benchmarked 47 LLM providers against 12K+ real queries β the cost/speed/quality matrix
|
|
14
|
+
- File: `articles/REDDIT_SUBMISSION_READY.md`
|
|
15
|
+
- Pre-written comments ready in file
|
|
16
|
+
- Monitor for 2 hours after posting
|
|
17
|
+
|
|
18
|
+
- [ ] **r/MachineLearning** β https://www.reddit.com/r/MachineLearning/submit/
|
|
19
|
+
- Post: [P] A3M Router achieves 82.5% routing accuracy with keyword matching
|
|
20
|
+
- File: `articles/REDDIT_SUBMISSION_READY.md`
|
|
21
|
+
- Pre-written comments ready in file
|
|
22
|
+
|
|
23
|
+
- [ ] **r/SideProject** β https://www.reddit.com/r/SideProject/submit/
|
|
24
|
+
- Post: I built an LLM router that beats GPT-5 at 1/213th the cost
|
|
25
|
+
- File: `articles/REDDIT_SUBMISSION_READY.md`
|
|
26
|
+
- Pre-written comments ready in file
|
|
27
|
+
|
|
28
|
+
- [ ] **r/programming** β (24h after r/LocalLLaMA if engagement is positive)
|
|
29
|
+
- Repurpose r/LocalLLaMA post
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Newsletter Emails
|
|
34
|
+
|
|
35
|
+
- [ ] **Import AI** (jack@sequoiacap.com) β HIGHEST PRIORITY
|
|
36
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
37
|
+
- Subject: A3M Router β #1 LLM routing benchmark, 213x cheaper than GPT-5
|
|
38
|
+
|
|
39
|
+
- [ ] **The Batch (Anthropic)** (press@anthropic.com)
|
|
40
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
41
|
+
- Subject: [Tool] A3M Router β Open-source LLM routing, #1 on RouterArena
|
|
42
|
+
|
|
43
|
+
- [ ] **Lil'Log** (lilian@openai.com or Twitter DM @lilianweng)
|
|
44
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
45
|
+
- Also try Twitter DM
|
|
46
|
+
|
|
47
|
+
- [ ] **DeepLearning.ai Newsletter**
|
|
48
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
49
|
+
- Submit at https://www.deeplearning.ai/newsletter/
|
|
50
|
+
|
|
51
|
+
- [ ] **The Economist AI**
|
|
52
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
53
|
+
- Submit at https://www.economist.com/newsletters/ai
|
|
54
|
+
|
|
55
|
+
- [ ] **OpenAI Newsletter**
|
|
56
|
+
- File: `articles/NEWSLETTER_SEND_NOW.md`
|
|
57
|
+
- Submit at https://openai.com/newsletter
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Twitter Thread
|
|
62
|
+
|
|
63
|
+
- [ ] **Tweet 1/10** β Base tweet: 3 LLM infrastructure problems
|
|
64
|
+
- [ ] **Tweet 2/10** β Dev quotes on Kimi K2.6 / cost savings
|
|
65
|
+
- [ ] **Tweet 3/10** β Every router does sequential fallback (the problem)
|
|
66
|
+
- [ ] **Tweet 4/10** β "Negligible overhead" β we published real numbers
|
|
67
|
+
- [ ] **Tweet 5/10** β The numbers since launch
|
|
68
|
+
- [ ] **Tweet 6/10** β Installation command
|
|
69
|
+
- [ ] **Tweet 7/10** β GitHub + benchmarks link
|
|
70
|
+
- [ ] **Tweet 8/10** β Routing algorithm in one slide
|
|
71
|
+
- [ ] **Tweet 9/10** β Real routing examples
|
|
72
|
+
- [ ] **Tweet 10/10** β Demo + final CTA + hashtags
|
|
73
|
+
- [ ] Pin thread after posting
|
|
74
|
+
- [ ] Engage with quote tweets and replies for 2 hours
|
|
75
|
+
|
|
76
|
+
**File:** `articles/TWEET_STORM_READY.md`
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Chinese Directories
|
|
81
|
+
|
|
82
|
+
Priority order for submission:
|
|
83
|
+
|
|
84
|
+
- [ ] **ζιAI** (juejin) β https://ai.juejin.cn β Most dev traffic, HIGHEST PRIORITY
|
|
85
|
+
- [ ] **CSDN** β https://www.csdn.net β Huge Chinese dev community
|
|
86
|
+
- [ ] **OSChina (εΌζΊδΈε½)** β https://www.oschina.net β Open-source community
|
|
87
|
+
- [ ] **ζε¦AI** β https://segmentfault.com/ai β Developer Q&A
|
|
88
|
+
- [ ] **ζͺζ₯ηΎη§** β https://nav.6ai.cn β AI directory
|
|
89
|
+
- [ ] **AIε·₯ε
·ι** β https://www.aigc.cn β AI tools directory
|
|
90
|
+
- [ ] **η₯δΉAI** β https://www.zhihu.com/topic/ai β Write article in Chinese
|
|
91
|
+
- [ ] **InfoQδΈζ** β https://www.infoq.cn β Tech media
|
|
92
|
+
- [ ] **ζΊε¨δΉεΏ** β https://www.jiqizhixin.com β AI media
|
|
93
|
+
|
|
94
|
+
**File:** `articles/CHINESE_SUBMISSIONS_READY.md`
|
|
95
|
+
**Note:** Register accounts first (some require Chinese phone number)
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Awesome List PRs / Updates
|
|
100
|
+
|
|
101
|
+
- [x] **awesome-llm-apps** β Already has A3M Router entry at line 290:
|
|
102
|
+
`* [π― A3M Router](advanced_llm_apps/llm_optimization_tools/a3m_router/)`
|
|
103
|
+
No update needed.
|
|
104
|
+
|
|
105
|
+
- [x] **Awesome-LLMOps** β Already has A3M Router entry at line 219:
|
|
106
|
+
`| [A3M Router](https://github.com/Das-rebel/a3m-router) | #1 on RouterArena (76.43) at $0.047/1K...`
|
|
107
|
+
No update needed.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Post-Launch Actions
|
|
112
|
+
|
|
113
|
+
- [ ] Monitor GitHub stars (current: 8)
|
|
114
|
+
- [ ] Monitor npm downloads (current: 15,237)
|
|
115
|
+
- [ ] Respond to any GitHub issues
|
|
116
|
+
- [ ] Update RouterArena entry with A3M Router details
|
|
117
|
+
- [ ] Submit to:
|
|
118
|
+
- [ ] Product Hunt
|
|
119
|
+
- [ ] Hacker News (Show HN)
|
|
120
|
+
- [ ] Lobsters
|
|
121
|
+
- [ ] BetaList
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Tracking
|
|
126
|
+
|
|
127
|
+
| Channel | Status | Date Posted |
|
|
128
|
+
|---------|--------|-------------|
|
|
129
|
+
| r/LocalLLaMA | [ ] | |
|
|
130
|
+
| r/MachineLearning | [ ] | |
|
|
131
|
+
| r/SideProject | [ ] | |
|
|
132
|
+
| Twitter Thread | [ ] | |
|
|
133
|
+
| Import AI | [ ] | |
|
|
134
|
+
| The Batch | [ ] | |
|
|
135
|
+
| Lil'Log | [ ] | |
|
|
136
|
+
| DeepLearning.ai | [ ] | |
|
|
137
|
+
| ζιAI | [ ] | |
|
|
138
|
+
| CSDN | [ ] | |
|
|
139
|
+
| OSChina | [ ] | |
|
|
140
|
+
| GitHub stars | 8 | baseline |
|
|
141
|
+
| npm downloads | 15,237 | baseline |
|