@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.
Files changed (192) hide show
  1. package/README.md +86 -406
  2. package/dist/index.js +21285 -0
  3. package/package.json +34 -91
  4. package/.zscripts/build.sh +0 -175
  5. package/.zscripts/database-runtime-build.sh +0 -33
  6. package/.zscripts/dev.pid +0 -1
  7. package/.zscripts/dev.sh +0 -154
  8. package/.zscripts/mini-services-build.sh +0 -78
  9. package/.zscripts/mini-services-install.sh +0 -65
  10. package/.zscripts/mini-services-start.sh +0 -123
  11. package/.zscripts/python-runtime-build.sh +0 -120
  12. package/.zscripts/start.sh +0 -145
  13. package/CAPACITY_STUDY.md +0 -283
  14. package/CODE_OF_CONDUCT.md +0 -55
  15. package/CONTRIBUTING.md +0 -177
  16. package/Caddyfile +0 -23
  17. package/LICENSE +0 -204
  18. package/bun.lock +0 -1965
  19. package/components.json +0 -21
  20. package/db/custom.db +0 -0
  21. package/download/README.md +0 -1
  22. package/download/tokcalc-dark-calculator.png +0 -0
  23. package/download/tokcalc-dark-default.png +0 -0
  24. package/download/tokcalc-demo.webm +0 -0
  25. package/download/tokcalc-github-link.png +0 -0
  26. package/download/tokcalc-hydration-fixed.png +0 -0
  27. package/download/tokcalc-issue-resolved.png +0 -0
  28. package/download/tokcalc-light-mode.png +0 -0
  29. package/download/tokcalc-light-reference.png +0 -0
  30. package/download/tokcalc-long-context-qwen.png +0 -0
  31. package/download/tokcalc-long-context.png +0 -0
  32. package/download/tokcalc-og-image-preview.png +0 -0
  33. package/download/tokcalc-phase2-3.png +0 -0
  34. package/download/tokcalc-plain-english.png +0 -0
  35. package/download/tokcalc-preview.png +0 -0
  36. package/download/tokcalc-share-bvb.png +0 -0
  37. package/download/tokcalc-share-feature.png +0 -0
  38. package/download/tokcalc-tab-build-vs-buy.png +0 -0
  39. package/download/tokcalc-tab-calculator.png +0 -0
  40. package/download/tokcalc-tab-reference.png +0 -0
  41. package/eslint.config.mjs +0 -50
  42. package/examples/websocket/frontend.tsx +0 -196
  43. package/examples/websocket/server.ts +0 -138
  44. package/mini-services/.gitkeep +0 -0
  45. package/mini-services/mcp-server/README.md +0 -86
  46. package/mini-services/mcp-server/bun.lock +0 -202
  47. package/mini-services/mcp-server/index.ts +0 -504
  48. package/mini-services/mcp-server/package.json +0 -40
  49. package/next.config.ts +0 -12
  50. package/postcss.config.mjs +0 -5
  51. package/prisma/schema.prisma +0 -32
  52. package/public/google6f58ca6be85fa903.html +0 -1
  53. package/public/logo.svg +0 -29
  54. package/public/manifest.json +0 -51
  55. package/public/og-icon-256.png +0 -0
  56. package/public/og.png +0 -0
  57. package/public/robots.txt +0 -25
  58. package/public/sitemap.xml +0 -23
  59. package/public/tokcalc-demo.gif +0 -0
  60. package/scripts/og-template.html +0 -120
  61. package/scripts/render-og.mjs +0 -43
  62. package/server.json +0 -21
  63. package/src/app/api/pricing/aws/route.ts +0 -186
  64. package/src/app/api/pricing/azure/route.ts +0 -168
  65. package/src/app/api/pricing/gcp/route.ts +0 -230
  66. package/src/app/api/pricing/vast-ai/route.ts +0 -164
  67. package/src/app/api/route.ts +0 -5
  68. package/src/app/compare/h100-vs-h200/layout.tsx +0 -30
  69. package/src/app/compare/h100-vs-h200/page.tsx +0 -328
  70. package/src/app/globals.css +0 -122
  71. package/src/app/layout.tsx +0 -276
  72. package/src/app/page.tsx +0 -2670
  73. package/src/components/azure-live-pricing.tsx +0 -185
  74. package/src/components/benchmark-import.tsx +0 -340
  75. package/src/components/confidence-badge.tsx +0 -116
  76. package/src/components/live-pricing-comparison.tsx +0 -241
  77. package/src/components/theme-provider.tsx +0 -11
  78. package/src/components/theme-toggle.tsx +0 -55
  79. package/src/components/ui/accordion.tsx +0 -66
  80. package/src/components/ui/alert-dialog.tsx +0 -157
  81. package/src/components/ui/alert.tsx +0 -66
  82. package/src/components/ui/aspect-ratio.tsx +0 -11
  83. package/src/components/ui/avatar.tsx +0 -53
  84. package/src/components/ui/badge.tsx +0 -46
  85. package/src/components/ui/breadcrumb.tsx +0 -109
  86. package/src/components/ui/button.tsx +0 -59
  87. package/src/components/ui/calendar.tsx +0 -213
  88. package/src/components/ui/card.tsx +0 -92
  89. package/src/components/ui/carousel.tsx +0 -241
  90. package/src/components/ui/chart.tsx +0 -353
  91. package/src/components/ui/checkbox.tsx +0 -32
  92. package/src/components/ui/collapsible.tsx +0 -33
  93. package/src/components/ui/command.tsx +0 -184
  94. package/src/components/ui/context-menu.tsx +0 -252
  95. package/src/components/ui/dialog.tsx +0 -143
  96. package/src/components/ui/drawer.tsx +0 -135
  97. package/src/components/ui/dropdown-menu.tsx +0 -257
  98. package/src/components/ui/form.tsx +0 -167
  99. package/src/components/ui/hover-card.tsx +0 -44
  100. package/src/components/ui/input-otp.tsx +0 -77
  101. package/src/components/ui/input.tsx +0 -21
  102. package/src/components/ui/label.tsx +0 -24
  103. package/src/components/ui/menubar.tsx +0 -276
  104. package/src/components/ui/navigation-menu.tsx +0 -168
  105. package/src/components/ui/pagination.tsx +0 -127
  106. package/src/components/ui/popover.tsx +0 -48
  107. package/src/components/ui/progress.tsx +0 -31
  108. package/src/components/ui/radio-group.tsx +0 -45
  109. package/src/components/ui/resizable.tsx +0 -56
  110. package/src/components/ui/scroll-area.tsx +0 -58
  111. package/src/components/ui/select.tsx +0 -185
  112. package/src/components/ui/separator.tsx +0 -28
  113. package/src/components/ui/sheet.tsx +0 -139
  114. package/src/components/ui/sidebar.tsx +0 -726
  115. package/src/components/ui/skeleton.tsx +0 -13
  116. package/src/components/ui/slider.tsx +0 -63
  117. package/src/components/ui/sonner.tsx +0 -25
  118. package/src/components/ui/switch.tsx +0 -31
  119. package/src/components/ui/table.tsx +0 -116
  120. package/src/components/ui/tabs.tsx +0 -66
  121. package/src/components/ui/textarea.tsx +0 -18
  122. package/src/components/ui/toast.tsx +0 -129
  123. package/src/components/ui/toaster.tsx +0 -35
  124. package/src/components/ui/toggle-group.tsx +0 -73
  125. package/src/components/ui/toggle.tsx +0 -47
  126. package/src/components/ui/tooltip.tsx +0 -61
  127. package/src/components/vast-ai-live-pricing.tsx +0 -176
  128. package/src/hooks/use-mobile.ts +0 -19
  129. package/src/hooks/use-toast.ts +0 -194
  130. package/src/lib/benchmark-parser-sglang.ts +0 -150
  131. package/src/lib/benchmark-parser-tokcalc.ts +0 -247
  132. package/src/lib/benchmark-parser-trtllm.ts +0 -152
  133. package/src/lib/benchmark-parser-vllm.ts +0 -198
  134. package/src/lib/benchmark-schema.ts +0 -263
  135. package/src/lib/db.ts +0 -13
  136. package/src/lib/engine-presets.ts +0 -183
  137. package/src/lib/price-schema.ts +0 -141
  138. package/src/lib/token-calc.ts +0 -808
  139. package/src/lib/track.ts +0 -31
  140. package/src/lib/url-state.ts +0 -256
  141. package/src/lib/utils.ts +0 -6
  142. package/tailwind.config.ts +0 -64
  143. package/tests/database-runtime-build.sh +0 -75
  144. package/tests/python-runtime-build.sh +0 -64
  145. package/tests/python-runtime-container.sh +0 -31
  146. package/tool-results/bash_1789888171144_2c5381860539.txt +0 -161
  147. package/tool-results/bash_1789888175925_49c53ba3c61b.txt +0 -191
  148. package/tool-results/bash_1789888181202_49c53ba3c61b.txt +0 -191
  149. package/tool-results/bash_1789888195219_4a86a5c91411.txt +0 -200
  150. package/tool-results/bash_1789888203128_6cca13c71b47.txt +0 -199
  151. package/tool-results/bash_1789929256963_2a52aff0d0a8.txt +0 -160
  152. package/tool-results/read_1789888151021_69f58eec6a5b.txt +0 -653
  153. package/tool-results/read_1789888153837_1d3a8bfc2a94.txt +0 -653
  154. package/tool-results/read_1789888163087_ccc406d47505.txt +0 -122
  155. package/tool-results/read_1789888167347_67d1d7c9830a.txt +0 -122
  156. package/tool-results/read_1789929252529_d90e8f383a25.txt +0 -285
  157. package/tsconfig.json +0 -42
  158. package/upload/Pasted Content_1789887800864.txt +0 -652
  159. package/upload/Pasted Content_1789887909561.txt +0 -652
  160. package/upload/Pasted Content_1789887918428.txt +0 -652
  161. package/upload/Pasted Content_1789887959420.txt +0 -652
  162. package/upload/Pasted Content_1789888020485.txt +0 -652
  163. package/upload/Pasted Content_1789888058079.txt +0 -652
  164. package/upload/Pasted Content_1789888885033.txt +0 -686
  165. package/upload/Pasted Content_1789928912741.txt +0 -285
  166. package/upload/Pasted Content_1789928938402.txt +0 -285
  167. package/upload/Pasted Content_1789929160389.txt +0 -285
  168. package/upload/Pasted Content_1789929176660.txt +0 -285
  169. package/upload/issue_vision.json +0 -28
  170. package/upload/pasted_image_1789883175209.png +0 -0
  171. package/upload/pasted_image_1789899056690.png +0 -0
  172. package/upload/pasted_image_1789900371483.png +0 -0
  173. package/upload/pasted_image_1789900472823.png +0 -0
  174. package/upload/pasted_image_1789900490374.png +0 -0
  175. package/upload/pasted_image_1789900585552.png +0 -0
  176. package/upload/pasted_image_1789900606519.png +0 -0
  177. package/upload/pasted_image_1789901598705.png +0 -0
  178. package/upload/pasted_image_1789901613545.png +0 -0
  179. package/upload/pasted_image_1789978382674.png +0 -0
  180. package/upload/pasted_image_1789978392749.png +0 -0
  181. package/upload/pasted_image_1789978474879.png +0 -0
  182. package/upload/pasted_image_1789978523652.png +0 -0
  183. package/upload/pasted_image_1789984219089.png +0 -0
  184. package/upload/pasted_image_1789984491896.png +0 -0
  185. package/upload/pasted_image_1789985017950.png +0 -0
  186. package/upload/pasted_image_1789985036765.png +0 -0
  187. package/upload/pasted_image_1789985049848.png +0 -0
  188. package/upload/pasted_image_1790002427833.png +0 -0
  189. package/upload/pasted_image_1790002659944.png +0 -0
  190. package/upload/pasted_image_1790037038476.png +0 -0
  191. package/upload/screenshot_analysis.json +0 -28
  192. package/upload/vision_output.json +0 -28
package/README.md CHANGED
@@ -1,406 +1,86 @@
1
- <div align="center">
2
-
3
- # tokcalc
4
-
5
- ### The open-source LLM serving capacity planner
6
-
7
- **Plan your LLM deployment before you rent the GPUs.**
8
-
9
- [![Live demo](https://img.shields.io/badge/live-demo-10b981?style=flat-square)](https://tokcalc.dev)
10
- [![License: Apache 2.0](https://img.shields.io/badge/license-Apache_2.0-blue?style=flat-square)](LICENSE)
11
- [![PRs welcome](https://img.shields.io/badge/PRs-welcome-10b981?style=flat-square)](CONTRIBUTING.md)
12
- [![Made with Next.js](https://img.shields.io/badge/made_with-Next.js_16-black?style=flat-square)](https://nextjs.org)
13
-
14
- </div>
15
-
16
- ---
17
-
18
- <div align="center">
19
-
20
- ![tokcalc demo](/public/tokcalc-demo.gif)
21
-
22
- *Switch model → multi-GPU → long-context capacity planner → Build vs Buy → Reference catalog*
23
-
24
- </div>
25
-
26
- ---
27
-
28
- tokcalc turns your LLM traffic, context length, latency SLOs, cache behavior,
29
- and model choice into a **defensible serving topology and cost plan** —
30
- with transparent formulas and cited benchmarks.
31
-
32
- It's the engineering-grade pre-deployment decision layer for LLM inference.
33
- Not another static "tokens per second" calculator.
34
-
35
- ## Try it now
36
-
37
- **[tokcalc.dev](https://tokcalc.dev)** — no signup, no tracking, no paywall.
38
-
39
- Pick a model, a GPU, and a workload. Get an instant capacity plan:
40
-
41
- - Generation speed (tok/s)
42
- - Time-to-first-token (TTFT) + inter-token latency (ITL)
43
- - VRAM budget with KV-cache sizing
44
- - Multi-GPU topology recommendation (Single GPU → TP×2/4/8 → Context Parallel)
45
- - Monthly cost + break-even vs API pricing
46
- - **Shareable URL** — your config encoded in the URL hash, send to colleagues
47
-
48
- ## Why tokcalc?
49
-
50
- The market has dozens of "tokens per second" calculators and self-host-vs-API
51
- break-even tools (induwara.lk, gigagpu, kickllm, cloudparity, curlscape,
52
- profitable.ai). None of them are unified capacity planners.
53
-
54
- ### What tokcalc answers that competitors can't
55
-
56
- > *"Can I serve Qwen 2.5 72B at 128K context on 2× H100 with 20 concurrent users?"*
57
-
58
- > *"How many H200s do I need for 1,000 req/min with P95 TTFT < 2s?"*
59
-
60
- > *"Does FP8 or AWQ save more money once quality, KV cache, and engine support are included?"*
61
-
62
- > *"At what daily volume does an H100 beat GPT-4o pricing?"*
63
-
64
- > *"What happens to cost and latency if an agent makes 8 model calls, has 3 tool calls, and its context grows by 5K tokens each turn?"*
65
-
66
- > *"Would prefix caching, continuous batching, or PD disaggregation save more for this workload?"*
67
-
68
- ## Features
69
-
70
- ### Calculator tab
71
-
72
- | Feature | What it computes |
73
- |---|---|
74
- | **Model fit / VRAM** | Will the model + KV cache fit in the GPU's memory? |
75
- | **Throughput** | Decode tok/s (per-stream) + aggregate (batched) + prefill tok/s |
76
- | **Latency split** | Time-to-first-token (= prefill) + inter-token latency (= decode) |
77
- | **Continuous batching** | User-tunable 1.0–4× multiplier (cited 1.5–4× SOSP range) |
78
- | **Reasoning tokens** | Hidden reasoning budget added to billed output (o1 / R1 / Claude thinking) |
79
- | **Prompt caching** | Self-hosted vLLM APC + Anthropic 5m/1h TTL + OpenAI 50%-off cached tokens |
80
- | **Speculative decoding** | User-tunable 1.2–4× boost factor |
81
- | **Multi-GPU TP** | 1× → 8× tensor parallel with NVLink efficiency factor |
82
- | **Long-context capacity** | KV memory + max concurrency + prefill time at 4K → 1M context |
83
- | **Topology recommendation** | Single GPU → TP×2 → TP×4 → TP×8 → TP×8 + Context Parallel (RingAttention) |
84
- | **Cost economics** | GPU $/hr → $/M output tokens → $/request → monthly cost |
85
-
86
- ### Build vs Buy tab
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
- [![Star History Chart](https://api.star-history.com/svg?repos=tokcalc/tokcalc&type=Date)](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)