配置规则

OpenClaw 是企业级 AI 网关,它的设计理念是:
全局通用配置 ↔ 智能体认证 ↔ 智能体模型 三层分离。
各文件说明:
config.json:全局系统配置,控制超时、工具权限、RAG、全局默认模型等整体行为。
auth-profiles.json:专门存储各服务商的 API Key,负责身份认证,与模型配置分开以保证安全。
models.json:指定当前 agent 可以使用哪些模型、来自哪个服务商,只定义模型列表,不存密钥。

openclaw.json
"plugins": {
    "entries": {
      "ollama": {
        "enabled": true
      }
    }
  },
  "auth": {
    "profiles": {
      "ollama:default": {
        "provider": "ollama",
        "mode": "api_key"
      }
    }
  }
agents..agent.auth-profiles.json
{
  "version": 1,
  "profiles": {
    "ollama:default": {
      "type": "api_key",
      "provider": "ollama",
      "key": "ollama-local"
    }
  }
}

agents..agent.models.json
{
  "providers": {
    "ollama": {
      "baseUrl": "http://127.0.0.1:11434",
      "apiKey": "OLLAMA_API_KEY",
      "api": "openai-completions",
      "models": [
        {
          "id": "qwen3.5:xb",
          "name": "Qwen3.5:xb",
          "input": [
            "text"
          ],
          "reasoning": false,
          "cost": {
            "input": 0,
            "output": 0,
            "cacheRead": 0,
            "cacheWrite": 0
          },
          "contextWindow": 200000,
          "maxTokens": 8192,
          "api": "openai-completions"
        }
      ]
    }
  }
}

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐