1.在 Windows 装 Ubuntu(只做一次)

在「以管理员身份运行」PowerShell 里:

1
2
3
4
5
# Win11 开启 WSL2
wsl --install -d Ubuntu-22.04

# 进入 WSL2 后,正常装 vLLM
pip install vllm

NVIDIA 驱动装在 Win11 宿主机上,WSL2 里自动能识别到 GPU,nvidia-smi 可以验证。

2.启动 vLLM server

打开 Ubuntu 终端:

1
2
3
4
5
vllm serve Qwen/Qwen3-14B \
--tensor-parallel-size 2 \
--gpu-memory-utilization 0.9 \
--port 8000 \
--api-key mytoken123

vLLM 自带 OpenAI-compatible API,直接就能被 OpenClaw 识别。

3.安装Openclaw

1
2
3
4
5
# 安装
curl -fsSL https://openclaw.ai/install.sh | bash

openclaw gateway install
openclaw gateway start

4.openclaw.json 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
"models": {
"mode": "replace",
"providers": {
"vllm": {
"baseUrl": "http://127.0.0.1:8000",
"api": "openai",
"apiKey": "mytoken123",
"models": [
{
"id": "Qwen/Qwen3-14B",
"name": "vllm/qwen3-14b",
"reasoning": false,
"input": ["text"],
"cost": {
"input": 0, "output": 0,
"cacheRead": 0, "cacheWrite": 0
},
"contextWindow": 128000,
"maxTokens": 8192
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "vllm/qwen3-14b"
}
}
},
"gateway": {
"mode": "local",
"auth": {
"token": "mytoken123"
}
}
}

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.