[package]
name = "riptoken"
version = "0.2.0"
edition = "2024"
rust-version = "1.85"
description = "Fast BPE tokenizer for LLMs — a faster, drop-in compatible reimplementation of tiktoken"
license = "MIT"
repository = "https://github.com/daechoi/riptoken"
homepage = "https://github.com/daechoi/riptoken"
documentation = "https://docs.rs/riptoken"
readme = "README.md"
keywords = ["tokenizer", "bpe", "llm", "tiktoken", "nlp"]
categories = ["text-processing", "science", "parser-implementations"]
authors = ["Dae Choi <daechoi70@gmail.com>"]
exclude = [
    "*.tiktoken",
    ".venv/",
    "dist/",
    "tests/python/",
    "scripts/",
]

[lib]
name = "riptoken"
crate-type = ["rlib", "cdylib"]

[features]
default = []
python = ["dep:pyo3"]

[dependencies]
rustc-hash = "2"
regex = "1.11"
fancy-regex = "0.17"
rayon = "1.10"
pyo3 = { version = "0.27.2", default-features = false, features = ["extension-module", "macros"], optional = true }

[dev-dependencies]
base64 = "0.22"

[[bench]]
name = "bpe"
harness = false

[profile.profiling]
inherits = "release"
debug = 2
strip = false

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