You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/router/router.md
+57-7Lines changed: 57 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@ The router is a independent Python package, and it can be used as a drop-in repl
7
7
## Installation
8
8
9
9
```bash
10
-
pip install sglang-router
10
+
$ pip install sglang-router
11
11
```
12
12
13
13
Detailed usage of the router can be found in [launch_router](https://github.com/sgl-project/sglang/blob/main/rust/py_src/sglang_router/launch_router.py) and [launch_server](https://github.com/sgl-project/sglang/blob/main/rust/py_src/sglang/launch_server.py). Also, you can directly run the following command to see the usage of the router.
14
14
15
15
```bash
16
-
python -m sglang_router.launch_server --help
17
-
python -m sglang_router.launch_router --help
16
+
$ python -m sglang_router.launch_server --help
17
+
$ python -m sglang_router.launch_router --help
18
18
```
19
19
20
20
The router supports two working modes:
@@ -27,7 +27,7 @@ The router supports two working modes:
27
27
This will be a drop-in replacement for the existing `--dp-size` arguement of SGLang Runtime. Under the hood, it uses multi-processes to launch multiple workers, wait for them to be ready, then connect the router to all workers.
After the server is ready, you can directly send requests to the router as the same way as sending requests to each single worker.
@@ -47,12 +47,62 @@ print(response.json())
47
47
This is useful for multi-node DP. First, launch workers on multiple nodes, then launch a router on the main node, and connect the router to all workers.
@@ -158,7 +62,7 @@ For development purposes, you can install the package in editable mode:
158
62
Warning: Using editable python binding can suffer from performance degradation!! Please build a fresh wheel for every update if you want to test performance.
159
63
160
64
```bash
161
-
pip install -e .
65
+
$ pip install -e .
162
66
```
163
67
164
68
**Note:** When modifying Rust code, you must rebuild the wheel for changes to take effect.
0 commit comments