[package]
edition = "2024"
name = "ai_tokenopt"
version = "0.5.6"
authors = ["Andreas Reichel"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Adaptive token optimization engine for LLM inference pipelines — compresses prompts, conversation history, tool schemas, and output streams to minimize token usage while preserving response quality."
readme = "README.md"
keywords = [
"llm",
"token",
"optimization",
"inference",
"ai",
]
categories = [
"algorithms",
"text-processing",
]
license = "MIT"
repository = "https://github.com/andreasreichel/PiSovereign"
[features]
default = ["hf-tokenizer"]
hf-tokenizer = ["dep:tokenizers"]
ollama = ["dep:reqwest"]
[lib]
name = "ai_tokenopt"
path = "src/lib.rs"
[[test]]
name = "advanced_integration"
path = "tests/advanced_integration.rs"
[[test]]
name = "config_tests"
path = "tests/config_tests.rs"
[[test]]
name = "end_to_end"
path = "tests/end_to_end.rs"
[[test]]
name = "quality_preservation"
path = "tests/quality_preservation.rs"
[[test]]
name = "stream_repetition_tests"
path = "tests/stream_repetition_tests.rs"
[[test]]
name = "summarization_port_tests"
path = "tests/summarization_port_tests.rs"
[[test]]
name = "token_reduction_benchmarks"
path = "tests/token_reduction_benchmarks.rs"
[[test]]
name = "v2_integration"
path = "tests/v2_integration.rs"
[[bench]]
name = "token_optimization"
path = "benches/token_optimization.rs"
harness = false
[dependencies.async-trait]
version = "0.1"
[dependencies.futures]
version = "0.3"
[dependencies.reqwest]
version = "0.12"
features = [
"json",
"rustls-tls",
]
optional = true
default-features = false
[dependencies.serde]
version = "1.0"
features = ["derive"]
[dependencies.serde_json]
version = "1.0"
[dependencies.sysinfo]
version = "0.33"
features = ["system"]
default-features = false
[dependencies.thiserror]
version = "2.0"
[dependencies.tokenizers]
version = "0.22"
features = [
"http",
"fancy-regex",
]
optional = true
default-features = false
[dependencies.tokio]
version = "1.43"
features = ["full"]
[dependencies.tracing]
version = "0.1"
[dependencies.unicode-segmentation]
version = "1.13"
[dev-dependencies.criterion]
version = "0.5"
features = ["html_reports"]
[dev-dependencies.proptest]
version = "1.6"
[dev-dependencies.tokio-test]
version = "0.4"
[dev-dependencies.toml]
version = "0.8"
[dev-dependencies.wiremock]
version = "0.6"
[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = ['cfg(feature, values("pisovereign"))']