Skip to main content

tokenizers

C++ implementations for various tokenizers (sentencepiece, tiktoken etc). Useful for other PyTorch repos such as torchchat, ExecuTorch to build LLM runners using ExecuTorch stack or AOT Inductor stack.

Installation (from source)

git clone git@github.com:meta-pytorch/tokenizers.git
cd ~/tokenizers
git submodule update --init --recursive
pip install -e .

SentencePiece tokenizer

Depend on https://github.com/google/sentencepiece from Google.

Tiktoken tokenizer

Adapted from https://github.com/sewenew/tokenizer.

Huggingface tokenizer

Compatible with https://github.com/huggingface/tokenizers/.

Llama2.c tokenizer

Adapted from https://github.com/karpathy/llama2.c.

Tekken tokenizer

Mistral's Tekken tokenizer (v7) with full support for special tokens, multilingual text, and instruction-tuned conversations. Provides significant efficiency gains for AI workloads:

  • Special token recognition: [INST], [/INST], [AVAILABLE_TOOLS], etc. as single tokens
  • Multilingual support: Complete Unicode handling including emojis and complex scripts
  • Production-ready: 100% decode accuracy with comprehensive test coverage
  • Python bindings: Full compatibility with mistral-common ecosystem

License

tokenizers is released under the BSD 3 license. (Additional code in this distribution is covered by the MIT and Apache Open Source licenses.) However you may have other legal obligations that govern your use of content, such as the terms of service for third-party models.

Metadata

Release files for pytorch-tokenizers 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pytorch-tokenizers 1.6.0
File Actions
pytorch_tokenizers-1.6.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for pytorch_tokenizers-1.6.0-cp315-cp315-win_amd64.whl
pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ x86-64 Details for pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_x86_64.whl
pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_aarch64.whl CPython 3.15 CPython 3.15 Linux glibc 2.28+ ARM64 Details for pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_aarch64.whl
pytorch_tokenizers-1.6.0-cp315-cp315-macosx_14_0_arm64.whl CPython 3.15 CPython 3.15 macOS 14.0+ ARM64 Details for pytorch_tokenizers-1.6.0-cp315-cp315-macosx_14_0_arm64.whl
pytorch_tokenizers-1.6.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for pytorch_tokenizers-1.6.0-cp314-cp314-win_amd64.whl
pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details for pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_x86_64.whl
pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details for pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_aarch64.whl
pytorch_tokenizers-1.6.0-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details for pytorch_tokenizers-1.6.0-cp314-cp314-macosx_14_0_arm64.whl
pytorch_tokenizers-1.6.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for pytorch_tokenizers-1.6.0-cp313-cp313-win_amd64.whl
pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details for pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl
pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details for pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_aarch64.whl
pytorch_tokenizers-1.6.0-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for pytorch_tokenizers-1.6.0-cp313-cp313-macosx_14_0_arm64.whl
pytorch_tokenizers-1.6.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for pytorch_tokenizers-1.6.0-cp312-cp312-win_amd64.whl
pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details for pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl
pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64 Details for pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_aarch64.whl
pytorch_tokenizers-1.6.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for pytorch_tokenizers-1.6.0-cp312-cp312-macosx_14_0_arm64.whl
pytorch_tokenizers-1.6.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for pytorch_tokenizers-1.6.0-cp311-cp311-win_amd64.whl
pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl
pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details for pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_aarch64.whl
pytorch_tokenizers-1.6.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for pytorch_tokenizers-1.6.0-cp311-cp311-macosx_14_0_arm64.whl

Total release size: 25.7 MB

Release files / pytorch_tokenizers-1.6.0-cp315-cp315-win_amd64.whl

Download URL pytorch_tokenizers-1.6.0-cp315-cp315-win_amd64.whl
Size 896.0 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
48934c1f8346e759509bd48b7a10203d701d75cb581329d7c3543d88099e216d
BLAKE2b-256 checksum
How to use checksums
b09d325a89aa24bf83556950e752cd459eacd0548a0c42ec5cac34dd8c0552dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.15 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8d2b1eb62ab0e63414f8c288e3be9233d262d64314573f52e74810690f5b68db
BLAKE2b-256 checksum
How to use checksums
4263c0914134f5db643e42ff785f93867532289dbc1b36ae25d581c16a36b196
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.6.0-cp315-cp315-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.15 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
081bf2719c97514ac0171f80f36151411722b47681efee621943187ce7e671ad
BLAKE2b-256 checksum
How to use checksums
51090d8f32b21503ae4e4b087ca95377442533eb480b27a21948916a8308b6e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp315-cp315-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.6.0-cp315-cp315-macosx_14_0_arm64.whl
Size 1.2 MB
Tags CPython 3.15 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
56c52670999dfce9ad6f4f7bf028560a6aab760536113c731cd37df3220a3086
BLAKE2b-256 checksum
How to use checksums
5d36d3a4674320276f1cf12cd454c56105c7ea5fa01e18fac22a0883a3e55b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp314-cp314-win_amd64.whl

Download URL pytorch_tokenizers-1.6.0-cp314-cp314-win_amd64.whl
Size 896.0 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
836cfd56f2d3c5f8d445a7feb07df81773f08644cdb7dcb1c3375f5e85af97d0
BLAKE2b-256 checksum
How to use checksums
bf9af5cdb738180f8ffe238aa8c2b66e709cb0a0b0e9b33e746465b29ca3acad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.14 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
0d873bfc9bf9f2ace9bae1aba2b15afec1edd4080ce421086c92ee4c053d9165
BLAKE2b-256 checksum
How to use checksums
9553d9a9cb99595eb7adc16d8df2d26e0dd5e22d988a191f68c37831390c614e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.6.0-cp314-cp314-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.14 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cc39538c3b72a089aa3c37255c88fd4a207759e6d77c0092b8e3afc16ea99067
BLAKE2b-256 checksum
How to use checksums
ae81fb0acc77b3442eb71592467a6bfdbe503510225202d29bfe34720399e7e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp314-cp314-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.6.0-cp314-cp314-macosx_14_0_arm64.whl
Size 1.2 MB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
ca813de0fba9759adcf39149b2805efa2b5c39039cd94724faad4fd72561683f
BLAKE2b-256 checksum
How to use checksums
ac14c80b8555515a2e814d0a97f9ddc7f7f88bc2b3eee8b1ab306c1f259212c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp313-cp313-win_amd64.whl

Download URL pytorch_tokenizers-1.6.0-cp313-cp313-win_amd64.whl
Size 895.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
aa3788aecb574888d364436d5b9b5d34f77d510fe0dc22f658f634015ae1f056
BLAKE2b-256 checksum
How to use checksums
34850daa7489fb031843af7c7f645a8a50929a15b714fe2d1135c089af490a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.13 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1c8cd1b33060aadebd49a8015fa2f5ef86329685baa37d503e1d8e7d80413e50
BLAKE2b-256 checksum
How to use checksums
5fab3885c7899c5339f50c45ffade6816f418623c200a326bebe0f7fae8c3570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.6.0-cp313-cp313-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.13 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f84365ee22b59f0898b972f345dfc085225bfc62d5eca8096d5d292977e743d9
BLAKE2b-256 checksum
How to use checksums
d739c01a157136712dea1670e30f315598895d04faa46765fe5bf1f7027fac82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp313-cp313-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.6.0-cp313-cp313-macosx_14_0_arm64.whl
Size 1.2 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3a3dba982569f6e6a48962b40953c7d1bbca9a1e44364d5819f497b801a162a1
BLAKE2b-256 checksum
How to use checksums
c0e7c77af78e3ec26934e83080da5cb9f8788368dca3d153b41016c895da3ef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp312-cp312-win_amd64.whl

Download URL pytorch_tokenizers-1.6.0-cp312-cp312-win_amd64.whl
Size 895.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7e4da4d5733fac386eb150d68e93a8fd6c73478561fa3f5d87e3b4efd90d3751
BLAKE2b-256 checksum
How to use checksums
50e745e44837aa8e3b387829e92c5c0c304f9b724a8ed019ce775a9f21855313
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d3057052303a25e38e7a959dfb9c34531790d23f3570685b019f0687fc2ee368
BLAKE2b-256 checksum
How to use checksums
4f1c23cee071c53489a2907a889df6eed9cf3ca25cc7b07c2cb41b5bfc922279
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.6.0-cp312-cp312-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.12 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
09e415750e301badb10711e443c1ed6189bd6ce1604e3c38ee03217a69021dbb
BLAKE2b-256 checksum
How to use checksums
5a045da60fb8d2f4d98bde98e18e694c084ad6d7714e6d264e2a66920bef8906
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp312-cp312-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.6.0-cp312-cp312-macosx_14_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
0b29caf6ec92fffa2363faa6fbb6d5e8273b8f8194d2ee451cea9ec6203cffbc
BLAKE2b-256 checksum
How to use checksums
d1e3d22bff3db935aebb592b9ca0ee7e5ca6b0e80a71c081b4c0fb2f01badc82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp311-cp311-win_amd64.whl

Download URL pytorch_tokenizers-1.6.0-cp311-cp311-win_amd64.whl
Size 893.9 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
22eef9b55b22598bd154e8bbfa0ba3ca0f49a86e491bc64165671d1476269744
BLAKE2b-256 checksum
How to use checksums
9b809cbb64e57ff20237b9a306e0be157c6178a8984b1a1eb4f527ecacfe5ce4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c0c0ad8288cf85cf90d8f506034502f8ab39781603dbc20d11b8eee609128a82
BLAKE2b-256 checksum
How to use checksums
8c5ba8dbb86c77870155ca675037a2a10a2b6412872317f7dc37112a5b9d7485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.6.0-cp311-cp311-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
84084258e49e6a744ca919c4025766161ba23a7a35b287227a445a72e4878134
BLAKE2b-256 checksum
How to use checksums
31ac31572845ec43bd60c819cc9d12ab77ec5ea479aea98c6602500cf84c8db3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Release files / pytorch_tokenizers-1.6.0-cp311-cp311-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.6.0-cp311-cp311-macosx_14_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
c572ec923931d480f4ba19d077a8a45c813fc37b25c225cfc645a319d514aaec
BLAKE2b-256 checksum
How to use checksums
fd394d766e4eeef92dec81a2dd665108e23ebaecaf5ea9e308b207267342f1f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16+meta

Security for pytorch-tokenizers 1.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page