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
        }
      ]
    }
  }
}

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

相关推荐
RuoyiOffice2 天前
llama.cpp + SpringBoot3:本地部署 Qwen3.8,接入 AgentOS 企业办公智能体
spring boot·springboot3·llama.cpp·spring ai·qwen3.8·agentos
AI_Gump5 天前
模型篇|llama.cpp 推理引擎深度解读:从一人练手到 LLM 端侧的事实标准
llama·llama.cpp
小七-七牛开发者6 天前
Agent 支线知识:Personal Agent 的前世今生
dots·aiagent·openclaw·muse·personalagent
会思想的苇草i6 天前
OpenClaw 添加技能(Skills) & 常用命令
ai·大模型·skills·openclaw
ShiMetaPi8 天前
182X 端云协同方案详解:部署你的本地 AI Agent 主机
边缘计算·rk3588·aiagent·openclaw·rk1828
智码看视界9 天前
开源大模型追踪:TurboQuant量化指南:128K上下文不再爆显存,KV缓存3-bit免重训
google·开源大模型·llama.cpp·显存优化·长上下文推理·turboquant·本地部署 开源大模型
七夜zippoe11 天前
把 OpenClaw Agent 搬进 K8s:容器化部署全记录
ai·云原生·容器·kubernetes·openclaw
神奇的代码在哪里12 天前
没有独显也能跑多模态:MiniCPM-V 4.7-1B 本地 OCR 实测(附源码)
ocr·多模态大模型·llama.cpp·gguf·minicpm-v
鬼手点金13 天前
nanoGPT/nanochat 能做出 DeepSeek/Qwen 这样的大模型吗?
服务器·前端·javascript·bug·openclaw
容沁风13 天前
llama.cpp浏览器访问404
win10·llama.cpp·web-ui