Views
No views yet



1docker run -it --gpus all lmsysorg/sglang:v0.5.2
2# make sure each node use the following commands to install the custom SGLang branch
3git clone -b keye-dpsk-infer-fp8-release https://github.com/Kwai-Keye/sglang.git sglang
4pip install -e sglang/python[all]1MODEL_PATH=/path/to/Keye-VL-671B-A37B
2DIST_INIT_ADDR="MASTER_NODE_IP:29500" # e.g. 192.168.1.100:29500
3PORT=30000 # listening port on each node
4python3 -m sglang.launch_server \
5 --model-path $MODEL_PATH \
6 --host 0.0.0.0 \
7 --port $PORT \
8 --tp-size 16 \
9 --nnodes 2 \
10 --node-rank 0 \
11 --dist-init-addr $DIST_INIT_ADDR \
12 --trust-remote-code \
13 --mm-attention-backend fa3 \
14 --attention-backend fa3 \
15 --disable-radix-cache \
16 --mem-fraction-static 0.8 \
17 --cuda-graph-max-bs 64 \
18 --model-loader-extra-config '{"enable_multithread_load": true, "num_threads": 32}'1MODEL_PATH=/path/to/Keye-VL-671B-A37B
2DIST_INIT_ADDR="MASTER_NODE_IP:29500" # e.g. 192.168.1.100:29500
3PORT=30000 # listening port on each node
4python3 -m sglang.launch_server \
5 --model-path $MODEL_PATH \
6 --host 0.0.0.0 \
7 --port $PORT \
8 --tp-size 16 \
9 --nnodes 2 \
10 --node-rank 1 \
11 --dist-init-addr $DIST_INIT_ADDR \
12 --trust-remote-code \
13 --mm-attention-backend fa3 \
14 --attention-backend fa3 \
15 --disable-radix-cache \
16 --mem-fraction-static 0.8 \
17 --cuda-graph-max-bs 64 \
18 --model-loader-extra-config '{"enable_multithread_load": true, "num_threads": 32}'1import json
2import requests
3
4BASE_URL = "http://MASTER_NODE_IP:30000"
5
6def generate(messages):
7 payload = {
8 "model": "",
9 "messages": messages,
10 "n": 1,
11 "temperature": 0.0,
12 "max_tokens": 256,
13 "top_k": 1,
14 "ignore_eos": False,
15 "skip_special_tokens": True,
16 }
17 resp = requests.post(
18 f"{BASE_URL}/v1/chat/completions",
19 headers={"Content-Type": "application/json"},
20 data=json.dumps(payload),
21 timeout=1800,
22 )
23 resp.raise_for_status()
24 return resp.json()
25
26# Example: image + text
27messages = [
28 {
29 "role": "user",
30 "content": [
31 {
32 "type": "image_url",
33 "image_url": {"url": "https://raw.githubusercontent.com/sgl-project/sglang/main/assets/logo.png"},
34 },
35 {"type": "text", "text": "Describe this image in detail./think"},
36 ],
37 }
38]
39
40result = generate(messages)
41print(result["choices"][0]["message"]["content"])