[package]
edition = "2021"
name = "splintr"
version = "0.18.0"
build = false
include = [
"/src/**/*.rs",
"/tests/**/*.rs",
"/examples/**/*.rs",
"/benches/**/*.rs",
"/vocabs/*.splv",
"/vocabs/*.spm",
"/Cargo.toml",
"/README.md",
"/CHANGELOG.md",
"/LICENSE",
]
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 = []
vocab-deepseek = []
vocab-glm = []
vocab-gpt-oss = ["vocab-o200k"]
vocab-kimi = []
vocab-llama3 = []
vocab-mistral = []
vocab-o200k = []
vocab-qwen = []
vocab-whisper = []
vocabs = [
"vocab-cl100k",
"vocab-o200k",
"vocab-gpt-oss",
"vocab-llama3",
"vocab-deepseek",
"vocab-qwen",
"vocab-glm",
"vocab-kimi",
"vocab-mistral",
"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_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.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