splintr 0.19.1

Fast Rust tokenizer (BPE + SentencePiece + WordPiece) with Python bindings
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
name = "splintr"
version = "0.19.1"
build = false
include = [
    "/src/**/*.rs",
    "/tests/**/*.rs",
    "/examples/**/*.rs",
    "/benches/**/*.rs",
    "/Cargo.toml",
    "/README.md",
    "/CHANGELOG.md",
    "/LICENSE",
    "/LICENSE-OTHERS",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Fast Rust tokenizer (BPE + SentencePiece + WordPiece) with Python bindings"
homepage = "https://github.com/ml-rust/splintr"
readme = "README.md"
keywords = [
    "tokenizer",
    "bpe",
    "sentencepiece",
    "wordpiece",
    "llm",
]
categories = [
    "text-processing",
    "encoding",
]
license = "MIT"
repository = "https://github.com/ml-rust/splintr"

[features]
default = [
    "rayon",
    "regexr-jit",
]
pcre2 = ["dep:pcre2"]
python = [
    "dep:pyo3",
    "vocabs",
]
rayon = ["dep:rayon"]
regexr-jit = [
    "regexr/jit",
    "regexr/simd",
]
vocab-cl100k = ["dep:splintr-vocab-cl100k"]
vocab-deepseek = ["dep:splintr-vocab-deepseek"]
vocab-gemma2 = ["dep:splintr-vocab-gemma2"]
vocab-gemma3 = ["dep:splintr-vocab-gemma3"]
vocab-gemma4 = ["dep:splintr-vocab-gemma4"]
vocab-glm = ["dep:splintr-vocab-glm"]
vocab-gpt-oss = ["vocab-o200k"]
vocab-kimi = ["dep:splintr-vocab-kimi"]
vocab-llama2 = ["dep:splintr-vocab-llama2"]
vocab-llama3 = ["dep:splintr-vocab-llama3"]
vocab-mistral = ["dep:splintr-vocab-mistral"]
vocab-modernbert = ["dep:splintr-vocab-modernbert"]
vocab-o200k = ["dep:splintr-vocab-o200k"]
vocab-olmo2 = ["vocab-cl100k"]
vocab-phi4 = ["vocab-cl100k"]
vocab-qwen = ["dep:splintr-vocab-qwen"]
vocab-whisper = ["dep:splintr-vocab-whisper"]
vocabs = [
    "vocab-cl100k",
    "vocab-o200k",
    "vocab-gpt-oss",
    "vocab-phi4",
    "vocab-olmo2",
    "vocab-llama3",
    "vocab-llama2",
    "vocab-deepseek",
    "vocab-qwen",
    "vocab-glm",
    "vocab-gemma2",
    "vocab-gemma3",
    "vocab-gemma4",
    "vocab-kimi",
    "vocab-mistral",
    "vocab-modernbert",
    "vocab-whisper",
]

[lib]
name = "splintr"
crate-type = [
    "cdylib",
    "rlib",
]
path = "src/lib.rs"

[[example]]
name = "verify_gguf"
path = "examples/verify_gguf.rs"

[[example]]
name = "verify_pretrained"
path = "examples/verify_pretrained.rs"

[[example]]
name = "verify_spm_vs_bpe"
path = "examples/verify_spm_vs_bpe.rs"

[[test]]
name = "cl100k"
path = "tests/cl100k.rs"

[[test]]
name = "decode_agreement"
path = "tests/decode_agreement.rs"

[[test]]
name = "deepseek_v3"
path = "tests/deepseek_v3.rs"

[[test]]
name = "encode_cost"
path = "tests/encode_cost.rs"

[[test]]
name = "glm4"
path = "tests/glm4.rs"

[[test]]
name = "gpt_oss"
path = "tests/gpt_oss.rs"

[[test]]
name = "hf_json_bpe_merge_order"
path = "tests/hf_json_bpe_merge_order.rs"

[[test]]
name = "hf_json_bpe_nosplit"
path = "tests/hf_json_bpe_nosplit.rs"

[[test]]
name = "hf_json_bpe_suffix"
path = "tests/hf_json_bpe_suffix.rs"

[[test]]
name = "hf_json_unigram"
path = "tests/hf_json_unigram.rs"

[[test]]
name = "hf_json_wordpiece"
path = "tests/hf_json_wordpiece.rs"

[[test]]
name = "kimi"
path = "tests/kimi.rs"

[[test]]
name = "llama3"
path = "tests/llama3.rs"

[[test]]
name = "mistral"
path = "tests/mistral.rs"

[[test]]
name = "mistral_v2"
path = "tests/mistral_v2.rs"

[[test]]
name = "mistral_v3"
path = "tests/mistral_v3.rs"

[[test]]
name = "o200k"
path = "tests/o200k.rs"

[[test]]
name = "public_api"
path = "tests/public_api.rs"

[[test]]
name = "qwen3"
path = "tests/qwen3.rs"

[[test]]
name = "reference_parity"
path = "tests/reference_parity.rs"

[[test]]
name = "vocab_packed_parity"
path = "tests/vocab_packed_parity.rs"

[[bench]]
name = "encode"
path = "benches/encode.rs"
harness = false
required-features = ["vocab-llama3"]

[dependencies.aho-corasick]
version = "1.1"

[dependencies.base64]
version = "0.22"

[dependencies.lru]
version = "0.18"

[dependencies.memchr]
version = "2.7"

[dependencies.pcre2]
version = "0.2"
optional = true

[dependencies.pyo3]
version = "0.29"
features = [
    "extension-module",
    "abi3-py310",
]
optional = true

[dependencies.rayon]
version = "1.10"
optional = true

[dependencies.regexr]
version = "0.3.2"
default-features = false

[dependencies.rustc-hash]
version = "2.0"

[dependencies.serde]
version = "1.0"

[dependencies.serde_json]
version = "1.0"
features = ["raw_value"]

[dependencies.splintr-vocab-cl100k]
version = "1"
optional = true

[dependencies.splintr-vocab-deepseek]
version = "1"
optional = true

[dependencies.splintr-vocab-gemma2]
version = "1"
optional = true

[dependencies.splintr-vocab-gemma3]
version = "1"
optional = true

[dependencies.splintr-vocab-gemma4]
version = "1"
optional = true

[dependencies.splintr-vocab-glm]
version = "1"
optional = true

[dependencies.splintr-vocab-kimi]
version = "1"
optional = true

[dependencies.splintr-vocab-llama2]
version = "1"
optional = true

[dependencies.splintr-vocab-llama3]
version = "1"
optional = true

[dependencies.splintr-vocab-mistral]
version = "1"
optional = true

[dependencies.splintr-vocab-modernbert]
version = "1"
optional = true

[dependencies.splintr-vocab-o200k]
version = "1"
optional = true

[dependencies.splintr-vocab-qwen]
version = "1"
optional = true

[dependencies.splintr-vocab-whisper]
version = "1"
optional = true

[dependencies.thiserror]
version = "2.0"

[dependencies.unicode-general-category]
version = "1.0"

[dependencies.unicode-normalization]
version = "0.1"

[dependencies.unicode-segmentation]
version = "1"

[dev-dependencies.fluxbench]
version = "0.1"

[dev-dependencies.proptest]
version = "1"

[profile.release]
opt-level = 3
lto = true
codegen-units = 1