[package]
name = "liter-llm-proxy"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
description = "OpenAI-compatible LLM proxy server — model routing, virtual keys, rate limiting, cost tracking."
keywords = ["llm", "proxy", "openai", "gateway", "xberg"]

[package.metadata.cargo-machete]
ignored = ["opentelemetry", "tracing-opentelemetry", "notify", "tracing-test"]

[features]
# OTel export bridge — forwarded to the core `liter-llm/otel` feature.
# OTel is the single observability surface; no prometheus feature exists by design.
otel = ["liter-llm/otel", "dep:opentelemetry", "dep:tracing-opentelemetry"]

# Caching layer backed by opendal — forwarded to `liter-llm/opendal-cache`.
opendal-cache = ["liter-llm/opendal-cache"]

# `proxy` — MCP server, files, batches, and responses endpoints.
# All are always compiled into the proxy binary; this feature is a named
# surface so upstream crates can depend on the proxy with explicit intent.
proxy = []

# Secret backends.
# `secrets-aws`   — AWS Secrets Manager via `aws-sdk-secretsmanager`.
# `secrets-vault` — HashiCorp Vault KV-v2 via `vaultrs`.
# The `env://` backend is always available with no feature gate.
secrets-aws = ["dep:aws-config", "dep:aws-sdk-secretsmanager"]
secrets-vault = ["dep:vaultrs", "dep:chrono"]

# `etcd-watch` — etcd-backed config watch via `etcd-client`. Off by default to
# avoid the transitive `protoc`/`prost-build` requirement in sandboxed builds.
etcd-watch = ["dep:etcd-client"]

# `full` — all proxy features: otel + opendal-cache + both secret backends + etcd watch.
full = [
    "otel",
    "opendal-cache",
    "proxy",
    "secrets-aws",
    "secrets-vault",
    "etcd-watch",
]

default = ["proxy"]

[dependencies]
arc-swap = { workspace = true }

# Feature-gated: secrets-aws
aws-config = { workspace = true, optional = true }
aws-sdk-secretsmanager = { workspace = true, optional = true }
axum = { workspace = true }
base64 = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true, optional = true }
dashmap = { workspace = true }
etcd-client = { workspace = true, optional = true }
futures-util = { workspace = true }
http = { workspace = true }
liter-llm = { path = "../liter-llm", version = "1.9.0-rc.2", features = [
    "native-http",
    "tower",
    "tracing",
] }
notify = { workspace = true }
opendal = { workspace = true }

# Feature-gated: OTel
opentelemetry = { workspace = true, optional = true }
rmcp = { workspace = true }
rust_decimal = { workspace = true }
schemars = { workspace = true }
secrecy = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
subtle = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-tungstenite = { workspace = true }
tokio-util = { workspace = true }
toml = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true }
tracing = { workspace = true }
tracing-opentelemetry = { workspace = true, optional = true }
url = { workspace = true }
utoipa = { workspace = true }

# Feature-gated: secrets-vault
vaultrs = { workspace = true, optional = true }

[dev-dependencies]
ctor = "1.0"
http-body-util = "0.1"
reqwest = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }
tracing-test = "0.2"
wiremock = "0.6"

[lints]
workspace = true
