[package]
name = "synapse-gateway"
version = "0.5.4"
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "OpenAI-compatible LLM router and gateway with streaming, tool calling, multi-provider fallback, native Vertex AI, and per-tenant cost accounting"
readme = "README.md"
keywords = ["llm", "gateway", "openai", "vertex-ai", "proxy"]
categories = ["web-programming::http-server", "api-bindings"]

[lib]
name = "synapse"
path = "src/lib.rs"

[[bin]]
name = "synapse-gateway"
path = "src/main.rs"
required-features = ["server"]

[dependencies]
axum = { workspace = true, optional = true }
tokio = { workspace = true }
tower = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }
reqwest = { workspace = true }
genai = "=0.6.0-beta.19"
google-cloud-auth = "1.9"
rustls = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
toml = { workspace = true }
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "chrono", "macros"], optional = true }
google-cloud-pubsub = { version = "0.30", optional = true }
google-cloud-googleapis = { version = "0.16", optional = true }
aws-sdk-sns = { version = "1", optional = true }
aws-config = { version = "1", optional = true }
backon = "1.5"
parking_lot = "0.12"
once_cell = "1.19"
futures = { workspace = true }
async-trait = "0.1"
bytes = { workspace = true }
base64 = "0.22"
llm-guard = "0.2"
tap = "1"
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", features = ["serde"] }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
metrics = "0.24"
metrics-exporter-prometheus = { version = "0.16", default-features = false, features = ["http-listener"], optional = true }
anyhow = { workspace = true }
thiserror = "1"

[dev-dependencies]
wiremock = "0.6"
http-body-util = "0.1"
tower = { workspace = true, features = ["util"] }
reqwest = { workspace = true }

[features]
default = ["server", "ledger-sqlite"]
server = ["dep:axum", "dep:tower", "dep:tower-http", "dep:metrics-exporter-prometheus"]
ledger-sqlite = ["dep:sqlx", "sqlx/sqlite"]
ledger-postgres = ["dep:sqlx", "sqlx/postgres"]
ledger-pubsub = ["dep:google-cloud-pubsub", "dep:google-cloud-googleapis"]
ledger-sns = ["dep:aws-sdk-sns", "dep:aws-config"]
