Skip to content

Commit 9a78c3e

Browse files
change banner
1 parent 72bb07e commit 9a78c3e

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ with open("output.png", "wb") as f:
135135
print("Saved to output.png")
136136

137137
# Video generation request
138+
# Note that Qwen-Image does not support video generation,
139+
# so this request will fail.
140+
138141
resp = requests.post(f"{ROUTER}/v1/videos", json={
139142
"model": "Qwen/Qwen-Image",
140143
"prompt": "a flowing river",
@@ -206,8 +209,6 @@ curl -X POST http://localhost:30081/update_weights_from_disk \
206209
-d '{"model_path": "Qwen/Qwen-Image-2512"}'
207210
```
208211

209-
---
210-
211212
## Router API
212213

213214
### Inference Endpoints
@@ -246,7 +247,7 @@ Video query routing is stable by `video_id`: router caches `video_id -> worker`
246247
| `PUT` | `/workers/{worker_id}` | Update worker configuration |
247248
| `DELETE` | `/workers/{worker_id}` | Deregister a worker |
248249

249-
`worker_id` is the URL-encoded worker URL.
250+
`worker_id` is the URL-encoded worker URL (machine-oriented), and each worker payload also includes `display_id` as a human-readable ID.
250251

251252
`PUT /workers/{worker_id}` currently supports:
252253
- `is_dead` (boolean): quarantine (`true`) or recover (`false`) this worker.
@@ -258,7 +259,6 @@ Video query routing is stable by `video_id`: router caches `video_id -> worker`
258259
|---|---|---|
259260
| `POST` | `/update_weights_from_disk` | Reload weights from disk on all healthy workers |
260261

261-
---
262262

263263
## Acknowledgment
264264

examples/local_launcher.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
launcher:
22
model: Qwen/Qwen-Image
33

4-
num_workers: 1
4+
num_workers: 8
55
num_gpus_per_worker: 1
66
worker_host: "127.0.0.1"
77
worker_base_port: 10090

src/sglang_diffusion_routing/cli/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def _print_fired_up_banner(log_prefix: str) -> None:
2424
|___/
2525
2626
____ _ _____ _
27-
| _ \ ___ _ _| |_ ___ _ _ | ___(_)_ __ ___ __| | _ _ _ __
28-
| |_) / _ \| | | | __/ _ \ '__| |_ | | '__/ _ \/ _` | | | | | '_ \
27+
| _ \ ___ _ _| |_ ___ ____| ___(_)_ __ ___ __| | _ _ _ __
28+
| |_) / _ \| | | | __/ _ \ __| |_ | | '__/ _ \/ _` | | | | | '_ \
2929
| _ < (_) | |_| | || __/ | | _| | | | | __/ (_| | | |_| | |_) |
30-
|_| \_\___/ \__,_|\__\___|_| |_| |_|_| \___|\__,_| |\__,_| .__/
30+
|_| \_\___/ \__,_|\__\___|_| |_| |_|_| \___|\__,_| \__,_| .__/
3131
|_|
3232
3333
"""

src/sglang_diffusion_routing/router/diffusion_router.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,9 +469,18 @@ def decode_worker_id(cls, worker_id: str) -> str:
469469
raise ValueError("worker_id cannot be empty")
470470
return cls.normalize_worker_url(decoded)
471471

472+
@staticmethod
473+
def build_worker_display_id(worker_url: str) -> str:
474+
"""Build a human-readable worker identifier from URL."""
475+
parsed = urlsplit(worker_url)
476+
if parsed.netloc:
477+
return parsed.netloc
478+
return worker_url
479+
472480
def _build_worker_payload(self, worker_url: str) -> dict:
473481
return {
474482
"worker_id": self.encode_worker_id(worker_url),
483+
"display_id": self.build_worker_display_id(worker_url),
475484
"url": worker_url,
476485
"active_requests": self.worker_request_counts.get(worker_url, 0),
477486
"is_dead": worker_url in self.dead_workers,

0 commit comments

Comments
 (0)