# Third-party notices — vendored tokenizer

This directory ships two licences on purpose, because the package's own
`LICENSE` does not discharge the obligation we take on by redistributing it.

## 1. gpt-tokenizer

`gpt-tokenizer@3.4.0`, MIT. The full text is in `LICENSE` beside this file:

> MIT License
> Copyright (c) 2023-2024 Bazyli Brzoska

Verified from the published npm tarball (1,348 files) on 2026-08-13, not from
the GitHub repository. The two are different artifacts and only the tarball is
what we ship.

## 2. OpenAI tiktoken — the BPE ranks

`gpt-tokenizer`'s own README states, in its opening section:

> This package is a port of OpenAI's [tiktoken](https://github.com/openai/tiktoken)

and its tarball ships the rank tables verbatim — `data/o200k_base.tiktoken`
(3.6 MB) and `data/cl100k_base.tiktoken` (1.7 MB), which this directory carries
as `esm/bpeRanks/o200k_base.js` and `esm/bpeRanks/cl100k_base.js`.

The package's `LICENSE` names only its author. MIT requires the copyright notice
and permission notice to travel with every copy of the software, so
redistributing the ported code and its rank data means **we** carry the upstream
notice ourselves. Read from `https://raw.githubusercontent.com/openai/tiktoken/main/LICENSE`
on 2026-08-13:

> MIT License
>
> Copyright (c) 2022 OpenAI, Shantanu Jain
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.

Both licences are permissive and nothing here is blocked. The point is the
**shape**: a green SPDX field on the package we install is not the same as
having the notice for the data inside it. That is the LibRaw lesson at low
severity, and the cost of getting it right is this file.

## What was pruned before shipping

Removed from the vendored copy: all `.map` files, all `.d.ts` declarations, the
upstream test files, `codegen/`, `fixtures/`, and the four legacy GPT-3-era
encodings (`p50k_base`, `p50k_edit`, `r50k_base`) whose models this site does not
price. 17.7 MB tarball to **4.0 MB** vendored, of which 3.1 MB is the two rank
tables that are dynamically imported and never in the initial page payload.

## What was refused

- `@anthropic-ai/tokenizer` — Apache-2.0 and clean, last published 2023-07-05,
  encodes Claude 1/2. A green licence gate on a dead artifact ships a 2023
  vocabulary behind a current model's dollar figure.
- `llama3-tokenizer-js@1.2.0` — MIT © belladore.ai over a 3.2 MB
  `data-converted.js` whose bundled conversion script says it was built from
  "the tokenizer.json file that was distributed with the LLaMA model". Meta,
  Llama licensing and attribution appear nowhere in the package: undeclared
  vocabulary provenance with the attribution and acceptable-use pass-through
  undischarged.
- `js-tiktoken@1.0.21` and `tiktoken@1.0.22` — zero LICENSE/NOTICE/COPYING files
  in either tarball and no embedded MIT text; MIT exists only as an SPDX string
  in `package.json`, and the multi-MB rank data carries no OpenAI attribution.
  Not needed once `gpt-tokenizer` is in.
