#About using local LLM by LM Studio

1 messages Β· Page 1 of 1 (latest)

rugged flint
#

How can I edit openclaw.json to use local LLM by LM Studio?

limpid minnowBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

dusky snow
#
"models": {
    "mode": "merge",
    "providers": {
      "lmstudio": {
        "baseUrl": "http://127.0.0.1:1234/v1",
        "apiKey": "lmstudio",
        "api": "openai-responses",
        "models": [
          {
            "id": "qwen/qwen3.5-27b",
            "name": "qwen3.5 27B",
            "reasoning": true,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 64000,
            "maxTokens": 8196
          }
        ]
      },```

"agents": {
"defaults": {
"model": {
"primary": "qwen/qwen3.5-27b",
},
"models": {
"qwen/qwen3.5-27b": {
"alias": "qwen3.5"
}

change baseUrl port no. as per your lm studio.
ocean basinBOT
#

Edit ~/.openclaw/openclaw.json (it’s JSON5, not strict JSON), and make sure the default model includes the lmstudio/ provider prefix.

This is the shape from the docs:

{
  agents: {
    defaults: {
      model: { primary: "lmstudio/qwen/qwen3.5-27b" },
      models: {
        "lmstudio/qwen/qwen3.5-27b": { alias: "qwen3.5" },
      },
    },
  },
  models: {
    mode: "merge",
#
    providers: {
      lmstudio: {
        baseUrl: "http://127.0.0.1:1234/v1", // change port if needed
        apiKey: "lmstudio", // any non-empty value if LM Studio auth is off
        api: "openai-completions",
        models: [
          {
            id: "qwen/qwen3.5-27b",
            name: "qwen3.5 27B",
            reasoning: false,
            input: ["text"],
            cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
            contextWindow: 128000,
            maxTokens: 8192,
          },
#
        ],
      },
    },
  },
}

A couple of fixes vs your snippet:

  • primary should be lmstudio/..., not just qwen/...
  • id should match the exact LM Studio model key, usually something like qwen/qwen3.5-27b, not a display name with spaces

You can get the exact LM Studio model key with: