# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
name = "synapse-gateway"
version = "0.5.4"
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
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",
]
license = "AGPL-3.0-only"
repository = "https://github.com/sustentabilitas/synapse-gateway"

[features]
default = [
    "server",
    "ledger-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",
]
ledger-sqlite = [
    "dep:sqlx",
    "sqlx/sqlite",
]
server = [
    "dep:axum",
    "dep:tower",
    "dep:tower-http",
    "dep:metrics-exporter-prometheus",
]

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

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

[[example]]
name = "embed"
path = "examples/embed.rs"

[[test]]
name = "chat_completions"
path = "tests/chat_completions.rs"

[[test]]
name = "embeddings"
path = "tests/embeddings.rs"

[[test]]
name = "guardrails_http"
path = "tests/guardrails_http.rs"

[[test]]
name = "ledger_sqlite"
path = "tests/ledger_sqlite.rs"

[[test]]
name = "vertex_native_e2e"
path = "tests/vertex_native_e2e.rs"

[[test]]
name = "vertex_native_gateway"
path = "tests/vertex_native_gateway.rs"

[dependencies.anyhow]
version = "1"

[dependencies.async-trait]
version = "0.1"

[dependencies.aws-config]
version = "1"
optional = true

[dependencies.aws-sdk-sns]
version = "1"
optional = true

[dependencies.axum]
version = "0.8"
optional = true

[dependencies.backon]
version = "1.5"

[dependencies.base64]
version = "0.22"

[dependencies.bytes]
version = "1"

[dependencies.chrono]
version = "0.4"
features = ["serde"]

[dependencies.futures]
version = "0.3"

[dependencies.genai]
version = "=0.6.0-beta.19"

[dependencies.google-cloud-auth]
version = "1.9"

[dependencies.google-cloud-googleapis]
version = "0.16"
optional = true

[dependencies.google-cloud-pubsub]
version = "0.30"
optional = true

[dependencies.llm-guard]
version = "0.2"

[dependencies.metrics]
version = "0.24"

[dependencies.metrics-exporter-prometheus]
version = "0.16"
features = ["http-listener"]
optional = true
default-features = false

[dependencies.once_cell]
version = "1.19"

[dependencies.parking_lot]
version = "0.12"

[dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "stream",
]

[dependencies.rustls]
version = "0.23"
features = [
    "aws-lc-rs",
    "std",
]
default-features = false

[dependencies.serde]
version = "1"
features = ["derive"]

[dependencies.serde_json]
version = "1"
features = ["preserve_order"]

[dependencies.sqlx]
version = "0.8"
features = [
    "runtime-tokio",
    "chrono",
    "macros",
]
optional = true
default-features = false

[dependencies.tap]
version = "1"

[dependencies.thiserror]
version = "1"

[dependencies.tokio]
version = "1"
features = ["full"]

[dependencies.toml]
version = "0.8"

[dependencies.tower]
version = "0.5"
optional = true

[dependencies.tower-http]
version = "0.6"
features = [
    "cors",
    "trace",
]
optional = true

[dependencies.tracing]
version = "0.1"

[dependencies.tracing-subscriber]
version = "0.3"
features = [
    "env-filter",
    "fmt",
]

[dependencies.uuid]
version = "1"
features = ["v4"]

[dev-dependencies.http-body-util]
version = "0.1"

[dev-dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "stream",
]

[dev-dependencies.tower]
version = "0.5"
features = ["util"]

[dev-dependencies.wiremock]
version = "0.6"
