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.5.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.5.0
File
pytorch_tokenizers-1.5.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
pytorch_tokenizers-1.5.0-cp314-cp314-manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64 Details
pytorch_tokenizers-1.5.0-cp314-cp314-manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ ARM64 Details
pytorch_tokenizers-1.5.0-cp314-cp314-macosx_14_0_arm64.whl CPython 3.14 CPython 3.14 macOS 14.0+ ARM64 Details
pytorch_tokenizers-1.5.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
pytorch_tokenizers-1.5.0-cp313-cp313-manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64 Details
pytorch_tokenizers-1.5.0-cp313-cp313-manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ ARM64 Details
pytorch_tokenizers-1.5.0-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details
pytorch_tokenizers-1.5.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
pytorch_tokenizers-1.5.0-cp312-cp312-manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64 Details
pytorch_tokenizers-1.5.0-cp312-cp312-manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ ARM64 Details
pytorch_tokenizers-1.5.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details
pytorch_tokenizers-1.5.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
pytorch_tokenizers-1.5.0-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details
pytorch_tokenizers-1.5.0-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details
pytorch_tokenizers-1.5.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details
pytorch_tokenizers-1.5.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details
pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64 Details
pytorch_tokenizers-1.5.0-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details

Total release size: 25.0 MB

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

Download URL pytorch_tokenizers-1.5.0-cp314-cp314-win_amd64.whl
Size 858.4 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
4b69fb83684f376b23c7b1bbf2b78d2ad26bb402d5a69b08d1f4a1a0046a491c
BLAKE2b-256 checksum
How to use checksums
44f81f23c397af101d77dd5b91e8931094644ac9ce30250fe1e0e5a430d84922
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
a6e817ad823c6cea777d8bfff30a10306a4d38e148694fd6cb197d4c470c26c2
BLAKE2b-256 checksum
How to use checksums
9880a78f591c27785eb6211e443f72d71bbbfb4906c500b0c713614b27eee170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
385d149b5bffef75ac554033c606ae2dc7fc19d637f6029e0b3b9768b14bff32
BLAKE2b-256 checksum
How to use checksums
5b4264c8873a2b47698d9c689cd03cfb533a72351371a9c3dd9cefe8ad894b91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp314-cp314-macosx_14_0_arm64.whl
Size 1.1 MB
Tags CPython 3.14 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
4ad40ffcce96f3fbfbc95d1e3633193187b508bcf1a2f4f0a939e021a365f37b
BLAKE2b-256 checksum
How to use checksums
b24d54b1dd302187de378163189a10c6b56b4d953e9fa5c18f4028e624c8a230
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp313-cp313-win_amd64.whl
Size 857.9 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
458776f52688e01ec49cedeb519133a1dddf3823b014b27e0f7dc08decffe87b
BLAKE2b-256 checksum
How to use checksums
162b762f9063fb7ac411c12910359553e8b40ef92ab43940a9e68a33f2e8ca4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
20ec136dfe9541eb905d586938187bc2d921c281c6ab8a33ecb2642a87654be2
BLAKE2b-256 checksum
How to use checksums
3899d75fe6df776941cb6db669f4ed97c375a77b312b0b0ead12d71e9bd3585f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
0c3aeed060d18fc5464460af6a26c5feda47f492157f2a0be0544fdc5aa730fd
BLAKE2b-256 checksum
How to use checksums
09400d3be6d3f81fdd962e55c52b15bca2cc5f8b10b6b09a67f590afe0be6f85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp313-cp313-macosx_14_0_arm64.whl
Size 1.1 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
2171ba6af8824bd5adb5eb5ba710d411eed8a9c51273bb908b6645e037947ca5
BLAKE2b-256 checksum
How to use checksums
92d06b57f1f80caeab557f571e0a6c8a1115dc6f49c9ca71372653c08a303059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp312-cp312-win_amd64.whl
Size 857.9 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7a8915bc0d50904251942ff398c4842dced5ce867c22ec68e57d384ac3a69ee1
BLAKE2b-256 checksum
How to use checksums
e83d674871869aefe8db8e5335468a01b06a42d844dc91f7a5ebb4916966b128
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
33288e20206fe554d33858280221cc9572ad4806bfa59ce384853d0b4a57914d
BLAKE2b-256 checksum
How to use checksums
0f827fc683f55df3f4968e719a90bc6ca2049f1c67f0ab392e02246692fcd14c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
17bdd423c478d58e3ef0b4188f983e371aaa2dba92d885e072d069461f06838d
BLAKE2b-256 checksum
How to use checksums
10f8820906728f8f7a51a26dd57589f6e33b03886d0f98097f053af34e1ac608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp312-cp312-macosx_14_0_arm64.whl
Size 1.1 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
3c709aaa4689161a9db393f04d042cea1be1441e32f68cdef384ae5c023dd71c
BLAKE2b-256 checksum
How to use checksums
b59a2df0ac77cf46608621adfdab302f165212245c3ce3093ca21dc321aaeb88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp311-cp311-win_amd64.whl
Size 858.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
f0f7144aeaabdf27367b30950c486516875025bf89679601d9507a9ab9c065ca
BLAKE2b-256 checksum
How to use checksums
df7c13f1839829952e71b94b6eea960dd95eea05b709e9a866c2e70fb051a61e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
479f1fae0fec08394019a5446c8a04d18e7c9308b8f01b7ce8e177785492184b
BLAKE2b-256 checksum
How to use checksums
08444d98fbcb4554be7f155e43245b6e713bfede9a0ccf6b0b4a310f67800083
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.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
6594694666a3f0679ead16b262ca80c3efcef53db2d3ec9e852c0d6ede47f09f
BLAKE2b-256 checksum
How to use checksums
9db7cf3bc4809b630e0e339bf7783937e757b7aef94b9e984cc171feca7fd489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

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

Download URL pytorch_tokenizers-1.5.0-cp311-cp311-macosx_14_0_arm64.whl
Size 1.1 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
d9702c9efb31890c83f9f4711a43e5f56248786036cfb31df3995fe793a229ea
BLAKE2b-256 checksum
How to use checksums
dcfc56ad0d8c8966720a1dc4c6d70af20970b9d05f1f672c4a9cc884b5ea44a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / pytorch_tokenizers-1.5.0-cp310-cp310-win_amd64.whl

Download URL pytorch_tokenizers-1.5.0-cp310-cp310-win_amd64.whl
Size 856.3 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
4083ea916f449329577e2e952f667442ce26be7e6fce7fe3850466696e77e8fd
BLAKE2b-256 checksum
How to use checksums
e1d25595c8c35b7c50bdc13bff0ea22ff185e5218041d6ba493fe2360ee2cc55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
9eecc57f1e4dad20261caff854fdcc7fc96791e771698daa2d4ecfb8fbb16dc2
BLAKE2b-256 checksum
How to use checksums
9817f4e13f866b56320f37fb25f653dee63cf231ef32f33419a36bbeb788f140
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_aarch64.whl

Download URL pytorch_tokenizers-1.5.0-cp310-cp310-manylinux_2_28_aarch64.whl
Size 1.5 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
a2c3fe96dbbd9b5b31088e0a63b429c7fb0cf233d3e82122793c176fca616e88
BLAKE2b-256 checksum
How to use checksums
7a28633f278e33e90b4ea1fb84d95c2c23b9b197dc6aafbb27db7ba268c86962
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / pytorch_tokenizers-1.5.0-cp310-cp310-macosx_14_0_arm64.whl

Download URL pytorch_tokenizers-1.5.0-cp310-cp310-macosx_14_0_arm64.whl
Size 1.1 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
dfd29b53eac0cbc2e1954b3295f6ae55763912123265cb7016323270d4681947
BLAKE2b-256 checksum
How to use checksums
f8d6dff264f941afe8e5834792526f7b6c003dff94bace676eecadba9def106b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

1.5.0 This release

20 release files

1.4.0

16 release files

1.3.0

16 release files

1.1.0

24 release files

1.0.1

23 release files

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