@tokcalc/mcp-server 0.1.1 → 0.1.3
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/.zscripts/build.sh +175 -0
- package/.zscripts/database-runtime-build.sh +33 -0
- package/.zscripts/dev.pid +1 -0
- package/.zscripts/dev.sh +154 -0
- package/.zscripts/mini-services-build.sh +78 -0
- package/.zscripts/mini-services-install.sh +65 -0
- package/.zscripts/mini-services-start.sh +123 -0
- package/.zscripts/python-runtime-build.sh +120 -0
- package/.zscripts/start.sh +145 -0
- package/CAPACITY_STUDY.md +283 -0
- package/CODE_OF_CONDUCT.md +55 -0
- package/CONTRIBUTING.md +177 -0
- package/Caddyfile +23 -0
- package/LICENSE +204 -0
- package/README.md +406 -86
- package/bun.lock +1965 -0
- package/components.json +21 -0
- package/db/custom.db +0 -0
- package/download/README.md +1 -0
- 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 +50 -0
- package/examples/websocket/frontend.tsx +196 -0
- package/examples/websocket/server.ts +138 -0
- package/mini-services/.gitkeep +0 -0
- package/mini-services/mcp-server/README.md +86 -0
- package/mini-services/mcp-server/bun.lock +202 -0
- package/mini-services/mcp-server/index.ts +504 -0
- package/mini-services/mcp-server/package.json +40 -0
- package/next.config.ts +12 -0
- package/package.json +92 -35
- package/postcss.config.mjs +5 -0
- package/prisma/schema.prisma +32 -0
- package/public/google6f58ca6be85fa903.html +1 -0
- package/public/logo.svg +29 -0
- package/public/manifest.json +51 -0
- package/public/og-icon-256.png +0 -0
- package/public/og.png +0 -0
- package/public/robots.txt +25 -0
- package/public/sitemap.xml +23 -0
- package/public/tokcalc-demo.gif +0 -0
- package/scripts/og-template.html +120 -0
- package/scripts/render-og.mjs +43 -0
- package/server.json +21 -0
- package/src/app/api/pricing/aws/route.ts +186 -0
- package/src/app/api/pricing/azure/route.ts +168 -0
- package/src/app/api/pricing/gcp/route.ts +230 -0
- package/src/app/api/pricing/vast-ai/route.ts +164 -0
- package/src/app/api/route.ts +5 -0
- package/src/app/compare/h100-vs-h200/layout.tsx +30 -0
- package/src/app/compare/h100-vs-h200/page.tsx +328 -0
- package/src/app/globals.css +122 -0
- package/src/app/layout.tsx +276 -0
- package/src/app/page.tsx +2670 -0
- package/src/components/azure-live-pricing.tsx +185 -0
- package/src/components/benchmark-import.tsx +340 -0
- package/src/components/confidence-badge.tsx +116 -0
- package/src/components/live-pricing-comparison.tsx +241 -0
- package/src/components/theme-provider.tsx +11 -0
- package/src/components/theme-toggle.tsx +55 -0
- package/src/components/ui/accordion.tsx +66 -0
- package/src/components/ui/alert-dialog.tsx +157 -0
- package/src/components/ui/alert.tsx +66 -0
- package/src/components/ui/aspect-ratio.tsx +11 -0
- package/src/components/ui/avatar.tsx +53 -0
- package/src/components/ui/badge.tsx +46 -0
- package/src/components/ui/breadcrumb.tsx +109 -0
- package/src/components/ui/button.tsx +59 -0
- package/src/components/ui/calendar.tsx +213 -0
- package/src/components/ui/card.tsx +92 -0
- package/src/components/ui/carousel.tsx +241 -0
- package/src/components/ui/chart.tsx +353 -0
- package/src/components/ui/checkbox.tsx +32 -0
- package/src/components/ui/collapsible.tsx +33 -0
- package/src/components/ui/command.tsx +184 -0
- package/src/components/ui/context-menu.tsx +252 -0
- package/src/components/ui/dialog.tsx +143 -0
- package/src/components/ui/drawer.tsx +135 -0
- package/src/components/ui/dropdown-menu.tsx +257 -0
- package/src/components/ui/form.tsx +167 -0
- package/src/components/ui/hover-card.tsx +44 -0
- package/src/components/ui/input-otp.tsx +77 -0
- package/src/components/ui/input.tsx +21 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/menubar.tsx +276 -0
- package/src/components/ui/navigation-menu.tsx +168 -0
- package/src/components/ui/pagination.tsx +127 -0
- package/src/components/ui/popover.tsx +48 -0
- package/src/components/ui/progress.tsx +31 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/resizable.tsx +56 -0
- package/src/components/ui/scroll-area.tsx +58 -0
- package/src/components/ui/select.tsx +185 -0
- package/src/components/ui/separator.tsx +28 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/sidebar.tsx +726 -0
- package/src/components/ui/skeleton.tsx +13 -0
- package/src/components/ui/slider.tsx +63 -0
- package/src/components/ui/sonner.tsx +25 -0
- package/src/components/ui/switch.tsx +31 -0
- package/src/components/ui/table.tsx +116 -0
- package/src/components/ui/tabs.tsx +66 -0
- package/src/components/ui/textarea.tsx +18 -0
- package/src/components/ui/toast.tsx +129 -0
- package/src/components/ui/toaster.tsx +35 -0
- package/src/components/ui/toggle-group.tsx +73 -0
- package/src/components/ui/toggle.tsx +47 -0
- package/src/components/ui/tooltip.tsx +61 -0
- package/src/components/vast-ai-live-pricing.tsx +176 -0
- package/src/hooks/use-mobile.ts +19 -0
- package/src/hooks/use-toast.ts +194 -0
- package/src/lib/benchmark-parser-sglang.ts +150 -0
- package/src/lib/benchmark-parser-tokcalc.ts +247 -0
- package/src/lib/benchmark-parser-trtllm.ts +152 -0
- package/src/lib/benchmark-parser-vllm.ts +198 -0
- package/src/lib/benchmark-schema.ts +263 -0
- package/src/lib/db.ts +13 -0
- package/src/lib/engine-presets.ts +183 -0
- package/src/lib/price-schema.ts +141 -0
- package/src/lib/token-calc.ts +808 -0
- package/src/lib/track.ts +31 -0
- package/src/lib/url-state.ts +256 -0
- package/src/lib/utils.ts +6 -0
- package/tailwind.config.ts +64 -0
- package/tests/database-runtime-build.sh +75 -0
- package/tests/python-runtime-build.sh +64 -0
- package/tests/python-runtime-container.sh +31 -0
- package/tool-results/bash_1789888171144_2c5381860539.txt +161 -0
- package/tool-results/bash_1789888175925_49c53ba3c61b.txt +191 -0
- package/tool-results/bash_1789888181202_49c53ba3c61b.txt +191 -0
- package/tool-results/bash_1789888195219_4a86a5c91411.txt +200 -0
- package/tool-results/bash_1789888203128_6cca13c71b47.txt +199 -0
- package/tool-results/bash_1789929256963_2a52aff0d0a8.txt +160 -0
- package/tool-results/read_1789888151021_69f58eec6a5b.txt +653 -0
- package/tool-results/read_1789888153837_1d3a8bfc2a94.txt +653 -0
- package/tool-results/read_1789888163087_ccc406d47505.txt +122 -0
- package/tool-results/read_1789888167347_67d1d7c9830a.txt +122 -0
- package/tool-results/read_1789929252529_d90e8f383a25.txt +285 -0
- package/tsconfig.json +42 -0
- package/upload/Pasted Content_1789887800864.txt +652 -0
- package/upload/Pasted Content_1789887909561.txt +652 -0
- package/upload/Pasted Content_1789887918428.txt +652 -0
- package/upload/Pasted Content_1789887959420.txt +652 -0
- package/upload/Pasted Content_1789888020485.txt +652 -0
- package/upload/Pasted Content_1789888058079.txt +652 -0
- package/upload/Pasted Content_1789888885033.txt +686 -0
- package/upload/Pasted Content_1789928912741.txt +285 -0
- package/upload/Pasted Content_1789928938402.txt +285 -0
- package/upload/Pasted Content_1789929160389.txt +285 -0
- package/upload/Pasted Content_1789929176660.txt +285 -0
- package/upload/issue_vision.json +28 -0
- 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 +28 -0
- package/upload/vision_output.json +28 -0
- package/dist/index.js +0 -21014
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
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.
|