Update SGLang quickstart to the official SGLang cookbook recipe

#8
by JustinTong - opened
Files changed (1) hide show
  1. README.md +28 -37
README.md CHANGED
@@ -63,70 +63,61 @@ We have conducted a comprehensive evaluation of Ling-3.0-flash across multiple a
63
  >
64
 
65
  ## Quickstart
66
- ### SGlang
67
- #### Install our SGLang
68
- ```bash
69
- pip install uv
70
 
71
- uv venv ~/my_ling_env
72
-
73
- source ~/my_ling_env/bin/activate
74
 
75
- git clone -b ling_v3_support https://github.com/inclusionAI/sglang_ling_v3.git
76
 
77
- cd sglang_ling_v3
78
 
79
- pip install --upgrade pip
80
 
81
- pip install -e "python"
 
82
  ```
83
 
84
  #### Run Inference
85
- Here is an example to run Ling-3.0-flash with 4 GPUs, where the master node IP is `${MASTER_IP}` and server port is `${PORT}`:
86
-
87
- **Server**
88
 
89
- Since the model is trained with MTP, we recommend enabling MTP during inference (i.e., --speculative-algorithm NEXTN) for lower latency.
90
 
91
  ```bash
92
- export SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
93
- export SGLANG_JIT_DEEPGEMM_PRECOMPILE=1
94
- export SGLANG_ENABLE_SPEC_V2=1
95
- python -m sglang.launch_server \
96
- --model-path $MODEL_PATH \
97
- --dist-init-addr $MASTER_IP:2345 \
98
- --port $PORT \
99
- --nnodes 1 \
100
- --mem-fraction-static 0.8 \
101
- --max-running-requests 64 \
102
- --tp-size 4 \
103
- --chunked-prefill-size 8192 \
104
- --tool-call-parser ling3 \
105
- --reasoning-parser ling3 \
106
  --context-length 262144 \
107
  --speculative-algorithm NEXTN \
108
- --max-mamba-cache-size 320 \
109
- --enable-fp32-lm-head \
110
- --disable-shared-experts-fusion
 
111
  ```
112
 
 
 
113
  **Client**
114
 
115
- We recommend using the sampling parameters `temperature=0.6`, `top_p=0.95`, and `top_k=20`, and enabling `enable_thinking` for better performance.
116
 
117
  ```bash
118
- curl -s http://${MASTER_IP}:${PORT}/v1/chat/completions \
119
  -H "Content-Type: application/json" \
120
- -d '{"model": "auto",
121
  "messages": [{"role": "user", "content": "hello!"}],
122
- "chat_template_kwargs": {"enable_thinking": true},
123
  "stream": true,
124
- "temperature": 0.6,
125
  "top_k": 20,
126
  "top_p": 0.95
127
  }'
128
  ```
129
 
 
 
130
  ### vLLM
131
  #### Install our vLLM
132
  ```bash
 
63
  >
64
 
65
  ## Quickstart
66
+ ### SGLang
 
 
 
67
 
68
+ The hardware- and recipe-specific launch matrix (BF16/FP8 × Low-Latency / High-Throughput / HiCache + Mooncake), with a live command generator and verified configurations, lives in the SGLang cookbook:
 
 
69
 
70
+ **Cookbook:** https://docs.sglang.io/cookbook/autoregressive/InclusionAI/Ling-3.0-flash
71
 
72
+ #### Install SGLang
73
 
74
+ Use the pre-built image that tracks the Ling-3.0 runtime:
75
 
76
+ ```bash
77
+ docker pull lmsysorg/sglang:dev-Ling-3.0-flash
78
  ```
79
 
80
  #### Run Inference
 
 
 
81
 
82
+ Recommended low-latency recipe (built-in MTP / NEXTN, 256K YaRN context) on 141GB-class GPUs (H20-3e / H200) or 4-GPU Blackwell nodes (B200 / GB300):
83
 
84
  ```bash
85
+ docker run --rm --gpus all --ipc=host --shm-size 32g \
86
+ -p 30000:30000 \
87
+ -e HF_TOKEN=<your-hf-token> \
88
+ lmsysorg/sglang:dev-Ling-3.0-flash \
89
+ env SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 \
90
+ python3 -m sglang.launch_server \
91
+ --model-path inclusionAI/Ling-3.0-flash \
92
+ --tp 4 \
 
 
 
 
 
 
93
  --context-length 262144 \
94
  --speculative-algorithm NEXTN \
95
+ --json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":2.0,"rope_theta":6000000,"partial_rotary_factor":0.5,"original_max_position_embeddings":131072}}' \
96
+ --mem-fraction-static 0.8 \
97
+ --host 0.0.0.0 \
98
+ --port 30000
99
  ```
100
 
101
+ On 80GB cards (H100 / H800) use `--tp 8` with the same flags; see the cookbook cell for your hardware.
102
+
103
  **Client**
104
 
105
+ Thinking is enabled by default by both the chat template and the `ling3` reasoning parser. Disable it per request with `"chat_template_kwargs": {"enable_thinking": false}`. We recommend the sampling parameters `temperature=0.6`, `top_p=0.95`, and `top_k=20`.
106
 
107
  ```bash
108
+ curl -s http://localhost:30000/v1/chat/completions \
109
  -H "Content-Type: application/json" \
110
+ -d '{"model": "inclusionAI/Ling-3.0-flash",
111
  "messages": [{"role": "user", "content": "hello!"}],
 
112
  "stream": true,
113
+ "temperature": 0.6,
114
  "top_k": 20,
115
  "top_p": 0.95
116
  }'
117
  ```
118
 
119
+ For `--reasoning-parser ling3` / `--tool-call-parser ling3`, the HiCache + Mooncake L3 setup, and GSM8K / `bench_serving` reproduction commands, see the cookbook page linked above.
120
+
121
  ### vLLM
122
  #### Install our vLLM
123
  ```bash