agg_router.sh 1 KB
Newer Older
1
2
3
4
5
6
7
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Setup cleanup trap
cleanup() {
    echo "Cleaning up background processes..."
8
9
    kill $DYNAMO_PID $WORKER_PID 2>/dev/null || true
    wait $DYNAMO_PID $WORKER_PID 2>/dev/null || true
10
11
12
13
14
15
    echo "Cleanup complete."
}
trap cleanup EXIT INT TERM


# run ingress
16
python -m dynamo.frontend --router-mode kv --http-port=8000 &
17
18
19
DYNAMO_PID=$!

# run worker
20
python3 -m dynamo.sglang \
21
22
  --model-path Qwen/Qwen3-0.6B \
  --served-model-name Qwen/Qwen3-0.6B \
23
24
25
  --page-size 16 \
  --tp 1 \
  --trust-remote-code \
26
27
28
  --kv-events-config '{"publisher":"zmq","topic":"kv-events","endpoint":"tcp://*:5557"}' &
WORKER_PID=$!

29
CUDA_VISIBLE_DEVICES=1 python3 -m dynamo.sglang \
30
31
  --model-path Qwen/Qwen3-0.6B \
  --served-model-name Qwen/Qwen3-0.6B \
32
33
34
  --page-size 16 \
  --tp 1 \
  --trust-remote-code \
35
  --kv-events-config '{"publisher":"zmq","topic":"kv-events","endpoint":"tcp://*:5558"}'