Cargo.toml 3.74 KB
Newer Older
1
[package]
2
name = "sglang_router_rs"
3
4
5
version = "0.0.0"
edition = "2021"

6
[features]
7
default = ["grpc-client"]
8
9
grpc-client = []
grpc-server = []
10

11
12
13
[lints.rust]
unused_qualifications = "warn"

14
[lib]
15
name = "sglang_router_rs"
16
17
18
# Pure Rust library: Just omit crate-type (defaults to rlib)
# Python/C binding + Rust library: Use ["cdylib", "rlib"]
crate-type = ["cdylib", "rlib"]
19

20
21
22
23
[[bin]]
name = "sglang-router"
path = "src/main.rs"

24
[dependencies]
25
clap = { version = "4", features = ["derive", "env"] }
26
27
28
axum = { version = "0.8.4", features = ["macros", "ws", "tracing"] }
tower = { version = "0.5", features = ["full"] }
tower-http = { version = "0.6", features = ["trace", "compression-gzip", "cors", "timeout", "limit", "request-id", "util"] }
29
serde = { version = "1.0", features = ["derive"] }
30
31
32
33
serde_json = { version = "1.0", default-features = false, features = [
    "std",
    "preserve_order",
] }
34
bytes = "1.8.0"
35
rand = "0.9.2"
36
reqwest = { version = "0.12.8", features = ["stream", "blocking", "json", "rustls-tls"], default-features = false }
37
futures-util = "0.3"
38
futures = "0.3"
39
pyo3 = { version = "0.25.1", features = ["extension-module"] }
40
dashmap = "6.1.0"
41
blake3 = "1.5"
42
http = "1.1.0"
43
44
tokio = { version = "1.42.0", features = ["full"] }
async-trait = "0.1"
45
46
47
48
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
tracing-log = "0.2"
tracing-appender = "0.2.3"
49
chrono = "0.4"
50
51
kube = { version = "1.1.0", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.25.0", features = ["v1_33"] }
52
53
metrics = "0.24.2"
metrics-exporter-prometheus = "0.17.0"
54
uuid = { version = "1.10", features = ["v4", "serde"] }
55
56
ulid = "1.2.1"
parking_lot = "0.12.4"
57
rayon = "1.10"
58
thiserror = "2.0.12"
59
regex = "1.10"
60
url = "2.5.4"
61
validator = { version = "0.18", features = ["derive"] }
62
tokio-stream = { version = "0.1", features = ["sync"] }
63
anyhow = "1.0"
64
65
tokenizers = { version = "0.22.0" }
tiktoken-rs = { version = "0.7.0" }
66
minijinja = { version = "2.0", features = ["unstable_machinery", "json", "builtins"] }
67
minijinja-contrib = { version = "2.0", features = ["pycompat"] }
68
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
69
hf-hub = { version = "0.4.3", features = ["tokio"] }
70
rmcp = { version = "0.8.3", features = ["client", "server",
71
72
73
74
75
76
77
78
    "transport-child-process",
    "transport-sse-client-reqwest",
    "transport-streamable-http-client-reqwest",
    "transport-streamable-http-server",
    "transport-streamable-http-server-session",
    "reqwest",
    "auth"] }
serde_yaml = "0.9"
79
oracle = { version = "0.6.3", features = ["chrono"] }
80
subtle = "2.6"
81
82
rustpython-parser = "0.4.0"
num-traits = "0.2"
83

84
85
86
87
88
89
90
# gRPC and Protobuf dependencies
tonic = { version = "0.12", features = ["tls", "gzip", "transport"] }
prost = "0.13"
prost-types = "0.13"
deadpool = { version = "0.12", features = ["managed", "rt_tokio_1"] }
backoff = { version = "0.4", features = ["tokio"] }
strum = { version = "0.26", features = ["derive"] }
91
once_cell = "1.21.3"
92
93
94
95
96

[build-dependencies]
tonic-build = "0.12"
prost-build = "0.13"

97
98
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
99
100
101
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
portpicker = "0.1"
102
tempfile = "3.8"
103
lazy_static = "1.4"
104
105
106
107
108
109

[[bench]]
name = "request_processing"
harness = false
path = "benches/request_processing.rs"

110
111
112
113
114
[[bench]]
name = "tokenizer_benchmark"
harness = false
path = "benches/tokenizer_benchmark.rs"

Chang Su's avatar
Chang Su committed
115
116
117
118
119
[[bench]]
name = "tool_parser_benchmark"
harness = false
path = "benches/tool_parser_benchmark.rs"

120
121
122
[profile.release]
lto = "thin"
codegen-units = 1
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137

[profile.dev]
opt-level = 0
debug = true
split-debuginfo = "unpacked"
incremental = true


[profile.dev.build-override]
opt-level = 3
codegen-units = 1

[profile.dev-opt]
inherits = "dev"
opt-level = 1