NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1212 most downloaded on Packagist
PHP version of tiktoken
Latest stable
1.1.1
Last release 8 months ago
10 Mar 2026
Release timing varies
gaps range from 2 weeks to 5 months
Most releases are documented
notes for 15 of 19 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
19 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Fixed race condition in vocabulary cache update
### Added * Added support GPT-5.2
Change log
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The first stable release. There are no changes in the public API since version 0.12.0.
The lib mode is still in an experimental state. And method Encoder::encodeInChunks() is not supported.
Added Added support for GPT-5.1
Nothing published for this version
Added support for the following models: 04-mini, gpt-oss, gpt-4.5 and gpt-5
Added support for the following models: 04-mini, gpt-oss, gpt-4.5 and gpt-5
Added support for GPT-4.1 models (close #28)
Added an alternative implementation of the encoder using tiktoken-rs library (#27).
Added an alternative implementation of the encoder using tiktoken-rs library (#27).
Yethee\Tiktoken\Exception\IOError classYethee\Tiktoken\Exception\LibError classYethee\Tiktoken\Encoder\LibEncoder classYethee\Tiktoken\Encoder\NativeEncoder classYethee\Tiktoken\Vocab\VocabLoader::loadFile() methodYethee\Tiktoken\Encoder is now an interface$useLib to Yethee\Tiktoken\EncoderProvider constructor- public function __construct()
+ public function __construct(private bool $useLib = false)
EncoderProvider::setVocabCache() method:- public function setVocabCache(string|null $cacheDir): void
+ public function setVocabCache(string $cacheDir): void
### Added * Added support for o3 models
Add support o1 models (#18, #19)
o1 models (#18, #19)chatgpt-4o models### Added * Added support for models: * babbage-002 * davinci-002 * text-embedding-3-small * text-embedding-3-large
babbage-002davinci-002text-embedding-3-smalltext-embedding-3-largeFix invalidate cache of vocab when the hash is mismatch.
Added support for encoding o200k_base (GPT-4o)
o200k_base (GPT-4o) (#14)[BC break] Changed signature of method VocabLoader::load
- public function load(string $uri): Vocab;
+ public function load(string $uri, string|null $checksum = null): Vocab;
Improved performance of converting text into tokens (PR #10)
EncodeUtil::fromBytes()Added Encoder::encodeInChunks() method, which allows encode a text in chunks.
Encoder::encodeInChunks() method, which allows encode a text in chunks.Cache is enabled by default to avoid performance issues (see #2 and #5)
Cache is enabled by default to avoid performance issues (see #2 and #5)
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.