@tokcalc/mcp-server 0.1.2 → 0.1.4
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 +86 -406
- package/dist/index.js +21285 -0
- package/package.json +34 -91
- package/.zscripts/build.sh +0 -175
- package/.zscripts/database-runtime-build.sh +0 -33
- package/.zscripts/dev.pid +0 -1
- package/.zscripts/dev.sh +0 -154
- package/.zscripts/mini-services-build.sh +0 -78
- package/.zscripts/mini-services-install.sh +0 -65
- package/.zscripts/mini-services-start.sh +0 -123
- package/.zscripts/python-runtime-build.sh +0 -120
- package/.zscripts/start.sh +0 -145
- package/CAPACITY_STUDY.md +0 -283
- package/CODE_OF_CONDUCT.md +0 -55
- package/CONTRIBUTING.md +0 -177
- package/Caddyfile +0 -23
- package/LICENSE +0 -204
- package/bun.lock +0 -1965
- package/components.json +0 -21
- package/db/custom.db +0 -0
- package/download/README.md +0 -1
- package/download/tokcalc-dark-calculator.png +0 -0
- package/download/tokcalc-dark-default.png +0 -0
- package/download/tokcalc-demo.webm +0 -0
- package/download/tokcalc-github-link.png +0 -0
- package/download/tokcalc-hydration-fixed.png +0 -0
- package/download/tokcalc-issue-resolved.png +0 -0
- package/download/tokcalc-light-mode.png +0 -0
- package/download/tokcalc-light-reference.png +0 -0
- package/download/tokcalc-long-context-qwen.png +0 -0
- package/download/tokcalc-long-context.png +0 -0
- package/download/tokcalc-og-image-preview.png +0 -0
- package/download/tokcalc-phase2-3.png +0 -0
- package/download/tokcalc-plain-english.png +0 -0
- package/download/tokcalc-preview.png +0 -0
- package/download/tokcalc-share-bvb.png +0 -0
- package/download/tokcalc-share-feature.png +0 -0
- package/download/tokcalc-tab-build-vs-buy.png +0 -0
- package/download/tokcalc-tab-calculator.png +0 -0
- package/download/tokcalc-tab-reference.png +0 -0
- package/eslint.config.mjs +0 -50
- package/examples/websocket/frontend.tsx +0 -196
- package/examples/websocket/server.ts +0 -138
- package/mini-services/.gitkeep +0 -0
- package/mini-services/mcp-server/README.md +0 -86
- package/mini-services/mcp-server/bun.lock +0 -202
- package/mini-services/mcp-server/index.ts +0 -504
- package/mini-services/mcp-server/package.json +0 -40
- package/next.config.ts +0 -12
- package/postcss.config.mjs +0 -5
- package/prisma/schema.prisma +0 -32
- package/public/google6f58ca6be85fa903.html +0 -1
- package/public/logo.svg +0 -29
- package/public/manifest.json +0 -51
- package/public/og-icon-256.png +0 -0
- package/public/og.png +0 -0
- package/public/robots.txt +0 -25
- package/public/sitemap.xml +0 -23
- package/public/tokcalc-demo.gif +0 -0
- package/scripts/og-template.html +0 -120
- package/scripts/render-og.mjs +0 -43
- package/server.json +0 -21
- package/src/app/api/pricing/aws/route.ts +0 -186
- package/src/app/api/pricing/azure/route.ts +0 -168
- package/src/app/api/pricing/gcp/route.ts +0 -230
- package/src/app/api/pricing/vast-ai/route.ts +0 -164
- package/src/app/api/route.ts +0 -5
- package/src/app/compare/h100-vs-h200/layout.tsx +0 -30
- package/src/app/compare/h100-vs-h200/page.tsx +0 -328
- package/src/app/globals.css +0 -122
- package/src/app/layout.tsx +0 -276
- package/src/app/page.tsx +0 -2670
- package/src/components/azure-live-pricing.tsx +0 -185
- package/src/components/benchmark-import.tsx +0 -340
- package/src/components/confidence-badge.tsx +0 -116
- package/src/components/live-pricing-comparison.tsx +0 -241
- package/src/components/theme-provider.tsx +0 -11
- package/src/components/theme-toggle.tsx +0 -55
- package/src/components/ui/accordion.tsx +0 -66
- package/src/components/ui/alert-dialog.tsx +0 -157
- package/src/components/ui/alert.tsx +0 -66
- package/src/components/ui/aspect-ratio.tsx +0 -11
- package/src/components/ui/avatar.tsx +0 -53
- package/src/components/ui/badge.tsx +0 -46
- package/src/components/ui/breadcrumb.tsx +0 -109
- package/src/components/ui/button.tsx +0 -59
- package/src/components/ui/calendar.tsx +0 -213
- package/src/components/ui/card.tsx +0 -92
- package/src/components/ui/carousel.tsx +0 -241
- package/src/components/ui/chart.tsx +0 -353
- package/src/components/ui/checkbox.tsx +0 -32
- package/src/components/ui/collapsible.tsx +0 -33
- package/src/components/ui/command.tsx +0 -184
- package/src/components/ui/context-menu.tsx +0 -252
- package/src/components/ui/dialog.tsx +0 -143
- package/src/components/ui/drawer.tsx +0 -135
- package/src/components/ui/dropdown-menu.tsx +0 -257
- package/src/components/ui/form.tsx +0 -167
- package/src/components/ui/hover-card.tsx +0 -44
- package/src/components/ui/input-otp.tsx +0 -77
- package/src/components/ui/input.tsx +0 -21
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/menubar.tsx +0 -276
- package/src/components/ui/navigation-menu.tsx +0 -168
- package/src/components/ui/pagination.tsx +0 -127
- package/src/components/ui/popover.tsx +0 -48
- package/src/components/ui/progress.tsx +0 -31
- package/src/components/ui/radio-group.tsx +0 -45
- package/src/components/ui/resizable.tsx +0 -56
- package/src/components/ui/scroll-area.tsx +0 -58
- package/src/components/ui/select.tsx +0 -185
- package/src/components/ui/separator.tsx +0 -28
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/sidebar.tsx +0 -726
- package/src/components/ui/skeleton.tsx +0 -13
- package/src/components/ui/slider.tsx +0 -63
- package/src/components/ui/sonner.tsx +0 -25
- package/src/components/ui/switch.tsx +0 -31
- package/src/components/ui/table.tsx +0 -116
- package/src/components/ui/tabs.tsx +0 -66
- package/src/components/ui/textarea.tsx +0 -18
- package/src/components/ui/toast.tsx +0 -129
- package/src/components/ui/toaster.tsx +0 -35
- package/src/components/ui/toggle-group.tsx +0 -73
- package/src/components/ui/toggle.tsx +0 -47
- package/src/components/ui/tooltip.tsx +0 -61
- package/src/components/vast-ai-live-pricing.tsx +0 -176
- package/src/hooks/use-mobile.ts +0 -19
- package/src/hooks/use-toast.ts +0 -194
- package/src/lib/benchmark-parser-sglang.ts +0 -150
- package/src/lib/benchmark-parser-tokcalc.ts +0 -247
- package/src/lib/benchmark-parser-trtllm.ts +0 -152
- package/src/lib/benchmark-parser-vllm.ts +0 -198
- package/src/lib/benchmark-schema.ts +0 -263
- package/src/lib/db.ts +0 -13
- package/src/lib/engine-presets.ts +0 -183
- package/src/lib/price-schema.ts +0 -141
- package/src/lib/token-calc.ts +0 -808
- package/src/lib/track.ts +0 -31
- package/src/lib/url-state.ts +0 -256
- package/src/lib/utils.ts +0 -6
- package/tailwind.config.ts +0 -64
- package/tests/database-runtime-build.sh +0 -75
- package/tests/python-runtime-build.sh +0 -64
- package/tests/python-runtime-container.sh +0 -31
- package/tool-results/bash_1789888171144_2c5381860539.txt +0 -161
- package/tool-results/bash_1789888175925_49c53ba3c61b.txt +0 -191
- package/tool-results/bash_1789888181202_49c53ba3c61b.txt +0 -191
- package/tool-results/bash_1789888195219_4a86a5c91411.txt +0 -200
- package/tool-results/bash_1789888203128_6cca13c71b47.txt +0 -199
- package/tool-results/bash_1789929256963_2a52aff0d0a8.txt +0 -160
- package/tool-results/read_1789888151021_69f58eec6a5b.txt +0 -653
- package/tool-results/read_1789888153837_1d3a8bfc2a94.txt +0 -653
- package/tool-results/read_1789888163087_ccc406d47505.txt +0 -122
- package/tool-results/read_1789888167347_67d1d7c9830a.txt +0 -122
- package/tool-results/read_1789929252529_d90e8f383a25.txt +0 -285
- package/tsconfig.json +0 -42
- package/upload/Pasted Content_1789887800864.txt +0 -652
- package/upload/Pasted Content_1789887909561.txt +0 -652
- package/upload/Pasted Content_1789887918428.txt +0 -652
- package/upload/Pasted Content_1789887959420.txt +0 -652
- package/upload/Pasted Content_1789888020485.txt +0 -652
- package/upload/Pasted Content_1789888058079.txt +0 -652
- package/upload/Pasted Content_1789888885033.txt +0 -686
- package/upload/Pasted Content_1789928912741.txt +0 -285
- package/upload/Pasted Content_1789928938402.txt +0 -285
- package/upload/Pasted Content_1789929160389.txt +0 -285
- package/upload/Pasted Content_1789929176660.txt +0 -285
- package/upload/issue_vision.json +0 -28
- package/upload/pasted_image_1789883175209.png +0 -0
- package/upload/pasted_image_1789899056690.png +0 -0
- package/upload/pasted_image_1789900371483.png +0 -0
- package/upload/pasted_image_1789900472823.png +0 -0
- package/upload/pasted_image_1789900490374.png +0 -0
- package/upload/pasted_image_1789900585552.png +0 -0
- package/upload/pasted_image_1789900606519.png +0 -0
- package/upload/pasted_image_1789901598705.png +0 -0
- package/upload/pasted_image_1789901613545.png +0 -0
- package/upload/pasted_image_1789978382674.png +0 -0
- package/upload/pasted_image_1789978392749.png +0 -0
- package/upload/pasted_image_1789978474879.png +0 -0
- package/upload/pasted_image_1789978523652.png +0 -0
- package/upload/pasted_image_1789984219089.png +0 -0
- package/upload/pasted_image_1789984491896.png +0 -0
- package/upload/pasted_image_1789985017950.png +0 -0
- package/upload/pasted_image_1789985036765.png +0 -0
- package/upload/pasted_image_1789985049848.png +0 -0
- package/upload/pasted_image_1790002427833.png +0 -0
- package/upload/pasted_image_1790002659944.png +0 -0
- package/upload/pasted_image_1790037038476.png +0 -0
- package/upload/screenshot_analysis.json +0 -28
- package/upload/vision_output.json +0 -28
package/README.md
CHANGED
|
@@ -1,406 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
###
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
|
|
64
|
-
>
|
|
65
|
-
|
|
66
|
-
>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Independent calculator (separate state) that compares:
|
|
89
|
-
- **Self-host**: model + GPU + quant + utilization + batch → $/M tokens + monthly cost
|
|
90
|
-
- **API**: 13 providers (OpenAI / Anthropic / Gemini / Groq / DeepSeek / Mistral / Together)
|
|
91
|
-
- **Verdict**: Self-host cheaper / API cheaper / Not enough volume — with break-even reqs/day
|
|
92
|
-
|
|
93
|
-
### Reference tab
|
|
94
|
-
|
|
95
|
-
5 sub-tables — fully transparent, every record source-linked where available:
|
|
96
|
-
- **Models** (35 entries: Llama 4 Scout/Maverick, Qwen 3 family, DeepSeek V3/R1, Pixtral, BGE-M3, ...)
|
|
97
|
-
- **GPUs** (30 entries: H100/H200/B200/B300, AMD MI300X/MI325X, Intel Gaudi 3, TPU v5p/Trillium, Groq LPU, Cerebras WSE-3, Apple M2/M3/M4 Ultra, ...)
|
|
98
|
-
- **Quantization** (16 formats: FP16/BF16, GGUF Q2_K→Q8_0, GPTQ, AWQ, EXL2, FP8, NVFP4)
|
|
99
|
-
- **API pricing** (13 models with input/cached/output + retired/current status)
|
|
100
|
-
- **Cloud GPU pricing** (all GPUs with $/hr > 0 + typical providers)
|
|
101
|
-
|
|
102
|
-
### The long-context capacity planner (the differentiator)
|
|
103
|
-
|
|
104
|
-
This is the formula the Perplexity research brief called "the most important
|
|
105
|
-
tokcalc should visibly expose":
|
|
106
|
-
|
|
107
|
-
$$
|
|
108
|
-
\text{KV bytes/request} = 2 \cdot L \cdot T \cdot H_{\text{kv}} \cdot D_h \cdot B
|
|
109
|
-
$$
|
|
110
|
-
|
|
111
|
-
For dense attention, prefill cost grows **superlinearly** with context length:
|
|
112
|
-
|
|
113
|
-
$$
|
|
114
|
-
\text{prefill FLOPs} = \underbrace{2 \cdot N \cdot T}_{\text{linear}} + \underbrace{T^2 \cdot H_{\text{kv}} \cdot D_h \cdot L}_{\text{attention}}
|
|
115
|
-
$$
|
|
116
|
-
|
|
117
|
-
tokcalc shows you:
|
|
118
|
-
- Max concurrent users at 4K / 8K / 16K / 32K / 64K / 128K / 256K / 512K / 1M context
|
|
119
|
-
- KV memory per request at each context length
|
|
120
|
-
- Prefill time (with superlinear attention correction beyond 32K)
|
|
121
|
-
- Required topology (Single GPU → TP×2/4/8 → TP×8 + Context Parallel)
|
|
122
|
-
- RingAttention citation when CP is needed
|
|
123
|
-
|
|
124
|
-
## The math, transparently
|
|
125
|
-
|
|
126
|
-
Every number above comes from a formula you can inspect. No black boxes.
|
|
127
|
-
|
|
128
|
-
<details>
|
|
129
|
-
<summary><b>Decode tokens/sec (memory-bandwidth bound)</b></summary>
|
|
130
|
-
|
|
131
|
-
$$
|
|
132
|
-
\text{decode tok/sec} \approx \frac{\text{HBM BW} \cdot \eta_{\text{mem}} \cdot \text{quant\_eff}}{\text{model size}}
|
|
133
|
-
$$
|
|
134
|
-
|
|
135
|
-
Where:
|
|
136
|
-
- `HBM BW` = GPU memory bandwidth (e.g., 3350 GB/s for H100 SXM)
|
|
137
|
-
- `η_mem = 0.65` = typical real-world memory utilization (35% overhead)
|
|
138
|
-
- `quant_eff` = dequantization efficiency multiplier (1.0 for FP16, 1.5 for FP8 on H100, 0.85 for INT4)
|
|
139
|
-
- `model size = active_params × bytes_per_param` (uses ACTIVE params for MoE, not total)
|
|
140
|
-
|
|
141
|
-
Refs: PagedAttention paper ([arxiv.org/abs/2309.06180](https://arxiv.org/abs/2309.06180))
|
|
142
|
-
</details>
|
|
143
|
-
|
|
144
|
-
<details>
|
|
145
|
-
<summary><b>Prefill tokens/sec (compute bound)</b></summary>
|
|
146
|
-
|
|
147
|
-
$$
|
|
148
|
-
\text{prefill tok/sec} \approx \frac{\text{GPU FLOPS} \cdot \eta_{\text{compute}}}{2 \cdot \text{active params}}
|
|
149
|
-
$$
|
|
150
|
-
|
|
151
|
-
Where:
|
|
152
|
-
- `GPU FLOPS` = dense FP16/BF16 TFLOPS (sparse values not used)
|
|
153
|
-
- `η_compute = 0.50` = typical compute utilization
|
|
154
|
-
- Factor of 2 = one multiply + one add per parameter per token
|
|
155
|
-
|
|
156
|
-
For long context (>32K), the superlinear attention correction above applies.
|
|
157
|
-
</details>
|
|
158
|
-
|
|
159
|
-
<details>
|
|
160
|
-
<summary><b>Continuous batching multiplier (workload-specific)</b></summary>
|
|
161
|
-
|
|
162
|
-
$$
|
|
163
|
-
\text{aggregate tok/sec} = \text{decode tok/sec} \cdot \text{batch size} \cdot \text{continuous batching multiplier}
|
|
164
|
-
$$
|
|
165
|
-
|
|
166
|
-
**Critical caveat**: There is no universal continuous batching multiplier. vLLM
|
|
167
|
-
reported 14–24× vs HF Transformers (extreme), 2.2–2.5× vs TGI. SOSP paper
|
|
168
|
-
finds 2–4× typical vs FasterTransformer/Orca. tokcalc defaults to a
|
|
169
|
-
conservative **1.5×** and lets you tune.
|
|
170
|
-
|
|
171
|
-
Refs:
|
|
172
|
-
- [vLLM blog (2023-06-20)](https://vllm.ai/blog/2023-06-20-vllm)
|
|
173
|
-
- [PagedAttention paper](https://arxiv.org/abs/2309.06180)
|
|
174
|
-
- [Anyscale continuous batching study](https://www.anyscale.com/blog/continuous-batching-llm-inference)
|
|
175
|
-
</details>
|
|
176
|
-
|
|
177
|
-
<details>
|
|
178
|
-
<summary><b>Prompt caching economics (Anthropic / OpenAI)</b></summary>
|
|
179
|
-
|
|
180
|
-
For shared prefix of length $T_p$, suffix of length $T_u$, output $O$,
|
|
181
|
-
cache hit rate $h$:
|
|
182
|
-
|
|
183
|
-
$$
|
|
184
|
-
\text{API input cost} = N \cdot \left[ (1-h) \cdot T_p \cdot P_{\text{write}} + h \cdot T_p \cdot P_{\text{read}} + T_u \cdot P_{\text{input}} \right]
|
|
185
|
-
$$
|
|
186
|
-
|
|
187
|
-
Anthropic multipliers (verified 2025-2026):
|
|
188
|
-
- 5-minute cache write: 1.25× base input
|
|
189
|
-
- 1-hour cache write: 2.0× base input
|
|
190
|
-
- Cache read: 0.1× base input (90% savings)
|
|
191
|
-
|
|
192
|
-
OpenAI: cached input discounted 50%, no separate write fee.
|
|
193
|
-
|
|
194
|
-
Refs:
|
|
195
|
-
- [Anthropic prompt caching docs](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching)
|
|
196
|
-
- [OpenAI prompt caching guide](https://platform.openai.com/docs/guides/prompt-caching)
|
|
197
|
-
</details>
|
|
198
|
-
|
|
199
|
-
<details>
|
|
200
|
-
<summary><b>Multi-GPU topology recommendation</b></summary>
|
|
201
|
-
|
|
202
|
-
$$
|
|
203
|
-
\text{total needed} = \text{model weights} + (\text{KV per request} \cdot \text{batch size})
|
|
204
|
-
$$
|
|
205
|
-
|
|
206
|
-
Walk the smallest topology that fits:
|
|
207
|
-
- **Single GPU**: total ≤ VRAM × 1
|
|
208
|
-
- **Tensor Parallel ×2/4/8**: total ≤ VRAM × N (weights + KV split evenly)
|
|
209
|
-
- **TP×8 + Context Parallel**: total > VRAM × 8 — use RingAttention to shard KV across nodes
|
|
210
|
-
|
|
211
|
-
Refs: [RingAttention paper](https://arxiv.org/abs/2310.01889)
|
|
212
|
-
</details>
|
|
213
|
-
|
|
214
|
-
<details>
|
|
215
|
-
<summary><b>Self-host vs API break-even</b></summary>
|
|
216
|
-
|
|
217
|
-
$$
|
|
218
|
-
\text{self-host $/M tokens} = \frac{\text{GPU $/hr}}{3600 \cdot \text{effective tok/s} \cdot \text{utilization}} \cdot 10^6
|
|
219
|
-
$$
|
|
220
|
-
|
|
221
|
-
$$
|
|
222
|
-
\text{break-even req/day} = \frac{\text{monthly self-host cost}}{30 \cdot \text{API cost per request}}
|
|
223
|
-
$$
|
|
224
|
-
|
|
225
|
-
The decisive term is **effective utilization** — not peak throughput. A GPU
|
|
226
|
-
running at 10% utilization pays 10× more per token than the theoretical minimum.
|
|
227
|
-
</details>
|
|
228
|
-
|
|
229
|
-
## Comparison with adjacent tools
|
|
230
|
-
|
|
231
|
-
| Capability | induwara / techfuelhq / pcmasterstudio | gigagpu / kickllm / cloudparity | HF Open LLM Leaderboard / MLPerf | **tokcalc** |
|
|
232
|
-
|---|:---:|:---:|:---:|:---:|
|
|
233
|
-
| Model × GPU × quant tok/s | ✓ | some | some | **✓** |
|
|
234
|
-
| Model-fit / VRAM | basic | rare | rare | **✓** |
|
|
235
|
-
| KV-cache by context + concurrency | — | — | implicit | **✓** |
|
|
236
|
-
| Prefill vs decode split (TTFT/ITL) | — | — | engine-specific | **✓** |
|
|
237
|
-
| Continuous batching / paged attention | — | — | docs only | **✓** |
|
|
238
|
-
| Long-context (128K–1M) planning | — | — | — | **✓** |
|
|
239
|
-
| Topology recommendation (TP/CP) | — | — | partial | **✓** |
|
|
240
|
-
| Prompt-cache economics | — | partial API only | — | **✓** |
|
|
241
|
-
| Reasoning tokens (o1/R1/Claude thinking) | — | — | — | **✓** |
|
|
242
|
-
| API vs self-host break-even | some | ✓ | — | **✓** |
|
|
243
|
-
| Transparent formulas / open source | mixed | usually no | mixed | **✓** |
|
|
244
|
-
| Cited benchmark evidence per config | rare | rare | ✓ (not planning) | **✓ (in progress)** |
|
|
245
|
-
| Shareable URL per config | — | — | — | **✓** |
|
|
246
|
-
|
|
247
|
-
## Roadmap
|
|
248
|
-
|
|
249
|
-
### Shipped
|
|
250
|
-
- ✅ 35 models, 30 GPUs, 16 quantization formats
|
|
251
|
-
- ✅ Continuous batching, reasoning tokens, prompt caching
|
|
252
|
-
- ✅ TTFT/ITL split, long-context superlinear attention
|
|
253
|
-
- ✅ Long-context capacity planner + topology recommendation
|
|
254
|
-
- ✅ Build-vs-Buy calculator (13 API providers with retired/current status)
|
|
255
|
-
- ✅ Reference catalog (5 sub-tables)
|
|
256
|
-
- ✅ Share URL + localStorage persistence
|
|
257
|
-
- ✅ Dark mode toggle
|
|
258
|
-
- ✅ Plain-English glossary (28 terms with hover tooltips)
|
|
259
|
-
- ✅ OG image + Twitter card + social metadata
|
|
260
|
-
|
|
261
|
-
### Next 30 days
|
|
262
|
-
- ⏳ GitHub Action (`tokcalc/plan` PR comment)
|
|
263
|
-
- ⏳ MCP server (read-only capacity-planning tools for AI agents)
|
|
264
|
-
- ⏳ 3 SEO landing pages (`/compare/h100-vs-h200`, `/gguf-q4-k-m-vs-q5-k-m`, `/vllm-vs-sglang`)
|
|
265
|
-
- ⏳ i18n: Chinese, Japanese, Korean
|
|
266
|
-
|
|
267
|
-
### Next 90 days
|
|
268
|
-
- ⏳ Workload-trace / SLO capacity planner (prompt/output/arrival distributions, p50/p95 TTFT/ITL)
|
|
269
|
-
- ⏳ P/D disaggregation planner (separate prefill + decode pools)
|
|
270
|
-
- ⏳ Cache-aware economics (prefix-sharing distribution, multi-turn/agent traces)
|
|
271
|
-
- ⏳ Engine-aware presets (vLLM / SGLang / TensorRT-LLM / llama.cpp)
|
|
272
|
-
- ⏳ Versioned price + benchmark provenance system
|
|
273
|
-
|
|
274
|
-
### Long-term
|
|
275
|
-
- 🔮 Agentic workflow calculator (multi-turn + tool calls + growing context)
|
|
276
|
-
- 🔮 Multi-LoRA capacity planner (Punica / S-LoRA economics)
|
|
277
|
-
- 🔮 VLM image-token accounting (per-model patch/tile tokenization)
|
|
278
|
-
- 🔮 Embedding model mode (vectors/sec, separate workload)
|
|
279
|
-
- 🔮 Training/fine-tuning estimator (LoRA / QLoRA / full-SFT FLOPs)
|
|
280
|
-
- 🔮 Energy / carbon per million tokens (region-specific grid intensity)
|
|
281
|
-
|
|
282
|
-
## Open core model
|
|
283
|
-
|
|
284
|
-
tokcalc is **open core** — the calculator and catalog are open source; the
|
|
285
|
-
cloud/data/team features are paid.
|
|
286
|
-
|
|
287
|
-
| Asset | License | Notes |
|
|
288
|
-
|---|---|---|
|
|
289
|
-
| Source code | Apache 2.0 | This repo. Free to use, modify, distribute |
|
|
290
|
-
| Model/GPU/quant catalog | CC0 1.0 | Public domain data. Anyone can use, no attribution required |
|
|
291
|
-
| Benchmark provenance data | CC-BY-SA 4.0 | Anyone can use, but must attribute + share-alike |
|
|
292
|
-
| Documentation | CC-BY 4.0 | Attribution required if copied |
|
|
293
|
-
| "tokcalc" name + logo | Trademark | Even without formal registration, common-law rights apply |
|
|
294
|
-
| Cloud SaaS layer | Proprietary | Real-time pricing API, benchmark DB, team workspaces (coming soon) |
|
|
295
|
-
|
|
296
|
-
### Why this structure
|
|
297
|
-
- **Trust**: Open-source formulas build credibility vs opaque competitors
|
|
298
|
-
- **Community**: Contributors can submit models, GPUs, quants, benchmarks
|
|
299
|
-
- **Defensibility**: Trademark + cloud features + URL-share viral loop protect against forks
|
|
300
|
-
- **Revenue**: Cloud tier funds ongoing development + pricing/benchmark data maintenance
|
|
301
|
-
|
|
302
|
-
## Contributing
|
|
303
|
-
|
|
304
|
-
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for:
|
|
305
|
-
|
|
306
|
-
- How to add a model (with HuggingFace config.json as source)
|
|
307
|
-
- How to add a GPU (with critical guardrails for B200/B300 null FP16 fields)
|
|
308
|
-
- How to add a quantization format (with measured file sizes as source)
|
|
309
|
-
- How to submit a benchmark (3-tier confidence model)
|
|
310
|
-
- How to improve a formula (cite the source, no magic numbers)
|
|
311
|
-
|
|
312
|
-
### Most-needed contributions
|
|
313
|
-
- 🟢 New models (Qwen 3, Mistral Large 4, Llama 4 variants as they release)
|
|
314
|
-
- 🟢 New GPUs (B300, AMD MI400, Apple M5 Ultra when shipping)
|
|
315
|
-
- 🟢 New quantization formats (mxFP8, MXFP4, BitNet 2)
|
|
316
|
-
- 🟢 Real benchmark data (run vLLM benchmarks and submit with provenance)
|
|
317
|
-
- 🟢 Translations (especially Chinese, Japanese, Korean)
|
|
318
|
-
|
|
319
|
-
## MCP server — use tokcalc from AI agents
|
|
320
|
-
|
|
321
|
-
tokcalc ships an [MCP (Model Context Protocol)](https://modelcontextprotocol.io) server that lets AI agents (Cursor, Claude Desktop, Cline) call tokcalc during design reviews.
|
|
322
|
-
|
|
323
|
-
### 6 read-only tools
|
|
324
|
-
|
|
325
|
-
| Tool | What it does |
|
|
326
|
-
|---|---|
|
|
327
|
-
| `estimate_capacity` | VRAM/KV/throughput/latency/cost for one config |
|
|
328
|
-
| `compare_gpus` | Ranked GPU comparison for one workload |
|
|
329
|
-
| `recommend_topology` | TP/CP topology recommendation |
|
|
330
|
-
| `estimate_api_vs_self_host` | Break-even analysis |
|
|
331
|
-
| `list_models` | Discover supported model IDs |
|
|
332
|
-
| `list_gpus` | Discover supported GPU IDs |
|
|
333
|
-
|
|
334
|
-
All tools are **read-only** — no side effects, no cloud credentials, no deployments.
|
|
335
|
-
|
|
336
|
-
### Install
|
|
337
|
-
|
|
338
|
-
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
|
|
339
|
-
|
|
340
|
-
```json
|
|
341
|
-
{
|
|
342
|
-
"mcpServers": {
|
|
343
|
-
"tokcalc": {
|
|
344
|
-
"command": "npx",
|
|
345
|
-
"args": ["-y", "@tokcalc/mcp-server"]
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
Or run locally:
|
|
352
|
-
|
|
353
|
-
```bash
|
|
354
|
-
git clone https://github.com/stevecrates489-commits/tokcalc.git
|
|
355
|
-
cd tokcalc
|
|
356
|
-
bun install
|
|
357
|
-
bun mini-services/mcp-server/index.ts
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### Example agent prompt
|
|
361
|
-
|
|
362
|
-
> "I need to serve Llama 3.3 70B at 32K context for 50 concurrent users. What GPU topology do you recommend, and how much will it cost per month?"
|
|
363
|
-
|
|
364
|
-
The agent calls `list_models` → `list_gpus` → `recommend_topology` → `estimate_capacity` → returns a structured plan with VRAM, throughput, latency, cost, and confidence.
|
|
365
|
-
|
|
366
|
-
## Tech stack
|
|
367
|
-
|
|
368
|
-
- **Framework**: Next.js 16 with App Router
|
|
369
|
-
- **Language**: TypeScript 5
|
|
370
|
-
- **Styling**: Tailwind CSS 4 + shadcn/ui (New York)
|
|
371
|
-
- **Charts**: Recharts
|
|
372
|
-
- **State**: React hooks (useState + useEffect + useMemo)
|
|
373
|
-
- **Theme**: next-themes (dark mode default)
|
|
374
|
-
- **Database**: None (pure client-side, no backend required for core features)
|
|
375
|
-
|
|
376
|
-
## Acknowledgments
|
|
377
|
-
|
|
378
|
-
tokcalc builds on the work of:
|
|
379
|
-
|
|
380
|
-
- **vLLM team** — PagedAttention, continuous batching ([arxiv.org/abs/2309.06180](https://arxiv.org/abs/2309.06180))
|
|
381
|
-
- **llama.cpp / ggml-org** — GGUF format and quantization variants
|
|
382
|
-
- **MLPerf / MLCommons** — standardized inference benchmark methodology
|
|
383
|
-
- **Stanford HELM** — efficiency-aware model evaluation framework
|
|
384
|
-
- **Anthropic / OpenAI / Google** — published prompt-caching pricing rules
|
|
385
|
-
- **NVIDIA / AMD / Intel / Google / Groq / Cerebras** — published hardware specs
|
|
386
|
-
|
|
387
|
-
Every formula has a citation. Every model/GPU/quant entry has a source URL
|
|
388
|
-
where available. If you spot an unsourced claim, please open an issue.
|
|
389
|
-
|
|
390
|
-
## Star history
|
|
391
|
-
|
|
392
|
-
[](https://star-history.com/#tokcalc/tokcalc&Date)
|
|
393
|
-
|
|
394
|
-
---
|
|
395
|
-
|
|
396
|
-
<div align="center">
|
|
397
|
-
|
|
398
|
-
**[Live demo](https://tokcalc.dev)** ·
|
|
399
|
-
**[Documentation](https://tokcalc.dev/docs)** ·
|
|
400
|
-
**[Contributing](CONTRIBUTING.md)** ·
|
|
401
|
-
**[License](LICENSE)** ·
|
|
402
|
-
**[Code of Conduct](CODE_OF_CONDUCT.md)**
|
|
403
|
-
|
|
404
|
-
Made with care by the tokcalc community. Apache 2.0 licensed.
|
|
405
|
-
|
|
406
|
-
</div>
|
|
1
|
+
# @tokcalc/mcp-server
|
|
2
|
+
|
|
3
|
+
**LLM serving capacity planner for AI agents.**
|
|
4
|
+
|
|
5
|
+
Open-source MCP (Model Context Protocol) server that lets AI agents (Cursor, Claude Desktop, Cline) estimate LLM serving capacity — model fit, KV cache, throughput, latency, multi-GPU topology, and cost.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | What it does |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `estimate_capacity` | VRAM/KV/throughput/latency/cost for one config |
|
|
12
|
+
| `compare_gpus` | Ranked GPU comparison for one workload |
|
|
13
|
+
| `recommend_topology` | TP/CP topology recommendation |
|
|
14
|
+
| `estimate_api_vs_self_host` | Break-even analysis |
|
|
15
|
+
| `list_models` | Discover supported model IDs (35 models) |
|
|
16
|
+
| `list_gpus` | Discover supported GPU IDs (30 GPUs) |
|
|
17
|
+
|
|
18
|
+
All tools are **read-only** — no side effects, no cloud credentials, no deployments.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
### Claude Desktop
|
|
23
|
+
|
|
24
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"tokcalc": {
|
|
30
|
+
"command": "npx",
|
|
31
|
+
"args": ["-y", "@tokcalc/mcp-server"]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Restart Claude Desktop. The `tokcalc` server will be available as an MCP tool source.
|
|
38
|
+
|
|
39
|
+
### Cursor
|
|
40
|
+
|
|
41
|
+
Add to `.cursor/mcp.json` in your project:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"tokcalc": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["-y", "@tokcalc/mcp-server"]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Cline (VS Code)
|
|
55
|
+
|
|
56
|
+
Add the same config to Cline's MCP settings.
|
|
57
|
+
|
|
58
|
+
## Example prompts
|
|
59
|
+
|
|
60
|
+
Ask your AI agent:
|
|
61
|
+
|
|
62
|
+
> "I need to serve Llama 3.3 70B at 32K context for 50 concurrent users. What GPU topology do you recommend, and how much will it cost per month?"
|
|
63
|
+
|
|
64
|
+
> "Compare H100 vs H200 for serving Qwen 2.5 72B in FP8 with continuous batching."
|
|
65
|
+
|
|
66
|
+
> "At what daily request volume does self-hosting Llama 70B on H200 beat the GPT-4o API?"
|
|
67
|
+
|
|
68
|
+
The agent calls `list_models` → `list_gpus` → `recommend_topology` → `estimate_capacity` and returns a structured plan with throughput ranges, latency, VRAM, cost, and confidence levels.
|
|
69
|
+
|
|
70
|
+
## Supported models (35)
|
|
71
|
+
|
|
72
|
+
Llama 3/3.1/3.3, Llama 4 Scout/Maverick, Mistral 7B, Mixtral 8x7B/8x22B, Mistral Large 3, Pixtral 12B, Codestral, Qwen 2/2.5/3 (incl. MoE + VL), DeepSeek V3/R1/Coder V2, Gemma 2, Phi-3/4, SmolLM2, Falcon 3, OLMo 2, BGE-M3, E5, GTE.
|
|
73
|
+
|
|
74
|
+
## Supported GPUs (30)
|
|
75
|
+
|
|
76
|
+
NVIDIA H100/H200/B200/B300, A100, L40S, L4, T4, V100, RTX 4090/3090/5090, RTX PRO 6000 Blackwell, AMD MI300X/MI325X, Intel Gaudi 3, Google TPU v5p/Trillium, Groq LPU, Cerebras CS-3, Apple M2/M3/M4 Ultra/Max.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
Apache 2.0 — same as the main tokcalc project.
|
|
81
|
+
|
|
82
|
+
## Links
|
|
83
|
+
|
|
84
|
+
- [Live calculator](https://tokcalc.vercel.app)
|
|
85
|
+
- [GitHub](https://github.com/stevecrates489-commits/tokcalc)
|
|
86
|
+
- [CONTRIBUTING](https://github.com/stevecrates489-commits/tokcalc/blob/main/CONTRIBUTING.md)
|