-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCargo.toml
More file actions
227 lines (188 loc) · 6.87 KB
/
Cargo.toml
File metadata and controls
227 lines (188 loc) · 6.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
[package]
name = "litellm-rs"
version = "0.4.16"
edition = "2024"
rust-version = "1.88"
authors = ["lifcc"]
description = "A high-performance AI Gateway written in Rust, providing OpenAI-compatible APIs with intelligent routing, load balancing, and enterprise features"
documentation = "https://docs.rs/litellm-rs"
homepage = "https://github.com/majiayu000/litellm-rs"
repository = "https://github.com/majiayu000/litellm-rs"
license = "MIT"
readme = "README.md"
keywords = ["ai", "gateway", "llm", "openai", "anthropic"]
categories = ["web-programming", "api-bindings", "network-programming"]
include = [
"src/**/*",
"config/*.example",
"config/*.template",
"migrations/**/*",
"build.rs",
"Cargo.toml",
"README.md",
"LICENSE",
"LICENSE-LITELLM",
"CHANGELOG.md"
]
default-run = "gateway"
# Binary files
[[bin]]
name = "gateway"
path = "src/main.rs"
required-features = ["storage"]
[[bin]]
name = "google-gateway"
path = "src/bin/google_gateway.rs"
required-features = ["storage"]
[[bin]]
name = "pricing-tool"
path = "src/bin/pricing-tool.rs"
required-features = ["gateway"]
[dependencies]
# Web framework and async runtime
actix-web = { version = "4.9", features = ["rustls-0_23"], optional = true }
actix-cors = { version = "0.7", optional = true }
actix-multipart = { version = "0.7", optional = true }
tokio = { version = "1.35", features = ["rt-multi-thread", "macros", "sync", "time", "fs", "io-util", "signal"] }
tokio-stream = "0.1"
tokio-util = "0.7"
futures = "0.3"
async-trait = "0.1"
async-stream = "0.3"
pin-project-lite = "0.2"
paste = "1"
# HTTP client
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls", "multipart"], default-features = false }
# Serialization and deserialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yml = "0.0.12"
rmp-serde = "1.3"
# Database and storage
# NOTE: default-features = false is critical to avoid pulling in sqlx-mysql and its vulnerable RSA dependency
sea-orm = { version = "1.1", features = ["macros", "with-chrono", "with-uuid", "with-json"], default-features = false, optional = true }
sea-orm-migration = { version = "1.1", default-features = false, optional = true }
redis = { version = "1.0", features = ["tokio-comp", "cluster", "streams", "aio", "connection-manager"], optional = true }
# Caching
lru = "0.16"
# Object storage (S3 compatible)
object_store = { version = "0.13", features = ["aws", "gcp", "azure"], optional = true }
aws-sdk-s3 = { version = "1.120", optional = true }
aws-sdk-secretsmanager = { version = "1.70", optional = true }
aws-config = { version = "1.5", optional = true }
# Cloud secret managers
google-cloud-secretmanager-v1 = { version = "~1.3", optional = true }
google-cloud-auth = { version = "~1.4", optional = true }
azure_security_keyvault_secrets = { version = "0.10", optional = true }
azure_identity = { version = "0.31", optional = true }
azure_core = { version = "0.31", optional = true }
vaultrs = { version = "0.7", optional = true }
# Authentication and security
jsonwebtoken = "9.3"
argon2 = { version = "0.5", optional = true }
uuid = { version = "1.11", features = ["v4", "serde"] }
sha2 = "0.10"
hmac = "0.12"
rand = "0.9"
aes-gcm = { version = "0.10", optional = true }
regex = "1.10"
hex = "0.4"
url = "2.5"
base64 = "0.22"
dirs = "6"
# Monitoring and tracing
tracing = "0.1"
tracing-subscriber = { version = "0.3.20", features = ["env-filter", "json"], optional = true }
sysinfo = { version = "0.32", optional = true }
# Middleware and utilities
bytes = "1.5"
# Configuration management
clap = { version = "4.4", features = ["derive", "env"], optional = true }
dotenvy = "0.15"
# JSON Schema validation
jsonschema = { version = "0.28", optional = true }
# Error handling
thiserror = "2.0"
# Time handling
chrono = { version = "0.4", features = ["serde"] }
# Concurrency and synchronization
parking_lot = "0.12"
arc-swap = "1.6"
dashmap = "5.5"
# Development dependencies
[dev-dependencies]
tokio-test = "0.4.4"
criterion = { version = "0.6.0", features = ["html_reports"] }
tempfile = "3.20.0"
# Library
[lib]
name = "litellm_rs"
path = "src/lib.rs"
# Build optimizations
[profile.release]
lto = true
codegen-units = 1
panic = "abort"
strip = true
[profile.dev]
debug = true
opt-level = 0
# Feature flags
[features]
# Default: gateway with SQLite storage (use --all-features or --features providers-extra,providers-extended for full provider set)
default = ["sqlite", "redis", "metrics", "tracing"]
# Gateway mode: HTTP server with full middleware stack
gateway = [
"dep:actix-web", "dep:actix-cors", "dep:actix-multipart",
"dep:argon2", "dep:aes-gcm", "dep:clap"
]
# Lite mode: API-only, no storage (use with --no-default-features)
# Example: cargo build --no-default-features --features "metrics,tracing"
lite = ["metrics", "tracing"]
# Provider compilation tiers (for reducing build size when using --no-default-features)
# - providers-extra: additional built-in provider implementations used by enum variants
# - providers-extended: direct provider modules not wired into the unified enum/factory path
providers-extra = []
providers-extended = []
# Storage backends (implies gateway since auth/server/monitoring require it)
storage = ["dep:sea-orm", "dep:sea-orm-migration", "gateway"]
postgres = ["storage", "sea-orm/sqlx-postgres", "sea-orm/runtime-tokio-rustls"]
sqlite = ["storage", "sea-orm/sqlx-sqlite", "sea-orm/runtime-tokio-rustls"]
redis = ["dep:redis"]
s3 = ["dep:object_store", "dep:aws-sdk-s3", "dep:aws-config"]
# Secret managers
aws-secrets = ["dep:aws-sdk-secretsmanager", "dep:aws-config"]
gcp-secrets = ["dep:google-cloud-secretmanager-v1", "dep:google-cloud-auth"]
azure-secrets = ["dep:azure_security_keyvault_secrets", "dep:azure_identity", "dep:azure_core"]
vault-secrets = ["dep:vaultrs"]
cloud-secrets = ["aws-secrets", "gcp-secrets", "azure-secrets", "vault-secrets"]
# Monitoring and observability
metrics = ["dep:sysinfo"]
tracing = ["dep:tracing-subscriber"]
# JSON Schema validation for MCP tool parameters
mcp-validation = ["dep:jsonschema"]
# Advanced features
vector-db = []
websockets = []
analytics = ["metrics"]
enterprise = ["analytics", "vector-db"]
# Full feature set
full = ["gateway", "postgres", "redis", "s3", "metrics", "tracing", "vector-db", "websockets", "analytics", "cloud-secrets", "providers-extra", "providers-extended", "mcp-validation"]
# Metadata
[package.metadata.docs.rs]
# Exclude vector-db feature because qdrant-client fails on docs.rs read-only filesystem
all-features = false
features = ["gateway", "postgres", "sqlite", "redis", "s3", "metrics", "tracing", "websockets", "analytics", "providers-extra", "providers-extended"]
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.playground]
features = ["full"]
# Benchmark configuration
[[bench]]
name = "performance_benchmarks"
harness = false
[[bench]]
name = "e2e_benchmarks"
harness = false
[[example]]
name = "azure_ai_chat"
required-features = ["providers-extra"]