@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
@@ -1,55 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our pledge
4
-
5
- We pledge to make participation in our community a harassment-free experience
6
- for everyone, regardless of age, body size, visible or invisible disability,
7
- ethnicity, sex characteristics, gender identity and expression, level of
8
- experience, education, socio-economic status, nationality, personal
9
- appearance, race, religion, or sexual identity and orientation.
10
-
11
- We pledge to act and interact in ways that contribute to an open, welcoming,
12
- diverse, inclusive, and healthy community.
13
-
14
- ## Our standards
15
-
16
- Examples of behavior that contributes to a positive environment:
17
-
18
- - Demonstrating empathy and kindness toward other people
19
- - Being respectful of differing opinions, viewpoints, and experiences
20
- - Giving and gracefully accepting constructive feedback
21
- - Accepting responsibility and apologizing to those affected by our mistakes
22
- - Focusing on what is best for the overall community
23
-
24
- Examples of unacceptable behavior:
25
-
26
- - The use of sexualized language or imagery, and sexual attention or advances
27
- - Trolling, insulting or derogatory comments, and personal or political attacks
28
- - Public or private harassment
29
- - Publishing others' private information without explicit permission
30
- - Other conduct which could reasonably be considered inappropriate in a professional setting
31
-
32
- ## Enforcement responsibilities
33
-
34
- Community leaders are responsible for clarifying and enforcing standards of
35
- acceptable behavior and will take appropriate and fair corrective action in
36
- response to any behavior they deem inappropriate, threatening, offensive, or
37
- harmful.
38
-
39
- ## Scope
40
-
41
- This Code of Conduct applies within all community spaces and applies when an
42
- individual is officially representing the community in public spaces.
43
-
44
- ## Enforcement
45
-
46
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
47
- reported to the community leaders responsible for enforcement at
48
- **conduct@tokcalc.dev**. All complaints will be reviewed and investigated
49
- promptly and fairly.
50
-
51
- ## Attribution
52
-
53
- This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
54
- version 2.1, available at
55
- [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
package/CONTRIBUTING.md DELETED
@@ -1,177 +0,0 @@
1
- # Contributing to tokcalc
2
-
3
- First of all — **thank you** for considering a contribution. tokcalc is a community-maintained capacity planner and every contribution makes the LLM serving ecosystem more transparent.
4
-
5
- This document explains how to add models, GPUs, quantization formats, and benchmark data. The bar for acceptance is **source-cited, defensible data** — not vibes.
6
-
7
- ## Code of conduct
8
-
9
- Be kind. Be precise. Disclose provenance. Don't market. Don't fabricate.
10
-
11
- ## Quick ways to contribute
12
-
13
- | Contribution | Difficulty | Where to look |
14
- |---|---|---|
15
- | Add a missing model | Easy | `src/lib/token-calc.ts` → `MODELS` array |
16
- | Add a missing GPU | Easy | `src/lib/token-calc.ts` → `GPUS` array |
17
- | Add a quantization format | Easy | `src/lib/token-calc.ts` → `QUANTIZATIONS` array |
18
- | Fix a typo / UI bug | Trivial | Anywhere in `src/app/page.tsx` |
19
- | Improve a formula | Hard | `calculate()` in `src/lib/token-calc.ts` |
20
- | Submit a benchmark | Medium | Open an issue with the schema below |
21
-
22
- ## How to add a model
23
-
24
- Add a row to the `MODELS` array in [`src/lib/token-calc.ts`](src/lib/token-calc.ts). The schema:
25
-
26
- ```typescript
27
- {
28
- id: "llama3-15b", // unique, lowercase, no spaces
29
- name: "Llama 3.2 15B", // human-readable, includes variant
30
- family: "Llama", // for dropdown grouping
31
- category: "text", // "text" | "vlm" | "embedding" | "code" | "reasoning"
32
- paramsB: 15.0, // TOTAL params in billions (e.g., 671 for DeepSeek V3 MoE)
33
- activeParamsB: 15.0, // ACTIVE params per token (for MoE; = paramsB for dense)
34
- layers: 64, // num_hidden_layers from config.json
35
- hiddenDim: 5120, // hidden_size from config.json
36
- qHeads: 40, // num_attention_heads
37
- kvHeads: 8, // num_key_value_heads (for GQA)
38
- headDim: 128, // head_dim (or hidden_size / num_attention_heads)
39
- vocabSize: 128256, // vocab_size
40
- maxContext: 131072, // max_position_embeddings
41
- isMoE: false, // true if Mixture-of-Experts
42
- }
43
- ```
44
-
45
- ### Source requirements (mandatory)
46
- - **Architecture fields** (`layers`, `hiddenDim`, `qHeads`, `kvHeads`, `headDim`, `vocabSize`, `maxContext`) MUST come from the model's `config.json` on HuggingFace — not from blog posts or third-party summaries.
47
- - **Total/active params** for MoE models MUST come from the official release announcement or model card.
48
- - Add a comment with the source URL:
49
- ```typescript
50
- // Refs: https://huggingface.co/meta-llama/Llama-3.2-15B
51
- ```
52
-
53
- ### Don't fabricate
54
- - If a field isn't published (e.g., DeepSeek V3's exact architecture), **leave it as a placeholder and add a TODO comment**, or omit the entry entirely. Don't guess.
55
- - For announced-but-unreleased models (e.g., Llama 4 Behemoth), mark the row with `// announced — not yet released` and only add if there's an official model card or config.
56
-
57
- ## How to add a GPU
58
-
59
- Add a row to the `GPUS` array. The schema:
60
-
61
- ```typescript
62
- {
63
- id: "rtx-5090",
64
- name: "RTX 5090 32GB",
65
- vendor: "NVIDIA", // "NVIDIA" | "AMD" | "Intel" | "Google" | "Apple" | "Groq" | "Cerebras" | ...
66
- category: "consumer", // "datacenter" | "workstation" | "consumer" | "mac" | "tpu" | "lpu" | "wse" | "legacy"
67
- memBandwidthGbps: 1792, // HBM/unified memory bandwidth in GB/s
68
- flopsTflops: 105, // FP16/BF16 dense TFLOPS. Use `null` if vendor doesn't publish (e.g., B200)
69
- vramGb: 32, // VRAM in GB
70
- nvlinkGbps: 0, // 0 if no NVLink
71
- usdPerHour: 0.50, // Typical cloud $/hr; `null` if quote-only
72
- year: 2025, // Release year
73
- note: "Optional note about caveats", // e.g., "ROCm; performance depends on ROCm version"
74
- sourceUrl: "https://www.nvidia.com/en-us/geforce/graphics-cards/50-series",
75
- }
76
- ```
77
-
78
- ### Critical guardrails (per research brief)
79
- - **Never use FP4/FP8/sparse FLOPS as FP16 dense**. NVIDIA Blackwell B200/B300 only publishes FP4/FP8 specs — set `flopsTflops: null` and add a note. The calc engine handles this gracefully with a conservative fallback.
80
- - **Apple Silicon unified memory ≠ GPU VRAM**. Bandwidth figures are accurate but thermal behavior differs. Always include a `note` for Apple.
81
- - **Cloud $/hr is approximate + region-specific**. Use `null` for "quote required". Add a comment with the source URL.
82
-
83
- ## How to add a quantization format
84
-
85
- Add a row to the `QUANTIZATIONS` array. The schema:
86
-
87
- ```typescript
88
- {
89
- id: "gguf-q4km",
90
- label: "GGUF Q4_K_M",
91
- bytesPerParam: 0.55, // EFFECTIVE bytes per param (averaged across tensor mix)
92
- efficiency: 0.90, // Dequant overhead multiplier. 1.0 = no overhead, 0.85 = 15% slower
93
- // >1.0 means FASTER than FP16 (e.g., FP8 on H100 = 1.5)
94
- description: "Recommended sweet spot for local Llama/Mistral on consumer GPUs.",
95
- family: "gguf", // "float" | "gguf" | "gptq" | "awq" | "exl2" | "fp8" | "nvfp4"
96
- useCase: "Recommended for local inference", // Optional
97
- }
98
- ```
99
-
100
- ### Source requirements
101
- - For GGUF variants, use measured file sizes from the [llama.cpp quantize README](https://github.com/ggml-org/llama.cpp/blob/master/tools/quantize/README.md) or from actual `.gguf` files on HuggingFace.
102
- - For `efficiency`, cite a benchmark source if possible. Don't invent numbers.
103
-
104
- ## How to submit a benchmark
105
-
106
- We're building a benchmark provenance database. To submit a benchmark, open an issue with this template:
107
-
108
- ```markdown
109
- **Model:** DeepSeek V3 671B (MoE)
110
- **Quantization:** FP8
111
- **GPU:** 8× H100 SXM5 80GB
112
- **Engine:** vLLM v0.29.0
113
- **Configuration:** `--max-num-seqs=256 --max-num-batched-tokens=8192 --tensor-parallel-size=8`
114
- **Workload:**
115
- - Input distribution: 4096 mean / 95th percentile 8192 tokens
116
- - Output: 512 mean / 95th percentile 1024 tokens
117
- - Concurrency: 256
118
- - QPS: 18
119
-
120
- **Measured:**
121
- - Throughput (output tok/s, aggregate): 412
122
- - TTFT p50: 220 ms
123
- - TTFT p95: 580 ms
124
- - ITL p50: 24 ms
125
- - ITL p95: 38 ms
126
-
127
- **Source URL:** https://github.com/vllm-project/vllm/issues/12345
128
- **Methodology:** vLLM `benchmark_serving.py` with 1000 requests
129
- **Date:** 2026-09-21
130
- **Submitter:** @yourhandle
131
- ```
132
-
133
- ### Confidence tiers
134
- 1. **Tier 1**: Official vLLM/SGLang/TensorRT-LLM benchmarks, MLPerf submissions
135
- 2. **Tier 2**: Reproducible benchmark runs (you ran it yourself with documented config)
136
- 3. **Tier 3**: Community observations (less rigorous, clearly labeled)
137
-
138
- All three are accepted, but they're displayed differently in the UI.
139
-
140
- ## How to improve a formula
141
-
142
- The math lives in `calculate()` in `src/lib/token-calc.ts`. Every formula has a comment citing the source.
143
-
144
- When improving a formula:
145
- 1. Open an issue first describing the problem + proposed fix
146
- 2. Cite the source (paper, blog, official docs)
147
- 3. Don't introduce "magic numbers" without justification
148
- 4. Update the comments to reflect the new source
149
- 5. Test against benchmark data if available
150
-
151
- ## Development setup
152
-
153
- ```bash
154
- git clone https://github.com/tokcalc/tokcalc.git
155
- cd tokcalc
156
- bun install
157
- bun run dev
158
- ```
159
-
160
- Open `http://localhost:3000`. Make changes. Verify with `bun run lint`.
161
-
162
- ## PR checklist
163
-
164
- Before opening a PR:
165
- - [ ] `bun run lint` passes (warnings OK, errors not)
166
- - [ ] All new model/GPU/quant entries have a source URL in a comment
167
- - [ ] No fabricated data — leave `null` for unknown fields
168
- - [ ] UI changes verified in both light and dark mode
169
- - [ ] Description explains **why**, not just **what**
170
- - [ ] No marketing language ("revolutionary", "the first ever", etc.)
171
- - [ ] No console.log statements left behind
172
-
173
- ## License
174
-
175
- By contributing, you agree that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE)).
176
-
177
- For benchmark data contributions, you agree they'll be licensed under CC-BY-SA 4.0 (attribution + share-alike) — this protects the community's data investment.
package/Caddyfile DELETED
@@ -1,23 +0,0 @@
1
- :81 {
2
- @transform_port_query {
3
- query XTransformPort=*
4
- }
5
-
6
- handle @transform_port_query {
7
- reverse_proxy localhost:{query.XTransformPort} {
8
- header_up Host {host}
9
- header_up X-Forwarded-For {remote_host}
10
- header_up X-Forwarded-Proto {scheme}
11
- header_up X-Real-IP {remote_host}
12
- }
13
- }
14
-
15
- handle {
16
- reverse_proxy localhost:3000 {
17
- header_up Host {host}
18
- header_up X-Forwarded-For {remote_host}
19
- header_up X-Forwarded-Proto {scheme}
20
- header_up X-Real-IP {remote_host}
21
- }
22
- }
23
- }
package/LICENSE DELETED
@@ -1,204 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or Derivative
95
- Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for describing the origin of the Work and
141
- reproducing the content of the NOTICE file. For the avoidance of
142
- doubt, the "tokcalc" name and logo are trademarks of the project
143
- maintainers and may not be used to endorse or promote products
144
- derived from this software without specific prior written permission.
145
-
146
- 7. Disclaimer of Warranty. Unless required by applicable law or
147
- agreed to in writing, Licensor provides the Work (and each
148
- Contributor provides its Contributions) on an "AS IS" BASIS,
149
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
- implied, including, without limitation, any warranties or conditions
151
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
- PARTICULAR PURPOSE. You are solely responsible for determining the
153
- appropriateness of using or redistributing the Work and assume any
154
- risks associated with Your exercise of permissions under this License.
155
-
156
- 8. Limitation of Liability. In no event and under no legal theory,
157
- whether in tort (including negligence), contract, or otherwise,
158
- unless required by applicable law (such as deliberate and grossly
159
- negligent acts) or agreed to in writing, shall any Contributor be
160
- liable to You for damages, including any direct, indirect, special,
161
- incidental, or consequential damages of any character arising as a
162
- result of this License or out of the use or inability to use the
163
- Work (including but not limited to damages for loss of goodwill,
164
- work stoppage, computer failure or malfunction, or any and all
165
- other commercial damages or losses), even if such Contributor
166
- has been advised of the possibility of such damages.
167
-
168
- 9. Accepting Warranty or Additional Liability. While redistributing
169
- the Work or Derivative Works thereof, You may choose to offer,
170
- and charge a fee for, acceptance of support, warranty, indemnity,
171
- or other liability obligations and/or rights consistent with this
172
- License. However, in accepting such obligations, You may act only
173
- on Your own behalf and on Your sole responsibility, not on behalf
174
- of any other Contributor, and only if You agree to indemnify,
175
- defend, and hold each Contributor harmless for any liability
176
- incurred by, or claims asserted against, such Contributor by reason
177
- of your accepting any such warranty or additional liability.
178
-
179
- END OF TERMS AND CONDITIONS
180
-
181
- APPENDIX: How to apply the Apache License to your work.
182
-
183
- To apply the Apache License to your work, attach the following
184
- boilerplate notice, with the fields enclosed by brackets "[]"
185
- replaced with your own identifying information. (Don't include
186
- the brackets!) The text should be enclosed in the appropriate
187
- comment syntax for the file format. We also recommend that a
188
- file or class name and description of purpose be included on the
189
- same "printed page" as the copyright notice for easier
190
- identification within third-party archives.
191
-
192
- Copyright 2026 tokcalc
193
-
194
- Licensed under the Apache License, Version 2.0 (the "License");
195
- you may not use this file except in compliance with the License.
196
- You may obtain a copy of the License at
197
-
198
- http://www.apache.org/licenses/LICENSE-2.0
199
-
200
- Unless required by applicable law or agreed to in writing, software
201
- distributed under the License is distributed on an "AS IS" BASIS,
202
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
203
- implied. See the License for the specific language governing permissions
204
- and limitations under the License.