Windows (PowerShell)安装部署OpenClaw
本文主要描述如何在Windows (PowerShell)操作系统中安装部署OpenClaw以及对接阿里云千问大模型服务。
阿里云大模型平台安装部署千问大模型服务
登录阿里云大模型部署平台:
安装运行大模型的支撑工具:
pip install 'git+https://github.com/sgl-project/sglang.git#subdirectory=python&egg=sglang[all]' |
使用支撑工具运行大模型服务:
SGLANG_USE_MODELSCOPE=true python -m sglang.launch_server --model-path Qwen/Qwen3.5-2B --port 8000 --tp-size 1 --mem-fraction-static 0.8 --context-length 262144 |
测试大模型接口服务:
curl http://127.0.0.1:8000/model_info |
测试大模型接口服务:
curl http://127.0.0.1:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Qwen/Qwen3.5-2B", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "请简要介绍一下量子计算。"} ], "temperature": 0.7, "max_tokens": 512 }' |
在阿里云大模型部署平台中创建API Key,用于OpenClaw远程调用:
Windows操作系统安装部署OpenClaw
在Windows操作系统中以管理员的身份打开PowerShell命令行控制台,开始安装部署OpenClaw:
iwr -useb https://openclaw.ai/install.ps1 | iex |
OpenClaw安装完成,开始手工配置:
使用本地网关的模式配置:
设置OpenClaw的本地工作空间:
设置模型提供商为阿里云千问大模型:
设置阿里云千问大模型的API Key:
设置阿里云千问大模型的型号:
设置网关服务的属性参数:
忽略设置网络通道(在web管理控制台中设置):
默认设置web搜索服务提供商为Ollama:
忽略设置技能(在web管理控制台中设置):
OpenClaw设置完成,使用以下的链接地址可访问web管理控制台:
修改PowerShell的执行文件的安全策略:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force |
重新启动OpenClaw的网关服务:
openclaw gateway --port 18789 |
查看网关的运行状态:
openclaw gateway status |
查看OpenClaw的运行状态:
openclaw status |
在浏览器中访问web管理控制台,与阿里云千问大模型对话:
