test_bindings.py 469 Bytes
Newer Older
1
import sglang_router as router
2
3
4
5
6
7
8
9
10
11
12
13

# Create a Router instance with:
# - host: the address to bind to (e.g., "127.0.0.1")
# - port: the port number (e.g., 3001)
# - worker_urls: list of worker URLs to distribute requests to
router = router.Router(
    host="127.0.0.1",
    port=3001,
    worker_urls=[
        "http://localhost:30000",
        "http://localhost:30002",
    ],
Chayenne's avatar
Chayenne committed
14
    policy="random",
15
16
17
18
)

# Start the router - this will block and run the server
router.start()