shimmytok
Library Listed
Pure Rust tokenizer for GGUF models with llama.cpp compatibility (SentencePiece + BPE + WPM + UGM + RWKV)
- Downloads
- 914
- Dependents
- 2
- Stars
- 26
- Forks
- 7
- Contributors
- 1
- Commits
- 88
- Latest release
- 0.8.5 ·
About

Pure Rust tokenizer for GGUF models
ShimmyTok 0.8.5 • checked GGUF metadata • fixture-scoped compatibility
shimmytok is free forever. Choose MIT OR Apache-2.0 and retain the applicable license notices.
Support
This project is independently maintained and free forever. Sponsorship helps fund ongoing development, certification, compatibility work, and releases.
Sponsor on GitHub · Buy Me a Coffee
Any amount is appreciated. Suggested tiers:
- $5/month — Thanks
- $15/month — Supporter
- $50/month — Backer
- Custom — Email for invoicing
ShimmyTok 0.8.5
ShimmyTok is a Rust library for loading GGUF tokenizers. This release shares a checked GGUF manifest parser with Airframe, preserves the existing tokenizer API, and adds permanent malformed-array allocation regression tests. See the versioned changelog and parser security notes.
Tokenizer support is not inference support. Reading a vocabulary or recognizing a model name does not certify its neural-network execution in Airframe or Shimmy. Compatibility comparisons apply to the exact tested fixtures and options; there is no universal llama.cpp parity guarantee.
Implementation coverage
The current dispatcher in Tokenizer::from_vocab selects these implementations:
Read the full README
| GGUF tokenizer model | Implementation |
|---|---|
llama, mistral, gemma, gemma4, gemma6 | SentencePiece |
gpt2, qwen, qwen2 | BPE |
bert, wpm | WordPiece |
rwkv | RWKV |
t5, ugm | Unigram |
plamo2 | PLaMo-2 |
Other tokenizer-model values return an unsupported-model error. Implementation availability is separate from independent token-for-token fixture validation. A family name is not a promise that every vocabulary, normalization rule or pre-tokenizer revision is compatible.
Installation
After 0.8.5 is published, add the library to a Rust project:
cargo add shimmytok@0.8.5
Or use:
[dependencies]
shimmytok = "0.8.5"
This package is a library, not a cargo install command-line application.
The default parallel feature enables optional Rayon batch processing.
default-features = false selects the sequential batch implementation.
Quick Start
Use an existing GGUF file containing a supported tokenizer:
use shimmytok::{EncodeOptions, Tokenizer};
fn main() -> Result<(), shimmytok::Error> {
let tokenizer = Tokenizer::from_gguf_file("model.gguf")?;
let options = EncodeOptions::with_parse_special(true, true);
let ids = tokenizer.encode_with_options("Hello, world!", &options)?;
let decoded = tokenizer.decode(&ids, true)?;
println!("{decoded}");
Ok(())
}
Choose special-token options to match the actual model/template contract. Avoid adding a second BOS to a prompt whose template already supplies it. Explicit GGUF special-token metadata takes precedence over family defaults; this release does not add another BOS-default correction.
API and compatibility
encode, encode_with_options, decode, decode_single, encode_batch,
get_token, special-token accessors and read-only metadata remain available.
See the API stability contract for signatures, opt-in
external-special-token behavior and upgrade boundaries.
Batch output preserves input order; each item follows the corresponding single encode operation. The sequential/parallel error contract selects the lowest failing input index. No new universal performance or cross-platform certification is implied by those API contracts.
The coordinated dense-inference fixtures use exact Qwen3 and Llama model/token hashes and reference conditions documented by Shimmy. Those engine tests do not certify every tokenizer implementation above against every llama.cpp revision. New models require their own exact-ID comparisons, including normalization, added tokens, byte fallback and prompt framing.
Security and platforms
The public GGUF reader validates declared lengths, tensor bounds/alignment and checked allocation budgets before consuming untrusted payloads. The permanent security regression exercises impossible array counts, budgets, overflow and truncation alongside a valid bounded vocabulary. These checks do not make arbitrary model files harmless or provide unbounded resource guarantees for every tokenizer algorithm.
Local package tests ran on Linux under WSL. Other native platforms, WASM/WASI and minimum-toolchain certification are NOT_RUN in this release record. Rust portability or a sequential code path is not evidence of execution on a particular target. Use source builds and report exact target/toolchain failures.
Links
- 📖 CHANGELOG — Version history
- 🗺️ ROADMAP — Future plans
- 🤝 CONTRIBUTING — How to contribute
- 🔒 SECURITY — Vulnerability reporting
- 📚 docs.rs — API documentation
Related Projects
License
Dual-licensed MIT OR Apache-2.0 — free forever, no strings attached.
Maintainer: Michael A. Kuykendall
Mission: Pure Rust tokenization for the LLM ecosystem
Support
This project is a safe space. Trans rights are human rights.
If you or someone you love needs support:
- The Trevor Project — 24/7 for LGBTQ+ young people. Call 1-866-488-7386 or text START to 678-678
- Trans Lifeline — peer support run by and for trans people. US: 877-565-8860
- 988 Suicide & Crisis Lifeline — call or text 988
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
Pure Rust tokenizer for GGUF models with llama.cpp compatibility (SentencePiece + BPE + WPM + UGM + RWKV) |
914 downloads over 30 days | 2 | 26 | 0.8.5 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
tiktoken-rs Featured
Library for encoding and decoding with the tiktoken library in Rust |
3,939,182 downloads over 30 days | 449 | 410 | 0.12.1 | GPU support unknown | No native code found | MIT |
|
rust-tiktoken Listed
A high-performance pure-Rust implementation of OpenAI's tiktoken BPE tokenizer |
25,714 downloads over 30 days | 12 | 8 | 4.1.2 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
splintr Listed
Tokenizer for Rust and Python: pure Rust by default, with 18 bundled vocabularies and four backends covering BPE, SentencePiece and WordPiece. Its output matches Hugging Face tokenizers id for id on 14 model families, including GPT-2, Qwen, Whisper, T5 and BERT. Python bindings |
8,204 downloads over 30 days | 7 | 63 | 0.22.2 | GPU support unknown | Binds native code: pcre2-sys (feature pcre2) | MIT |
|
kitoken Listed
Fast tokenizer for language models, supporting BPE, Unigram and WordPiece tokenization |
2,949 downloads over 30 days | 3 | 62 | 0.11.1 | GPU support unknown | No native code found | BSD-2-Clause |
|
tiktoken is a fast BPE tokeniser for use with OpenAI's models. |
0 binary downloads per release | Not applicable | 19,621 | Not measured | Not measured | MIT |
Why ListedNo archive, New or Featured rule places it, so it is Listed.
What it lacks for Featured
- It has 1 active dependents and 1 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days. The repository route reads 26 stars, 7 forks and 1 contributor. It needs 4,539 stars, 434 forks and 79 contributors together.
What else the check found
- The last activity is on 7 Nov 2026, 2 days ago. The rules expect an update within 450 days. Dormancy rule
Exact rules: Listed, Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.8.5 base 450: E = 450 daysdormancy: last activity 2026-11-07, 2 days ago, E = 450: activefeatured: not featured: active_users 1 < 11 and new_adopters 1 < 9 and repository route stars 26 (needs 4539), forks 7 (needs 434), contributors 1 (needs 79)listed: listed: no archive, new or featured rule applies
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 1 | crates.io database dump | Yes | |
| New dependents (365 days) | 1 | crates.io database dump | Yes | |
| Peak active dependents | 1 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 2 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-11-07 | GitHub repository | Yes | |
| Latest release | 2026-11-07 | crates.io database dump | Yes | |
| First release | 2025-10-22 | crates.io database dump | Yes | |
| Latest version | 0.8.5 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 69 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 2 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution15 releases, 914 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 15 | crates.io database dump | Yes | |
| Downloads over 30 days | 914 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository26 stars, 7 forks, 1 contributors, 88 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 26 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 7 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 1 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 88 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 2 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.