Comparison
sentencepiece vs tiktoken vs tokenizers vs toktok-rs
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Unsupervised text tokenizer and detokenizer.
Actively maintained. Last release 4 weeks ago, commits in 25 of the last 26 weeks. A safe choice.
pip install sentencepiecetiktoken is a fast BPE tokeniser for use with OpenAI's models
Maintained. Last release 4 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install tiktokenActively maintained. Last release 13 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install tokenizersFast, exact BPE tokenizer for OpenAI encodings — Rust core, tiktoken-identical ids
Maintained. Last release 2 weeks ago, commits in 5 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install toktok-rsIn short
- tiktoken is the most used: 234.6M downloads a month.
- tokenizers is better maintained: Pythie’s Index 85 against 48.
- tokenizers is growing fastest: downloads +17% over the last month.
- toktok-rs is the newcomer: first released Sep 2026.
Side by side
| Metric | sentencepiece | tiktoken | tokenizers | toktok-rs |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 78 | Pythie’s Index: 48 | Pythie’s Index: 85 | Pythie’s Index: 66 |
| Verdict | Actively maintained | Maintained | Actively maintained | Maintained |
| Downloads / month | 30M | 234.6M | 229.6M | 173.3K |
| Downloads, month over month | +5% | +16% | +17% | +10% |
| GitHub stars | 12.2K | 19.8K | 11.4K | 14 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 1.3K | 3.5K | 1 | 1 |
| Last release | Nov 5, 2026 | Aug 17, 2026 | Nov 20, 2026 | Nov 16, 2026 |
| Releases, 12 months | 2 | 2 | 12 | 8 |
| Weeks with commits | 25 / 26 | 2 / 26 | 26 / 26 | 5 / 26 |
| Recent contributors | 13 | 26 | 18 | 1 |
| First release | Aug 2017 | Dec 2022 | Nov 2019 | Sep 2026 |
| Python versions | 3.10 – 3.15 | – | 3.10 – 3.14 | 3.11 – 3.14 |
| License | Apache-2.0 | MIT | non-standard | MIT |
| Known vulnerabilities | 1 | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.