[package]
name = "ffbpe"
version = "0.1.8"
edition = "2024"
description = "Unicode-aware, streaming BPE training and tiktoken-compatible encoding"
repository = "https://github.com/tokn-ai/ffbpe"
readme = "README.md"
license = "MIT"
keywords = ["tokenizer", "bpe", "nlp"]
categories = ["text-processing"]
exclude = [
".venv/**",
"dist/**",
"out/**",
"target/**",
"fixtures/**",
"!fixtures/default_special_tokens.txt",
"flamegraph*.svg",
]
[lib]
crate-type = ["cdylib", "rlib"]
[[bin]]
name = "ffbpe"
path = "src/main.rs"
required-features = ["cli"]
[dependencies]
ahash = { version = "0.8.12", features = ["serde"] }
hashbrown = { version = "0.16.1", features = ["serde"] }
fancy-regex = "0.16.2"
lazy_static = "1.5.0"
ordermap = { version = "1.0.0", features = ["serde"] }
memchr = "2.7.6"
serde_json = "1.0.145"
thiserror = "2.0.17"
rayon = "1.11.0"
moka = { version = "0.12.11", features = ["sync"] }
tracing = "0.1.43"
metrics = "0.24.3"
serde = { version = "1.0.228", features = ["derive"] }
slab = "0.4.12"
hotpath = "0.8.0"
npyz = { version = "0.8.4" }
pyo3 = { version = "0.27", optional = true, features = ["experimental-inspect", "abi3-py38"] }
ndarray = { version = "0.17.1", optional = true }
numpy = { version = "0.27.1", optional = true }
clap = { version = "4.5.53", features = ["derive"], optional = true }
tracing-subscriber = { version = "0.3.22", optional = true }
indicatif = { version = "0.18.3", optional = true }
chrono = { version = "0.4.42", optional = true }
rgb = { version = "0.8.52", optional = true }
textplots = { version = "0.8.7", optional = true }
[profile.dev.package."*"]
opt-level = 2
[profile.test]
inherits = "release"
debug = true
[profile.release]
debug = "line-tables-only"
[profile.bench]
inherits = "release"
[features]
default = []
hotpath = ["hotpath/hotpath", "hotpath/hotpath-alloc"]
fmt-npz = ["npyz/npz"]
plot = ["dep:textplots", "dep:rgb"]
py = ["dep:pyo3", "dep:ndarray", "dep:numpy"]
cli = ["dep:tracing-subscriber", "dep:indicatif", "dep:chrono", "dep:clap"]
[dev-dependencies]
clap = { version = "4.5.53", features = ["derive"] }
pyo3-introspection = "0.27"
criterion = "0.5.1"
libc = "0.2"
sha2 = "0.10"
serde_yaml_ng = "0.10.0"
[[bench]]
name = "bpe"
harness = false
[[bench]]
name = "regression"
path = "benches/regression/main.rs"
harness = false