adaptive-memory-multi-model-router 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -8
- package/assets/cost-comparison.svg +134 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,14 +95,30 @@ npx a3m-router serve --port 3000 # Start proxy on custom port
|
|
|
95
95
|
|
|
96
96
|
## Cost Comparison
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+
Based on real provider pricing from `providerConfig.ts` and [RouteLLM](https://arxiv.org/abs/2404.06035) query distribution.
|
|
101
|
+
|
|
102
|
+
| Query Type | % Traffic | Example | GPT-4o (all) | A3M Routes To | A3M Cost | Savings |
|
|
103
|
+
|-----------|:---------:|---------|:------------:|:-------------:|:--------:|:-------:|
|
|
104
|
+
| Simple Q&A | 47% | "What is 2+2?" | $4.94 | CommandCode (FREE) | $0.00 | **100%** |
|
|
105
|
+
| Code generation | 15% | "Write Python sort" | $4.88 | DeepSeek v3 ($0.14/1M) | $0.17 | **97%** |
|
|
106
|
+
| Summarization | 18% | "Summarize this doc" | $7.20 | GPT-4o-mini ($0.15/1M) | $0.43 | **94%** |
|
|
107
|
+
| Complex reasoning | 12% | "Analyze economics..." | $8.70 | Claude Haiku ($0.80/1M) | $3.36 | **61%** |
|
|
108
|
+
| Expert analysis | 8% | "Legal contract review" | $8.40 | GPT-4o ($2.50/1M) | $8.40 | 0% |
|
|
109
|
+
| **TOTAL (10K/mo)** | **100%** | — | **$34.11** | — | **$12.36** | **64%** |
|
|
110
|
+
|
|
111
|
+
### Scale Projections
|
|
112
|
+
|
|
113
|
+
| Monthly Queries | GPT-4o (all) | A3M Router | Monthly Savings | Annual Savings |
|
|
114
|
+
|:---------------:|:------------:|:----------:|:---------------:|:--------------:|
|
|
115
|
+
| 10,000 | $34 | $12 | $22 | $261 |
|
|
116
|
+
| 50,000 | $171 | $62 | $109 | $1,305 |
|
|
117
|
+
| 100,000 | $341 | $124 | $218 | $2,610 |
|
|
118
|
+
| 500,000 | $1,706 | $618 | $1,088 | $13,050 |
|
|
119
|
+
| 1,000,000 | $3,411 | $1,236 | **$2,175** | **$26,100** |
|
|
120
|
+
|
|
121
|
+
> **The key insight:** 47% of your queries are simple. 20% need premium models. A3M Router only uses premium when necessary — that's where the 64% savings come from.
|
|
106
122
|
|
|
107
123
|
---
|
|
108
124
|
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="780" height="520" viewBox="0 0 780 520">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="gpt4bar" x1="0" y1="0" x2="1" y2="0">
|
|
4
|
+
<stop offset="0%" stop-color="#f85149"/>
|
|
5
|
+
<stop offset="100%" stop-color="#da3633"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<linearGradient id="a3mbar" x1="0" y1="0" x2="1" y2="0">
|
|
8
|
+
<stop offset="0%" stop-color="#3fb950"/>
|
|
9
|
+
<stop offset="100%" stop-color="#238636"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
<linearGradient id="header" x1="0" y1="0" x2="0" y2="1">
|
|
12
|
+
<stop offset="0%" stop-color="#161b22"/>
|
|
13
|
+
<stop offset="100%" stop-color="#0d1117"/>
|
|
14
|
+
</linearGradient>
|
|
15
|
+
</defs>
|
|
16
|
+
|
|
17
|
+
<!-- Background -->
|
|
18
|
+
<rect width="780" height="520" rx="12" fill="#0d1117" stroke="#30363d" stroke-width="1"/>
|
|
19
|
+
|
|
20
|
+
<!-- Header -->
|
|
21
|
+
<rect width="780" height="56" rx="12" fill="url(#header)"/>
|
|
22
|
+
<rect y="44" width="780" height="12" fill="url(#header)"/>
|
|
23
|
+
<text x="24" y="28" font-family="-apple-system,system-ui,sans-serif" font-size="18" fill="#c9d1d9" font-weight="700">💰 Cost Comparison</text>
|
|
24
|
+
<text x="24" y="46" font-family="-apple-system,system-ui,sans-serif" font-size="12" fill="#8b949e">10,000 queries/month · Real provider pricing · Mixed query complexity</text>
|
|
25
|
+
|
|
26
|
+
<!-- Legend -->
|
|
27
|
+
<rect x="580" y="16" width="14" height="14" rx="3" fill="url(#gpt4bar)"/>
|
|
28
|
+
<text x="600" y="27" font-family="-apple-system,system-ui,sans-serif" font-size="12" fill="#f85149">All → GPT-4o</text>
|
|
29
|
+
<rect x="680" y="16" width="14" height="14" rx="3" fill="url(#a3mbar)"/>
|
|
30
|
+
<text x="700" y="27" font-family="-apple-system,system-ui,sans-serif" font-size="12" fill="#3fb950">A3M Routed</text>
|
|
31
|
+
|
|
32
|
+
<!-- Chart rows -->
|
|
33
|
+
<g font-family="'SF Mono','Fira Code',monospace" font-size="12">
|
|
34
|
+
|
|
35
|
+
<!-- Row 1: Simple Q&A -->
|
|
36
|
+
<text x="24" y="82" fill="#8b949e">Simple Q&A</text>
|
|
37
|
+
<text x="24" y="96" fill="#484f58" font-size="10">47% of traffic · "What is 2+2?"</text>
|
|
38
|
+
<rect x="140" y="78" width="200" height="20" rx="4" fill="url(#gpt4bar)" opacity="0.9">
|
|
39
|
+
<animate attributeName="width" from="0" to="200" dur="0.6s" fill="freeze"/>
|
|
40
|
+
</rect>
|
|
41
|
+
<text x="346" y="93" fill="#f85149" font-size="11">$4.94</text>
|
|
42
|
+
<rect x="140" y="100" width="2" height="14" rx="2" fill="url(#a3mbar)">
|
|
43
|
+
<animate attributeName="width" from="0" to="2" dur="0.4s" fill="freeze"/>
|
|
44
|
+
</rect>
|
|
45
|
+
<text x="148" y="112" fill="#3fb950" font-size="11">$0.00 → CommandCode (FREE)</text>
|
|
46
|
+
<text x="720" y="96" fill="#3fb950" font-weight="bold" font-size="13">100% ✓</text>
|
|
47
|
+
|
|
48
|
+
<!-- Row 2: Code generation -->
|
|
49
|
+
<text x="24" y="148" fill="#8b949e">Code generation</text>
|
|
50
|
+
<text x="24" y="162" fill="#484f58" font-size="10">15% of traffic · "Write Python sort"</text>
|
|
51
|
+
<rect x="140" y="144" width="198" height="20" rx="4" fill="url(#gpt4bar)" opacity="0.9">
|
|
52
|
+
<animate attributeName="width" from="0" to="198" dur="0.6s" begin="0.15s" fill="freeze"/>
|
|
53
|
+
</rect>
|
|
54
|
+
<text x="344" y="159" fill="#f85149" font-size="11">$4.88</text>
|
|
55
|
+
<rect x="140" y="166" width="7" height="14" rx="2" fill="url(#a3mbar)">
|
|
56
|
+
<animate attributeName="width" from="0" to="7" dur="0.4s" begin="0.15s" fill="freeze"/>
|
|
57
|
+
</rect>
|
|
58
|
+
<text x="153" y="178" fill="#3fb950" font-size="11">$0.17 → DeepSeek v3</text>
|
|
59
|
+
<text x="720" y="162" fill="#3fb950" font-weight="bold" font-size="13">97% ✓</text>
|
|
60
|
+
|
|
61
|
+
<!-- Row 3: Summarization -->
|
|
62
|
+
<text x="24" y="214" fill="#8b949e">Summarization</text>
|
|
63
|
+
<text x="24" y="228" fill="#484f58" font-size="10">18% of traffic · "Summarize this doc"</text>
|
|
64
|
+
<rect x="140" y="210" width="292" height="20" rx="4" fill="url(#gpt4bar)" opacity="0.9">
|
|
65
|
+
<animate attributeName="width" from="0" to="292" dur="0.6s" begin="0.3s" fill="freeze"/>
|
|
66
|
+
</rect>
|
|
67
|
+
<text x="438" y="225" fill="#f85149" font-size="11">$7.20</text>
|
|
68
|
+
<rect x="140" y="232" width="17" height="14" rx="2" fill="url(#a3mbar)">
|
|
69
|
+
<animate attributeName="width" from="0" to="17" dur="0.4s" begin="0.3s" fill="freeze"/>
|
|
70
|
+
</rect>
|
|
71
|
+
<text x="163" y="244" fill="#3fb950" font-size="11">$0.43 → GPT-4o-mini</text>
|
|
72
|
+
<text x="720" y="228" fill="#3fb950" font-weight="bold" font-size="13">94% ✓</text>
|
|
73
|
+
|
|
74
|
+
<!-- Row 4: Complex reasoning -->
|
|
75
|
+
<text x="24" y="280" fill="#8b949e">Complex reasoning</text>
|
|
76
|
+
<text x="24" y="294" fill="#484f58" font-size="10">12% of traffic · "Analyze economics of..."</text>
|
|
77
|
+
<rect x="140" y="276" width="352" height="20" rx="4" fill="url(#gpt4bar)" opacity="0.9">
|
|
78
|
+
<animate attributeName="width" from="0" to="352" dur="0.6s" begin="0.45s" fill="freeze"/>
|
|
79
|
+
</rect>
|
|
80
|
+
<text x="498" y="291" fill="#f85149" font-size="11">$8.70</text>
|
|
81
|
+
<rect x="140" y="298" width="136" height="14" rx="2" fill="url(#a3mbar)">
|
|
82
|
+
<animate attributeName="width" from="0" to="136" dur="0.4s" begin="0.45s" fill="freeze"/>
|
|
83
|
+
</rect>
|
|
84
|
+
<text x="282" y="310" fill="#3fb950" font-size="11">$3.36 → Claude Haiku</text>
|
|
85
|
+
<text x="720" y="294" fill="#ffa657" font-weight="bold" font-size="13">61% ✓</text>
|
|
86
|
+
|
|
87
|
+
<!-- Row 5: Expert analysis -->
|
|
88
|
+
<text x="24" y="346" fill="#8b949e">Expert analysis</text>
|
|
89
|
+
<text x="24" y="360" fill="#484f58" font-size="10">8% of traffic · "Legal contract review"</text>
|
|
90
|
+
<rect x="140" y="342" width="340" height="20" rx="4" fill="url(#gpt4bar)" opacity="0.9">
|
|
91
|
+
<animate attributeName="width" from="0" to="340" dur="0.6s" begin="0.6s" fill="freeze"/>
|
|
92
|
+
</rect>
|
|
93
|
+
<text x="486" y="357" fill="#f85149" font-size="11">$8.40</text>
|
|
94
|
+
<rect x="140" y="364" width="340" height="14" rx="2" fill="url(#a3mbar)" opacity="0.5">
|
|
95
|
+
<animate attributeName="width" from="0" to="340" dur="0.4s" begin="0.6s" fill="freeze"/>
|
|
96
|
+
</rect>
|
|
97
|
+
<text x="486" y="376" fill="#8b949e" font-size="11">$8.40 → GPT-4o (no shortcut)</text>
|
|
98
|
+
<text x="720" y="360" fill="#8b949e" font-weight="bold" font-size="13">0%</text>
|
|
99
|
+
</g>
|
|
100
|
+
|
|
101
|
+
<!-- Divider -->
|
|
102
|
+
<line x1="24" y1="396" x2="756" y2="396" stroke="#30363d" stroke-width="1"/>
|
|
103
|
+
|
|
104
|
+
<!-- Total -->
|
|
105
|
+
<g font-family="-apple-system,system-ui,sans-serif">
|
|
106
|
+
<text x="24" y="418" fill="#c9d1d9" font-size="16" font-weight="700">Total: 10,000 queries</text>
|
|
107
|
+
<text x="380" y="418" fill="#f85149" font-size="16" font-weight="700">$34.11/mo</text>
|
|
108
|
+
<text x="470" y="418" fill="#484f58" font-size="16">→</text>
|
|
109
|
+
<text x="498" y="418" fill="#3fb950" font-size="16" font-weight="700">$12.36/mo</text>
|
|
110
|
+
<text x="600" y="418" fill="#3fb950" font-size="20" font-weight="800">Save 64%</text>
|
|
111
|
+
</g>
|
|
112
|
+
|
|
113
|
+
<!-- Scale projections -->
|
|
114
|
+
<g font-family="'SF Mono','Fira Code',monospace" font-size="11">
|
|
115
|
+
<text x="24" y="448" fill="#8b949e">At scale:</text>
|
|
116
|
+
<text x="24" y="468" fill="#484f58"> 100K queries/mo</text>
|
|
117
|
+
<text x="200" y="468" fill="#f85149">$341</text>
|
|
118
|
+
<text x="240" y="468" fill="#484f58">→</text>
|
|
119
|
+
<text x="260" y="468" fill="#3fb950">$124</text>
|
|
120
|
+
<text x="310" y="468" fill="#3fb950">save $218/mo</text>
|
|
121
|
+
|
|
122
|
+
<text x="420" y="468" fill="#484f58"> 1M queries/mo</text>
|
|
123
|
+
<text x="580" y="468" fill="#f85149">$3,411</text>
|
|
124
|
+
<text x="630" y="468" fill="#484f58">→</text>
|
|
125
|
+
<text x="650" y="468" fill="#3fb950">$1,236</text>
|
|
126
|
+
<text x="700" y="468" fill="#3fb950">save $2,175/mo</text>
|
|
127
|
+
</g>
|
|
128
|
+
|
|
129
|
+
<!-- Bottom note -->
|
|
130
|
+
<rect x="16" y="488" width="748" height="24" rx="4" fill="#161b22"/>
|
|
131
|
+
<text x="390" y="504" text-anchor="middle" font-family="-apple-system,system-ui,sans-serif" font-size="11" fill="#8b949e">
|
|
132
|
+
Based on real provider pricing from providerConfig.ts · RouteLLM query distribution (47% simple) · Savings vary by usage
|
|
133
|
+
</text>
|
|
134
|
+
</svg>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adaptive-memory-multi-model-router",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"shortName": "A3M Router",
|
|
5
5
|
"displayName": "A3M Router - Adaptive Memory Multi-Model Router",
|
|
6
6
|
"description": "Drop-in OpenAI proxy that routes queries to the cheapest capable model. 39 providers, semantic cache, guardrails. 245% growth in 3 days, zero budget.",
|