quicktok runs the same algorithm as bpe-openai (exact backtracking BPE) but applies lots of data-structure optimizations to cut memory accesses and achieve the speedups (~7x over tiktoken). Output is byte-identical to tiktoken so this can be a great drop-in for anyone doing lots of corpus ingestion, search indexing etc. Happy to answer all questions. If you find any input where quicktok's ids differ from tiktoken's that's a bug! Please report it.
Repository
dmatth1/quicktok
quicktok
Fast exact BPE tokenizer. Byte-identical to tiktoken, 7x faster
11stars
dmatth1/quicktok
quicktok
A fast, exact BPE tokenizer for OpenAI and open-model encodings, written in C++ with Python wheels. Byte-identical to tiktoken, 7x faster.
Visit project- First shared
- Jul 3, 2026
- HN activity
- 31
Show HN@dmatth1Jul 3, 2026
Show HN: Quicktok, an exact BPE tokenizer 7x faster than tiktoken
Community