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

[package]
name = "dynamo-llm"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
readme.workspace = true
description = "Dynamo LLM Library"

[features]
default = ["block-manager"]
# todo(ops): get this working in CI as a default.
# default = ["block-manager", "testing-full"]

testing-full = ["testing-cuda", "testing-nixl"]
testing-cuda = ["dep:cudarc", "dynamo-memory/testing-cuda"]
testing-nixl = ["dep:nixl-sys", "dynamo-memory/testing-nixl"]
testing-etcd = []
block-manager = ["dep:nixl-sys", "dep:cudarc", "dep:nix", "dep:aligned-vec"]
block-manager-bench = ["block-manager", "testing-full", "dep:clap", "dep:indicatif"]
cuda = ["dep:cudarc"]
integration = ["dynamo-runtime/integration"]
media-ffmpeg = ["dep:video-rs", "dep:ffmpeg-next", "dep:memfile"]
bench = ["dynamo-kv-router/bench"]
kv-router-stress = ["dep:clap", "dep:indicatif", "bench"]

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

[[bench]]
name = "transfer_context_v2"
harness = false
required-features = ["block-manager", "testing-cuda"]

[[bench]]
name = "kv_router_bench"
harness = false
required-features = ["kv-router-stress"]

[dependencies]
# repo
dynamo-runtime = { workspace = true }
dynamo-tokens = { workspace = true }
dynamo-kv-router = { workspace = true, features = ["metrics"] }
dynamo-memory = { workspace = true }
dynamo-mocker = { workspace = true }

# workspace
aho-corasick = "1.1"
anyhow = { workspace = true }
dynamo-async-openai = { workspace = true }
dynamo-parsers = { workspace = true }
async-stream = { workspace = true }
async-trait = { workspace = true }
async-nats = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
derive_builder = { workspace = true }
either = { workspace = true }
futures = { workspace = true }
futures-util = "0.3.31"
hf-hub = { workspace = true }
humantime = { workspace = true }                           # input/batch
rand = { workspace = true }
oneshot = { workspace = true }
parking_lot = { workspace = true }
prometheus = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
strum = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tmq = { workspace = true }
tokio = { workspace = true }
tokio-stream = { workspace = true }
tokio-util = { workspace = true }
tracing = { workspace = true }
validator = { workspace = true }
url = { workspace = true }
uuid = { workspace = true }
xxhash-rust = { workspace = true }
modelexpress-client = { workspace = true }
modelexpress-common = { workspace = true }
bitflags = { version = "2.4", features = ["serde"] }
blake3 = { version = "1.8", features = ["mmap", "rayon"] }
bytemuck = "1.22"
# candle-core = { version = "0.9.1" }
derive-getters = "0.5"
offset-allocator = "0.2"
rayon = "1"
dashmap = { version = "5.5.3" }
bincode = { version = "2.0.1", features = ["serde", "derive"] }

# lora
object_store = { version = "0.12.4", features = ["aws", "gcp", "azure", "http"] }

# input/text
dialoguer = { version = "0.11", default-features = false, features = [
  "editor",
  "history",
] }

# block_manager
aligned-vec = { version = "0.6.4", optional = true }
nixl-sys = { version = "=0.10.1", optional = true }
cudarc = { workspace = true, optional = true }
nix = { version = "0.26", optional = true }

# media (zlib compression for NIXL metadata)
flate2 = { version = "1" }

# block_manager_bench
clap = { version = "4.5.49", features = ["derive"], optional = true }
indicatif = { version = "0.18.0", optional = true }

# http-service
axum = { workspace = true }
axum-server = { version = "0.7", features = ["tls-rustls"] }
tower-http = { workspace = true }
rustls = { version = "0.23" }
utoipa = { version = "5.3", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "9.0", features = ["axum"] }


# grpc-service
# ping version to 0.13.1 so it depends on prost 0.13.5
# which is used across other libraries
tonic = { version = "0.13.1" }
# Request prost specifically so tonic-build properly compiles protobuf message
prost = { version = "0.13.5" }

# tokenizers
tokenizers = { version = "0.21.4", default-features = false, features = [
  "onig",
  "esaxx_fast",
  "rustls-tls",
] }
tiktoken-rs = { version = "0.9", default-features = false }
rustc-hash = "1.1"

# backend
galil-seiferas = { version = "0.1" }

# preprocessor
bs62 = { version = "0.1" }
minijinja = { version = "2.15.1", features = ["loader", "loop_controls"] }
minijinja-contrib = { version = "2.15.1", features = ["pycompat"] }
json-five = { version = "0.3" }

# media loading in the preprocessor
reqwest = { workspace = true }
base64 = { version = "0.22" }
image = { version = "0.25", features = ["serde"] }
video-rs = { version = "0.10.5", optional = true }
ffmpeg-next = { version = "7.1.0", optional = true }
memfile = { version = "0.3.2", optional = true }
tokio-rayon = {version = "2" }
ndarray = { version = "0.16" }

# Publishers
zeromq = "0.4.1"
rmp-serde = "1.3"

[dev-dependencies]
approx = "0.5"
assert_matches = "1.5"
criterion = { version = "0.3", features = ["html_reports"] }
hf-hub = { workspace = true }
modelexpress-client = { workspace = true }
modelexpress-common = { workspace = true }
reqwest = { workspace = true }
rstest = "0.18.2"
serial_test = "3"
temp-env = { version = "0.3.6", features = ["async_closure"] }
tempfile = "3.17.1"
insta = { version = "1.41", features = [
  "glob",
  "json",
  "redactions",
  "filters",
] }

lazy_static = "1.4"
mockito = "1.7.0"
dynamo-bench = { path = "../bench" }

[[bin]]
name = "generate-frontend-openapi"
path = "src/bin/generate_frontend_openapi.rs"

[build-dependencies]
tonic-build = { version = "0.13.1" }

[[bin]]
name = "bench_local_transfer_v2"
path = "bin/bench_local_transfer_v2.rs"
required-features = ["block-manager-bench"]

