Skip to content

Commit b800c4c

Browse files
Merge pull request #29 from zhaochenyang20/upd_docs
[Docs] Highlight the launch with yaml
2 parents 426cd1e + 0d80ed5 commit b800c4c

4 files changed

Lines changed: 25 additions & 34 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ __pycache__/
33
*.py[codz]
44
*$py.class
55

6+
output.png
7+
68
# C extensions
79
*.so
810

README.md

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,26 @@ cd ..
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)
99118
print("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
109122
resp = 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

187176
This project is derived from [radixark/miles#544](https://github.com/radixark/miles/pull/544). Thanks to the original authors.

development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ Single benchmark:
2323
```bash
2424
python tests/benchmarks/diffusion_router/bench_router.py \
2525
--model Qwen/Qwen-Image \
26-
--num-workers 2 \
26+
--num-workers 8 \
2727
--num-prompts 20 \
28-
--max-concurrency 4
28+
--max-concurrency 8
2929
```
3030

3131
Algorithm comparison:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "sglang-diffusion-routing"
7-
version = "0.1.0"
7+
version = "0.1.1"
88
description = "Load-balancing router for SGLang diffusion workers"
99
readme = "README.md"
1010
requires-python = ">=3.10"

0 commit comments

Comments
 (0)