This commit is contained in:
2026-03-30 03:29:24 +08:00
parent 10925e742b
commit 1a61a7bb17
5 changed files with 15 additions and 4 deletions
+4 -3
View File
@@ -30,7 +30,7 @@
- `services.openai.host` / `services.openai.port`:OpenAI 协议服务监听地址与端口(默认 `0.0.0.0:8001`)
- `public_model_name`:对外固定模型名,切换底层模型时可保持调用方参数不变
- `reasoning_enabled`:思考推理开关,默认 `false`(关闭)
- `reasoning_enabled`:是否启用推理解析器参数注入,默认 `false`
- `api_key`:OpenAI 接口访问密钥
- `tensor_parallel_size`:张量并行数,双卡建议 `2`
- `dtype`:推理精度,默认 `bfloat16`
@@ -84,7 +84,7 @@ curl http://localhost:<services.openai.port>/v1/models
curl -X POST "http://localhost:8001/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <config.json中的api_key>" \
-d "{\"model\":\"Qwen_local_model\",\"messages\":[{\"role\":\"user\",\"content\":\"你好,介绍一下你自己\"}],\"temperature\":0.7}"
-d "{\"model\":\"Qwen_local_model\",\"messages\":[{\"role\":\"user\",\"content\":\"你好,介绍一下你自己\"}],\"temperature\":0.7,\"chat_template_kwargs\":{\"enable_thinking\":false}}"
```
## OpenClaw 调用说明
@@ -92,7 +92,8 @@ curl -X POST "http://localhost:8001/v1/chat/completions" \
- Base URL 使用 `http://<服务器IP>:8001/v1`
- API Key 使用 `config.json` 中 `api_key`
- 模型名固定使用 `config.json` 中 `public_model_name`(默认 `Qwen_local_model`)
- 若要启用思考推理,将 `config.json` 中 `reasoning_enabled` 设为 `true`
- 思考模式按请求控制:`chat_template_kwargs.enable_thinking=false/true`
- 仅当模型需要推理解析器时,再将 `config.json` 中 `reasoning_enabled` 设为 `true`
- 若使用工具调用,`config.json` 中应配置 `tool_call_parser` 与 `enable_auto_tool_choice`
- 服务强制离线模式,不会回退到 Hugging Face 远程下载
- 所有路径按 Ubuntu 规范填写,本地模型建议使用 `/opt/model/<模型目录>`