4141
4242## Quick Start
4343
44+ ### Co-launch workers and router via YAML config
45+
46+ Instead of starting workers manually, you can let the router spawn and manage them via a YAML config file.
47+
48+ ``` bash
49+ sglang-d-router --port 30081 --launcher-config examples/local_launcher.yaml
50+ ```
51+
52+ ``` yaml
53+ launcher :
54+ backend : local
55+ model : Qwen/Qwen-Image
56+ num_workers : 8
57+ num_gpus_per_worker : 1
58+ worker_base_port : 10090
59+ wait_timeout : 600
60+ ` ` `
61+
62+ ### Manual Launch Workers and Connect to Router
63+
4464` ` ` bash
4565# If connect to HuggingFace is not allowed
4666# You can set the environment variable SGLANG_USE_MODELSCOPE=TRUE
@@ -65,7 +85,6 @@ sglang-d-router --port 30081 \
6585
6686## Demonstrative Examples
6787
68-
6988### With Python Requests
7089
7190``` python
@@ -98,12 +117,6 @@ with open("output.png", "wb") as f:
98117 f.write(img)
99118print (" Saved to output.png" )
100119
101- # Video generation request
102- resp = requests.post(f " { ROUTER } /generate_video " , json = {
103- " model" : " Qwen/Qwen-Image" ,
104- " prompt" : " a flowing river" ,
105- })
106- print (resp.json())
107120
108121# Check per-worker health and load
109122resp = requests.get(f " { ROUTER } /health_workers " )
@@ -158,30 +171,6 @@ curl -X POST http://localhost:30081/update_weights_from_disk \
158171 -d ' {"model_path": "Qwen/Qwen-Image-2512"}'
159172```
160173
161- ### Auto-launch workers via YAML config
162-
163- Instead of starting workers manually, you can let the router spawn and manage
164- them through a launcher backend.
165-
166- ** Local subprocess launcher** (` examples/local_launcher.yaml ` ):
167-
168- ``` bash
169- sglang-d-router --port 30081 --launcher-config examples/local_launcher.yaml
170- ```
171-
172- ``` yaml
173- launcher :
174- backend : local
175- model : Qwen/Qwen-Image
176- num_workers : 2
177- num_gpus_per_worker : 1
178- worker_base_port : 10090
179- wait_timeout : 600
180- ` ` `
181-
182- Fields not set in the YAML fall back to defaults defined in each backend's
183- config dataclass (see ` LocalLauncherConfig`).
184-
185174## Acknowledgment
186175
187176This project is derived from [ radixark/miles #544 ] ( https://github.com/radixark/miles/pull/544 ) . Thanks to the original authors.
0 commit comments