unstale

npm / gpt-tokenizer

gpt-tokenizer

What changed in gpt-tokenizer 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-03.

4 breaking7 new APIs and options2 performance2 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.9 on npm

gpt-tokenizer 49 changes

Breaking changes 2

New APIs and options 3

Performance 2

  • Optimized BPE hot paths while preserving Unicode and streaming correctness.

    4.0.4release notes

  • Byte pair merge is now O(n log n) on long pieces.

    4.0.1release notes

Fixes and other changes 2

  • Allowed special tokens are now recognised anywhere in the text.

    4.0.3release notes

  • Splitting and encoding now match tiktoken for U+0085 and U+FEFF.

    4.0.2release notes

gpt-tokenizer 36 changes

Breaking changes 2

  • Corrects the split regexp for o200, affecting how its text is tokenized.

    3.3.0release notes

  • Changes the default encoding to o200k_base, which the notes say most modern models use.

    3.0.0release notes

New APIs and options 4