← All repos

tiktoken

tiktoken is a fast BPE tokeniser for use with OpenAI's models.

Browse cluster: HTML Parsing & Error Tracking
72commits
26contributors
2languages

Tech stack & purpose

tiktoken is a fast byte pair encoding tokenizer built for use with OpenAI's language models. Written in Python and available via PyPI, it provides APIs for encoding text into tokens and decoding tokens back to text, with performance reported to be 3-6x faster than comparable open source tokenizers. The project includes an educational submodule for learning about BPE mechanics and supports extension through both direct instantiation of Encoding objects and a plugin mechanism via namespace packages.

Community & reference links

Languages

Python
64.9%
Rust
35.1%

Contributors