回到顶部

阅读目录

再也不用担心 OpenClaw 龙虾 tokens 不够用了,ollama 本地模型 + OpenClaw + WS 机器人 部署

安装环境

安装过程

OpenClaw

  1. 先装 node, 官网下载包安装,版本要大于等于 22 版本,如果电脑的电脑模式选择不是高性能,要在 设置 → 屏幕 → 图形设置 → 浏览 → 找到 node.exe,  添加到高性能模式
  2. 更新集成显卡驱动(安装的时候提示报错)
  3. 管理员 cmd,更新安全策略(遇到错误丢百度、谷歌)、也有可能需要安装 git、c++ 生成工具
  4. 执行,一次不成功就多试几次,遇到错误就丢百度、谷歌
    npm install -g openclaw@latest
  5. 然后启动向导模式
    openclaw onboard --install-daemon
  6. 安装 微信 插件,多试几遍(这里最好把 微信机器人已经配置好)
    openclaw plugins install @wecom/wecom-openclaw-plugin
  7. 重启 OpenClaw

    openclaw gateway start
  8. 添加企业微信渠道

    openclaw channels add
  9. 在 select channel 步骤,选择 channel 为企业微信
  10. 输入企业微信机器人Bot ID、Secret,可以复制后直接在 控制台右键就可以粘贴
  11. 选择 finish
  12. 配对方式,选择 Pairing 配对模式
  13. 完成后续配置,并可看到配置渠道成功。
  14. 在企业微信中,保存机器人,并跟他发消息,会收到一个配置密钥的回复消息。(这个很关键哦)
  15. 在 openclaw 的控制台输入她告诉你的命令配对
    openclaw pairing approve wecom S*****F
  16. 然后可以继续在 企业微信机器人的对话框继续聊天啦,加入群聊要 @它 才行哦

企业微信 ws 机器人

  • 下载企业微信电脑版
  • 创建机器人(工作台 → 智能办公→智能机器人→创建机器人)
  • 选 api 模式创建
  • 创建成功,连接方式选 长链接,然后记一下 bot id 和 secret,这两个要填到 openclaw 里的 channels 对应的字段里(具体看后面的配置文件)

配置文件

附一份配置文件吧 openclaw.json

目录:C:\Users\Administrator\.openclaw  (*** 是我替换我的隐私信息,这些大部分是你需要修改的地方)

{
  "meta": {
    "lastTouchedVersion": "2026.3.8",
    "lastTouchedAt": "2026-03-11T06:33:31.868Z"
  },
  "wizard": {
    "lastRunAt": "2026-03-10T08:19:44.100Z",
    "lastRunVersion": "2026.3.8",
    "lastRunCommand": "doctor",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "ark": {
        "baseUrl": "https://ark.cn-beijing.volces.com/api/v3",
        "apiKey": "***",
        "api": "openai-completions",
        "models": [
          {
            "id": "doubao-seed-1-8-251228",
            "name": "doubao-seed-1-8-251228",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 200000,
            "maxTokens": 8192,
            "headers": {
              "X-Client-Request-Id": "ecs-openclaw/0202.1/i-yeexzr1gcgs6ipmj8lzw"
            },
            "compat": {
              "supportsDeveloperRole": false
            }
          }
        ]
      },
      "ollama": {
        "baseUrl": "http://127.0.0.1:11434/v1",
        "apiKey": "ollama-local",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3.5:9b",
            "name": "qwen3-5 9b",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 200000,
            "maxTokens": 2000000
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "ollama/qwen3.5:9b",
		fallbacks: ["ollama/qwen3.5:9b"],
      },
      "models": {
        "ollama/qwen3.5:9b": {}
      },
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto",
    "restart": true,
    "ownerDisplay": "raw"
  },
  "channels": {
    "feishu": {
      "appId": "***",
      "appSecret": "***"
    },
    "wecom": {
      "enabled": true,
      "botId": "***",
      "secret": "***",
      "allowFrom": [],
      "dmPolicy": "pairing"
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "***"
    }
  },
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": true
      },
      "wecom-openclaw-plugin": {
        "enabled": true
      }
    },
    "installs": {
      "feishu": {
        "source": "npm",
        "spec": "@openclaw/feishu",
        "installPath": "C:\\Users\\Administrator\\.openclaw\\extensions\\feishu",
        "version": "2026.3.7",
        "resolvedName": "@openclaw/feishu",
        "resolvedVersion": "2026.3.7",
        "resolvedSpec": "@openclaw/feishu@2026.3.7",
        "integrity": "***",
        "shasum": "***",
        "resolvedAt": "2026-03-10T08:42:33.043Z",
        "installedAt": "2026-03-10T08:42:43.149Z"
      },
      "wecom-openclaw-plugin": {
        "source": "npm",
        "spec": "@wecom/wecom-openclaw-plugin",
        "installPath": "C:\\Users\\Administrator\\.openclaw\\extensions\\wecom-openclaw-plugin",
        "version": "1.0.6",
        "resolvedName": "@wecom/wecom-openclaw-plugin",
        "resolvedVersion": "1.0.6",
        "resolvedSpec": "@wecom/wecom-openclaw-plugin@1.0.6",
        "integrity": "***",
        "shasum": "***",
        "resolvedAt": "2026-03-11T03:51:30.061Z",
        "installedAt": "2026-03-11T03:52:06.691Z"
      }
    }
  }
}

常用命令

其他常用命令

# 设置当前使用的模型
openclaw models set ark/doubao-seed-2-0-lite-260215

# 设置当前使用的模型
openclaw models set ollama/qwen3.5:9b

# 重启网关,改动配置文件或者安装插件后重启以下
openclaw gateway restart

# 停止网关,关闭服务
openclaw gateway stop

# 下次运行时需要再次启动
openclaw gateway start

# 查看实时日志
openclaw logs --follow

# 只看最后 N 行日志,比如 50 行
openclaw logs --lines 50

# 清理旧日志
openclaw logs --clean

# 查看全面的系统状态信息
openclaw status --all

# 检查并更新 OpenClaw 到最新版本
openclaw update

# 列出所有会话
openclaw sessions list

# 清理不活跃的旧会话,释放 token
openclaw sessions cleanup

# 安装新技能/扩展
openclaw extension install <github-url>

# 列出已安装扩展
openclaw extension list

# 更新已安装扩展
openclaw extension update

# 卸载扩展
openclaw extension remove <extension-name>

# 打开交互式配置向导

openclaw config

# 查看当前配置
openclaw config show

# 深度检测各个通道连接状态
openclaw status --deep

# 查看系统信息和依赖
openclaw doctor

# 列出所有定时 cron 任务
openclaw cron list

 


^_^
请喝咖啡 ×

文章部分资料可能来源于网络,如有侵权请告知删除。谢谢!

前一篇: 如何判断测试各岗位人员的主动性
captcha