How?
Tok'n'Roll is written 100% in safe Java e.g. no Unsafe.
It's compiled into a native library with GraalVM Native Image and wrapped for Python, the toknroll wheel is only ~5.6 MB.
Why?
Tok'n'Roll exposes a simple and clean API and easily outperforms the industry standard libraries like Tiktoken and HF tokenizers, which are thin wrappers over Rust codebases riddled with unsafe usages.
It showcases how Java can be extremely performant and safe. It's heavily inspired on Florian Enner's work (StaticFX) that makes Native Image and C interop easy and seamless.
mukel•12m ago
How? Tok'n'Roll is written 100% in safe Java e.g. no Unsafe. It's compiled into a native library with GraalVM Native Image and wrapped for Python, the toknroll wheel is only ~5.6 MB.
Why? Tok'n'Roll exposes a simple and clean API and easily outperforms the industry standard libraries like Tiktoken and HF tokenizers, which are thin wrappers over Rust codebases riddled with unsafe usages.
It showcases how Java can be extremely performant and safe. It's heavily inspired on Florian Enner's work (StaticFX) that makes Native Image and C interop easy and seamless.