# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

[package]
name = "dynamo-kv-router"
description = "KV Router - Radix tree for LLM KV cache routing"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true

[features]
default = []
metrics = ["dep:dynamo-runtime"]
bench = ["dep:clap", "dep:indicatif", "dep:serde_json", "dynamo-runtime/integration", "dep:uuid", "dep:plotters"]

[dependencies]
# repo
dynamo-runtime = { workspace = true, optional = true }
dynamo-tokens = { workspace = true }

# workspace
anyhow = { workspace = true }
async-trait = { workspace = true }
dashmap = { workspace = true }
prometheus = { workspace = true }
rand = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true, optional = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
xxhash-rust = { workspace = true }

# dependencies
flume = "0.12.0"
parking_lot = { workspace = true }

# bench (optional)
clap = { version = "4.5", features = ["derive"], optional = true }
indicatif = { version = "0.18.0", optional = true }
uuid = { workspace = true, optional = true }
plotters = { version = "0.3", optional = true, default-features = false, features = ["svg_backend", "line_series", "point_series", "full_palette"] }
rustc-hash = "2.1.1"

[dev-dependencies]
dynamo-bench = { path = "../bench" }
rstest = "0.18.2"
rstest_reuse = "0.7.0"
serde_json = { workspace = true }
tokio = { workspace = true, features = ["rt", "macros", "time"] }
dynamo-mocker = { workspace = true }
dynamo-tokens = { workspace = true }
minstant = "0.1.7"


[[bench]]
name = "radix_tree_microbench"
harness = false
required-features = ["bench"]

[[bench]]
name = "kv_indexer_bench"
harness = false
required-features = ["bench"]

[[bench]]
name = "mooncake_bench"
harness = false
required-features = ["bench"]
