shimmytok

Library Listed

Pure Rust tokenizer for GGUF models with llama.cpp compatibility (SentencePiece + BPE + WPM + UGM + RWKV)

Checked · Sources

Downloads
914
Dependents
2
Stars
26
Forks
7
Contributors
1
Commits
88
Latest release
0.8.5 ·

About

From the project README ·

shimmytok - Pure Rust tokenizer for GGUF models

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 modelImplementation
llama, mistral, gemma, gemma4, gemma6SentencePiece
gpt2, qwen, qwen2BPE
bert, wpmWordPiece
rwkvRWKV
t5, ugmUnigram
plamo2PLaMo-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

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:

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.

shimmytok beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
shimmytok This page Listed

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

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 App Listed

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 days
  • dormancy: last activity 2026-11-07, 2 days ago, E = 450: active
  • featured: 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
Adoption1 active dependents, 1 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents1crates.io database dumpYes
New dependents (365 days)1crates.io database dumpYes
Peak active dependents1crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 2 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-11-07GitHub repositoryYes
Latest release2026-11-07crates.io database dumpYes
First release2025-10-22crates.io database dumpYes
Latest version0.8.5crates.io database dumpYes
Days the oldest outside issue waits for a reply69GitHub repositoryYes
Maintainer replies over 365 days2GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution15 releases, 914 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases15crates.io database dumpYes
Downloads over 30 days914crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository26 stars, 7 forks, 1 contributors, 88 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars26GitHub repositoryYes — one part of the repository route
GitHub forks7GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account1GitHub contributorsYes — one part of the repository route
Commits on the default branch88GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesNo native code foundcrates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly2crates.io database dumpNo

Corrections and review history

Report a correction

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.