openclaw使用本地llama.cpp

llama.cpp兼容openapi接口,自然可以作为openclaw的后端。

添加自定义provider同前:为openclaw增加自定义provider

反复修改,总是不能得到正确的model状态。

bash 复制代码
{
  "meta": {
    "lastTouchedVersion": "2026.2.3-1",
    "lastTouchedAt": "2026-02-05T12:16:30.399Z"
  },
  "wizard": {
    "lastRunAt": "2026-01-30T12:20:58.674Z",
    "lastRunVersion": "2026.1.29",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "llamacpp": {
        "baseUrl": "http://192.168.1.182:8087/v1",
        "apiKey": "no need key",
        "api": "openai-completions",
        "models": [
          {
            "id": "Qwen3-8B-Q6_K",
            "name": "Qwen3",
            "api": "openai-completions",
            "reasoning": true,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 262144,
            "maxTokens": 32000
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "llamacpp/Qwen3-8B-Q6_K"
      },
      "models": {
        "llamacpp/Qwen3-8B-Q6_K": {
          "alias": "Qwen3"
        }
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto"
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "loopback",
    "auth": {
      "mode": "token",
      "token": "a08c51975f90e3afa566f4af1de977a70b6e9630909cc8c0",
      "password": "a08c51975f90e3afa566f4af1de977a70b6e9630909cc8c0"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  },
  "skills": {
    "install": {
      "nodeManager": "npm"
    }
  }
}

注意C:\Users\yusp7.openclaw\agents\main\agent\models.json,要与config\models\provider里一致,内容不能有重复provider名的:

bash 复制代码
{
  "providers": {
    "llamacpp": {
      "baseUrl": "http://192.168.1.182:8087/v1",
      "apiKey": "no need key",
      "api": "openai-completions",
      "models": [
        {
          "id": "Qwen3-8B-Q6_K",
          "name": "Qwen3",
          "api": "openai-completions",
          "reasoning": true,
          "input": [
            "text"
          ],
          "cost": {
            "input": 0,
            "output": 0,
            "cacheRead": 0,
            "cacheWrite": 0
          },
          "contextWindow": 262144,
          "maxTokens": 32000
        }
      ]
    }
  }
}

但是,为什么返回的对话不对?

相关推荐
IT王师傅10 天前
从 豆包 到 Codex CLI:一名普通开发者的 AI 工具进化路线
ai·codex cli·openclaw
AC赳赳老秦13 天前
用 OpenClaw 搭建服务器故障应急响应系统,自动处理 80% 常见运维故障
android·运维·服务器·python·rxjava·deepseek·openclaw
七夜zippoe13 天前
OpenClaw 消息系统:多平台消息收发深度解析
消息·message·多平台·openclaw·imessage
盼小辉丶13 天前
Ubuntu极速部署OpenClaw完全指南(本地模型+DeepSeek)
linux·ubuntu·openclaw
智海观潮14 天前
OpenClaw生态全景解析 - 9大核心工具赋能 AI 自动化落地
ai·agent·skills·ai 自动化·openclaw
虾壳云官方14 天前
openclaw 一键安装教程(2026年6月15最新)
运维·人工智能·windows·自动化·openclaw
AC赳赳老秦14 天前
OpenClaw + 飞书多维表格:自动同步数据、生成统计图表、触发自动化任务
java·大数据·python·缓存·自动化·deepseek·openclaw
AC赳赳老秦15 天前
OpenClaw+Power Apps 实战:自动生成 Power Apps 应用、连接 Excel 数据源
大数据·开发语言·python·serverless·excel·deepseek·openclaw
七夜zippoe15 天前
OpenClaw 节点方法调用:跨设备能力调用实战
ai·调用·跨设备·openclaw·nodes
虾壳云官方16 天前
OpenClaw 2.7.9 Windows 一键部署教程:零基础也能搭建 AI 自动化助手
运维·人工智能·windows·自动化·openclaw·openclaw一键部署