当前位置: 首页 > news >正文

成功在本地部署openclaw,使用本地模型,并可以exec执行任务,tool执行成功

成功在本地部署openclaw,使用本地模型,并可以exec执行任务,tool执行成功

配套软件版本

1.ollama 0.18.2 # 安装在windows下,本机显卡 NVIDIA GeForce RTX 4050 Laptop GPU 6G vram
2.openclaw v2026.03.18 #安装在 WSL2 cpu4核 内存4G Ubuntu系统
3.模型扩窗 链接
4.contextWindow 值越大,启动同一个模型占用的内存越多,视显存情况调整,本文是128000,挺大,如果显存小,可调成65536或更小

windows用户文件夹下.wslconfig的内容如下
[wsl2]memory=4GB# 内存swap=2G#虚拟内存processors=4# 核心数[experimental]#autoMemoryReclaim=gradual # 开启自动回收内存,可在 gradual, dropcache, disabled 之间选择networkingMode=mirrored# 开启镜像网络dnsTunneling=true# 开启 DNS Tunnelingfirewall=true# 开启 Windows 防火墙autoProxy=true# 开启自动同步代理#sparseVhd=true # 开启自动释放 WSL2 虚拟硬盘空间

测试ollama

curlhttp://localhost:11434/v1/chat/completions-H"Content-Type: application/json"-d'{"model":"qwen2.5:latest-32k","messages":[{"role":"user","content":"Hello!"}]}'

openclaw.json

{"meta":{"lastTouchedVersion":"2026.3.13","lastTouchedAt":"2026-03-18T02:55:54.422Z"},"wizard":{"lastRunAt":"2026-03-16T08:58:14.320Z","lastRunVersion":"2026.3.13","lastRunCommand":"doctor","lastRunMode":"local"},"auth":{"profiles":{"qwen-portal:default":{"provider":"qwen-portal","mode":"oauth"}}},"models":{"providers":{"qwen-portal":{"baseUrl":"https://portal.qwen.ai/v1","apiKey":"qwen-oauth","api":"openai-completions","models":[{"id":"coder-model","name":"Qwen Coder","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192},{"id":"vision-model","name":"Qwen Vision","reasoning":false,"input":["text","image"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192}]},"ollama":{"baseUrl":"http://127.0.0.1:11434/v1","apiKey":"ollama","api":"openai-completions","models":[{"id":"deepseek-r1:latest","name":"DeepSeek-R1-0528-Qwen3-8B (Ollama)","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":32768,"maxTokens":4096},{"id":"qwen2.5:latest","name":"Alibaba Qwen2.5 (Ollama)","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192},{"id":"qwen2.5:latest-32k","name":"Alibaba Qwen2.5:latest-32k (Ollama)","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192}]}}},"agents":{"defaults":{"model":{"primary":"ollama/qwen2.5:latest-32k","fallbacks":[]},"models":{"qwen-portal/coder-model":{"alias":"qwen"},"qwen-portal/vision-model":{},"ollama/deepseek-r1:latest":{"alias":"deepseek"},"ollama/qwen2.5:latest":{"alias":"qwen-local"},"ollama/qwen2.5:latest-32k":{"alias":"qwen-local-32k"},"ollama/qwen2.5:1.5b":{"alias":"qwen2.5:1.5b"}},"workspace":"/home/tj/.openclaw/workspace","compaction":{"mode":"safeguard"},"maxConcurrent":4,"subagents":{"maxConcurrent":8}},"list":[{"id":"main","model":"ollama/qwen2.5:latest-32k"}]},"tools":{"profile":"full"},"messages":{"ackReactionScope":"group-mentions"},"commands":{"native":"auto","nativeSkills":"auto","restart":true,"ownerDisplay":"raw"},"session":{"dmScope":"per-channel-peer"},"hooks":{"internal":{"enabled":true,"entries":{"bootstrap-extra-files":{"enabled":true}}}},"gateway":{"port":18789,"mode":"local","bind":"loopback","controlUi":{"allowedOrigins":["http://localhost:18789","http://127.0.0.1:18789"],"allowInsecureAuth":true,"dangerouslyDisableDeviceAuth":true},"auth":{"mode":"token","token":"xxxxxxxxxxx"},"tailscale":{"mode":"off","resetOnExit":false},"nodes":{"denyCommands":["camera.snap","camera.clip","screen.record","contacts.add","calendar.add","reminders.add","sms.send"]}},"skills":{"install":{"nodeManager":"npm"}},"plugins":{"entries":{"qwen-portal-auth":{"enabled":true},"imessage":{"enabled":true}}}}

关于不干活问题

亲测qwen2.5:latest-32k不能稳定干活,经常找不着本机目录的准确位置,也导致无法正常执行本机操作。根本原因是模型不够用,换成gag0/qwen35-opus-distil:27b,carstenuhlig/omnicoder-9b:latest等,问题解决。

安装命令如下:

1.显存超过32G,可用gag0/qwen35-opus-distil:27b(qwen3.5:27b)

ollama launch openclaw--modelgag0/qwen35-opus-distil:27b

2.显存没有32G,可用carstenuhlig/omnicoder-9b:latest(qwen3.5:9b)

ollama launch openclaw--modelcarstenuhlig/omnicoder-9b:latest

一个能干活的本地模型配置案例

{"wizard":{"lastRunAt":"2026-03-30T03:15:09.551Z","lastRunVersion":"2026.3.28","lastRunCommand":"onboard","lastRunMode":"local"},"auth":{"profiles":{"ollama:default":{"provider":"ollama","mode":"api_key"}}},"models":{"mode":"merge","providers":{"ollama":{"baseUrl":"http://127.0.0.1:11434","apiKey":"OLLAMA_API_KEY","api":"ollama","models":[{"id":"glm-4.7-flash","name":"glm-4.7-flash","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":128000,"maxTokens":8192},{"id":"carstenuhlig/omnicoder-9b:latest","name":"carstenuhlig/omnicoder-9b:latest","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":262144,"maxTokens":8192},{"id":"gag0/qwen35-opus-distil:27b","name":"gag0/qwen35-opus-distil:27b","reasoning":false,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"contextWindow":262144,"maxTokens":8192}]}}},"agents":{"defaults":{"model":{"primary":"ollama/carstenuhlig/omnicoder-9b:latest"},"models":{"ollama/carstenuhlig/omnicoder-9b:latest":{}},"workspace":"/home/tj/.openclaw/workspace"}},"tools":{"profile":"coding","alsoAllow":["ollama_web_search","ollama_web_fetch"]},"commands":{"native":"auto","nativeSkills":"auto","restart":true,"ownerDisplay":"raw"},"session":{"dmScope":"per-channel-peer"},"hooks":{"internal":{"enabled":true,"entries":{"boot-md":{"enabled":true},"bootstrap-extra-files":{"enabled":true},"command-logger":{"enabled":true},"session-memory":{"enabled":true}}}},"gateway":{"port":18789,"mode":"local","bind":"loopback","controlUi":{"allowInsecureAuth":true},"auth":{"mode":"token","token":"XXXXXXXXXX"},"tailscale":{"mode":"off","resetOnExit":false},"nodes":{"denyCommands":["camera.snap","camera.clip","screen.record","contacts.add","calendar.add","reminders.add","sms.send"]}},"skills":{"install":{"nodeManager":"npm"}},"meta":{"lastTouchedVersion":"2026.3.28","lastTouchedAt":"2026-03-30T03:15:09.563Z"}}

体验一下

启动

openclaw gateway--port18789

在http://127.0.0.1:18789/chat聊天中输入

安装desearch-web-search

提示配置api key 时,按提示到https://console.desearch.ai注册账号,获取key,在聊天中输入

API key 是 dsr_xxxxxxxxxxxxxxxxxxxxx

等openclaw自动配置好后就可以网络搜索了。

免费搜索用
安装web-search-free

补充

安装 @ollama/openclaw-web-search 联网插件

@ollama/openclaw-web-search 是 OpenClaw 与 Ollama 实现联网搜索的核心插件,无需手动下载安装包,通过 OpenClaw 官方命令即可一键完成安装,步骤如下:

  1. 打开终端,确保当前终端拥有管理员权限(Windows 右键 PowerShell 选择“以管理员身份运行”,macOS 命令前加sudo),避免插件安装过程中出现权限不足报错。
  2. 执行插件安装命令,直接调用 OpenClaw 插件管理功能完成安装,命令如下:
openclaw pluginsinstall@ollama/openclaw-web-search
  1. 安装完成后,执行验证命令,确认插件安装成功且处于激活状态:
openclaw plugins list

若输出结果中包含“@ollama/openclaw-web-search”,且状态为“loaded”,则插件安装成功;若状态为“disabled”,执行以下命令激活插件:

openclaw pluginsenable@ollama/openclaw-web-search
http://www.jsqmd.com/news/579164/

相关文章:

  • 2026年靠谱的医用材料疲劳试验机公司对比推荐 - 品牌宣传支持者
  • 小端火爆计划:我的第一步
  • macOS下OpenClaw一键安装指南:对接千问3.5-35B-A3B-FP8实现本地自动化
  • [具身智能-202]:Visual Studio vs. Visual Studio Code
  • Ubuntu极简安装Conda指南
  • C语言中的对齐(alignment)与#pragma pack
  • 2026年评价高的电池疲劳试验机口碑好的厂家推荐 - 品牌宣传支持者
  • OpenClaw安全防护:Qwen3.5-9B操作权限管理与风险指令拦截
  • 【Linux】库的制作与使用(2)ELF静态链接
  • 什么是精益生产管理八大浪费?精益生产管理八大浪费详解
  • 电机轴承异响?5分钟教你用振动分析仪定位故障(附实测案例)
  • AI浪潮下的核心密码:Token如何重塑智能经济与未来竞争格局?
  • 本源量子开发工具链全解析:从QPanda到VQNet,构建量子计算生态
  • ReactNative项目OpenHarmony三方库集成实战:react-native-render-html
  • OpenClaw+Qwen2.5-VL-7B:3种方法提升图文任务成功率
  • 星图平台快速体验:OpenClaw镜像+Qwen3.5-9B完成图片分析沙盒测试
  • 嵌入式开发中的位操作技巧与实战应用
  • 关于eclipse2019中导入克隆的web项目
  • OpenClaw+Qwen3.5-9B办公自动化:3类图片处理场景实测
  • Spring IoC 与 DI 核心详解 —— 基于 XML 配置:Bean 创建、依赖注入与生命周期全解析(Spring系列1)
  • Sodaq_LSM303AGR库深度解析:六轴IMU嵌入式驱动设计与低功耗实践
  • 美胸-年美-造相Z-Turbo案例分享:从简单描述到精美成图的全过程展示
  • 3 个高级思路,让你的 AI 绘画 / 视频从此充满想象力
  • 新手福音:用快马平台理解openclaw架构图并生成你的第一个应用
  • 初识Maven
  • 2026年矿山煤矿电力电缆生产厂家推荐:中低压、低压、中压、变频等电缆厂家 - 品牌2026
  • OpenClaw+百川2-13B-4bits量化模型:个人周报自动化生成与整理方案
  • 阿里云百炼 Coding Plan 售罄、Lite 停售、Pro 抢不到?最新解决方案
  • OpenClaw飞书机器人配置:Qwen3.5-9B-AWQ-4bit对话触发全流程
  • Diablo Edit2实战解决方案:从存档修复到角色定制的完整指南