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

6
[features]
7
default = ["huggingface", "grpc-client"]
8
huggingface = ["tokenizers", "minijinja"]
9
tiktoken = ["tiktoken-rs"]
10
11
grpc-client = []
grpc-server = []
12

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

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

23
[dependencies]
24
clap = { version = "4", features = ["derive"] }
25
26
27
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"] }
28
serde = { version = "1.0", features = ["derive"] }
29
serde_json = "1.0"
30
bytes = "1.8.0"
31
rand = "0.9.2"
32
reqwest = { version = "0.12.8", features = ["stream", "blocking", "json"] }
33
futures-util = "0.3"
34
futures = "0.3"
35
pyo3 = { version = "0.25.1", features = ["extension-module"] }
36
37
dashmap = "6.1.0"
http = "1.1.0"
38
39
tokio = { version = "1.42.0", features = ["full"] }
async-trait = "0.1"
40
41
42
43
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "chrono"] }
tracing-log = "0.2"
tracing-appender = "0.2.3"
44
chrono = "0.4"
45
46
kube = { version = "1.1.0", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.25.0", features = ["v1_33"] }
47
48
metrics = "0.24.2"
metrics-exporter-prometheus = "0.17.0"
49
uuid = { version = "1.10", features = ["v4", "serde"] }
50
thiserror = "2.0.12"
51
regex = "1.10"
52
url = "2.5.4"
53
tokio-stream = { version = "0.1", features = ["sync"] }
54
anyhow = "1.0"
55
tokenizers = { version = "0.21.4", optional = true }
56
57
tiktoken-rs = { version = "0.7.0", optional = true }
minijinja = { version = "2.0", optional = true }
58
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
59

60
61
62
63
64
65
66
67
68
69
70
71
# 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"] }

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

72
73
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
74
75
76
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
portpicker = "0.1"
77
tempfile = "3.8"
78
lazy_static = "1.4"
79
80
81
82
83
84

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

85
86
87
88
89
[[bench]]
name = "tokenizer_benchmark"
harness = false
path = "benches/tokenizer_benchmark.rs"

Chang Su's avatar
Chang Su committed
90
91
92
93
94
[[bench]]
name = "tool_parser_benchmark"
harness = false
path = "benches/tool_parser_benchmark.rs"

95
96
97
[profile.release]
lto = "thin"
codegen-units = 1
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112

[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