exact tokenizers ids, as fast as the hardware allows
https://toks.actual.inc ↗// momentum
// why it's here
- Created 8 weeks ago and already shipping
- Built almost entirely by one person
// how to help
// readme
toks
The tokenizer that keeps up with your memory bus. (ノ◕ヮ◕)ノ*:・゚✧
toks is Actual Computer’s tokenizer. Give it the tokenizer.json your model ships with and it returns exactly the
ids Hugging Face tokenizers would, 13-151x faster. It’s a small C
library with hand-written asm kernels for arm64 (NEON) and x86-64 (AVX2), no runtime and no dependencies, plus a
Python package with an hf-style Tokenizer API.
- Exact. Same ids as hf tokenizers 0.23.2, checked over hundreds of thousands of cases per model on every CPU tier. A tokenizer toks can’t reproduce exactly gets refused at load, with the missing feature named. You never get quietly different ids.
- Fast. On one core with fresh text, toks is 13-151x faster than hf tokenizers in every cell of the speed table, 4-23x faster than tiktoken in every cell tiktoken can run, and ahead of gigatoken, the fastest tokenizer we know of, in 252 of 255 cold cells (receipts below).
- Tiny and embeddable. A plain C ABI (
include/toks.h) with caller-owned buffers.