#openclaw with lmstudio

1 messages · Page 1 of 1 (latest)

celest coral
#

I have setup openclaw with lmstudio. I have setup up a local llm gemma4 e4b on an intel core ultra 5 135u laptop. the model works in lmstudio. however I get no reponse in openclaw. Are there any specific settings I need to change in openclaw. when i enter Hello in the prompt the first time after launcing openclaw it takes awhile processing but then i get no reply. after the first attemp the time it takes is much less but i still get no response. the gpu is loading up so the ai is processing.

steep reefBOT
astral spokeBOT
#

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

steep reefBOT
celest coral
#

I have tried mistral as well. there is no response. but i get an error in the openclaw powershell window

alpine rainBOT
#

That helps, if both Gemma and Mistral fail, it’s probably the OpenClaw ↔ LM Studio request format, not the specific model.

Please paste these 3 things:

  1. openclaw --version
  2. the exact PowerShell error text from the OpenClaw window
  3. openclaw models status

A screenshot is fine if that’s easier.

Two very common fixes for this exact symptom are:

compat: {
  requiresStringContent: true,
  supportsTools: false,
#
}

and, if needed:

agents: {
  defaults: {
    experimental: { localModelLean: true }
  }
}

If the PowerShell error says something like:

  • messages[].content ... expected a string → use requiresStringContent: true
celest coral
#

OpenClaw 2026.4.15 (041266a)
mistral-7b-instruct-v0.3
[agent/embedded] auto-compaction failed for lmstudio/mistral-7b-instruct-v0.3: Summarization failed: Error rendering prompt with jinja template: "Only user and assistant roles are supported!".
absolutely nothing happens. no heartbeat promp shown. no gpu usage.

gemma-4-e4b
no error. takes a couple minutes for first "response" get the tool and heatbeat output., but no reply.

alpine rainBOT
#

Nice, that log actually explains a lot.

For mistral-7b-instruct-v0.3, this is the key part:

Error rendering prompt with jinja template: "Only user and assistant roles are supported!"

That means the LM Studio chat template for that model is rejecting the roles OpenClaw needs, especially during auto-compaction. So this is not just “OpenClaw says nothing”, it is hitting a template/compat issue.

What I’d try next:

  1. Start a fresh session with /new before retesting.
  2. Reduce compaction pressure on small local models:
    agents: {
      defaults: {
        compaction: {
    
#
         reserveTokensFloor: 0
       }
     }
   }
  1. For the Gemma model, add the usual local-backend compat flags:
    compat: {
      requiresStringContent: true,
      supportsTools: false
    }
    
  2. Also try lean local mode:
    agents: {
    
#
     defaults: {
       experimental: { localModelLean: true }
     }
   }

So the minimal shape is:

{
  agents: {
    defaults: {
      experimental: { localModelLean: true },
      compaction: { reserveTokensFloor: 0 }
    }
#
  },
  models: {
    providers: {
      lmstudio: {
        models: [
          {
            id: "<your exact LM Studio model key>",
            compat: {
              requiresStringContent: true,
              supportsTools: false
            }
          }
        ]
      }
    }
#
  }
}

A couple of notes:

  • Mistral looks blocked by the LM Studio Jinja chat template.
  • Gemma looks more like the common tool-schema / prompt-pressure issue.
  • If LM Studio lets you change the chat template for Mistral, use one that supports system prompts, otherwise that model/template combo is a bad fit for OpenClaw.

Docs:
https://docs.openclaw.ai/gateway/local-models
https://docs.openclaw.ai/concepts/compaction
https://docs.openclaw.ai/providers/lmstudio

If you want, paste your openclaw.json model block next and I can help rewrite it exactly.

celest coral
#

where do i find openclaw.json. For the gemma 4 model, why are the changes needed. I am very new to AI and openclaw.

alpine rainBOT
#

No worries, this stuff is confusing when you’re new to it.

Where to find openclaw.json:

The easiest way is to run:

openclaw config file

That prints the exact config path OpenClaw is using.

By default it is:

~/.openclaw/openclaw.json
#

On Windows, that usually means something like:

C:\Users\<your-name>\.openclaw\openclaw.json

Docs: https://docs.openclaw.ai/gateway/configuration

Why the Gemma changes are needed:

LM Studio chat and OpenClaw are not the same workload.

A normal LM Studio chat is usually just:

  • your prompt
  • the model reply

OpenClaw sends something heavier:

#
  • system instructions
  • session history
  • tool definitions
  • compaction/summarization instructions

Small local models, or local backends, often handle simple chat fine but struggle with that fuller agent-style prompt.

So the settings mean:

  • requiresStringContent: true
    Tell OpenClaw to send a simpler plain-text message shape.

  • supportsTools: false
    Tell OpenClaw not to include tool definitions for that model.

  • localModelLean: true
    Trim some extra built-in tool/context overhead so the prompt is smaller.

celest coral
#

"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"auth": "api-key",
"apiKey": "LM_API_TOKEN",
"models": [
{
"id": "mistral-7b-instruct-v0.3",
"name": "Mistral 7B Instruct v0.3",
"api": "openai-completions",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"contextTokens": 32768,
"maxTokens": 8192
},
{
"id": "google/gemma-4-e4b",
"name": "Gemma 4 E4B",
"api": "openai-completions",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"contextTokens": 64000,
"maxTokens": 8192

alpine rainBOT
#

Thanks, this helps a lot. I can already see a couple things I’d change.

1) Change apiKey

If you want OpenClaw to read the environment variable, this:

"apiKey": "LM_API_TOKEN"

should be:

"apiKey": "${LM_API_TOKEN}"

If LM Studio auth is disabled, any non-empty placeholder also works, but "${LM_API_TOKEN}" is the correct env-var form from the docs.

#

2) Set both local models to reasoning: false

I would change both of these from true to false.

For LM Studio local models, the docs use reasoning: false, and it’s the safer starting point.

3) Add compat flags to both models

Add this inside each model entry:

"compat": {
  "requiresStringContent": true,
  "supportsTools": false
}
#

4) Add lean local mode + reduce compaction pressure

Under agents.defaults, add:

"experimental": {
  "localModelLean": true
},
"compaction": {
  "reserveTokensFloor": 0
}

So the shape should look more like this

#
"lmstudio": {
  "baseUrl": "http://localhost:1234/v1",
  "api": "openai-completions",
  "auth": "api-key",
  "apiKey": "${LM_API_TOKEN}",
  "models": [
    {
      "id": "mistral-7b-instruct-v0.3",
      "name": "Mistral 7B Instruct v0.3",
      "api": "openai-completions",
      "reasoning": false,
      "input": ["text"],
      "cost": {
        "input": 0,
        "output": 0,
#
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 32768,
      "contextTokens": 32768,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
    },
    {
      "id": "google/gemma-4-e4b",
      "name": "Gemma 4 E4B",
      "api": "openai-completions",
#
      "reasoning": false,
      "input": ["text", "image"],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 131072,
      "contextTokens": 64000,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
#
    }
  ]
}

and elsewhere:

"agents": {
  "defaults": {
    "experimental": {
      "localModelLean": true
    },
    "compaction": {
      "reserveTokensFloor": 0
#
    }
  }
}

Why these specific changes?

Very simply:

  • requiresStringContent: true = send a simpler message format
  • supportsTools: false = stop sending tool definitions the model/backend may choke on
  • localModelLean: true = make OpenClaw’s prompt smaller
  • reserveTokensFloor: 0 = stop aggressive compaction pressure on small local setups
  • reasoning: false = match the safer LM Studio local-model setup from the docs

After saving, I’d do a fresh chat session with /new and test Gemma first.

celest coral
#

"agents": {
"defaults": {
"workspace": "C:\Users\mainframe\.openclaw\workspace",
"model": {
"primary": "lmstudio/mistral-7b-instruct-v0.3"
},
"models": {
"ollama/llama3.1:8b": {},
"jan-local/Jan-v3.5-4B-Q4_K_XL": {},
"jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
"jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
"jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
"lmstudio/google/gemma-4-e4b": {},
"lmstudio/mistral-7b-instruct-v0.3": {}
},
"llm": {
"idleTimeoutSeconds": 0
}
}

alpine rainBOT
#

Perfect, this shows exactly where the agents changes go.

Your agents.defaults block should become:

"agents": {
  "defaults": {
    "workspace": "C:\\Users\\mainframe\\.openclaw\\workspace",
    "model": {
      "primary": "lmstudio/google/gemma-4-e4b"
    },
    "models": {
      "ollama/llama3.1:8b": {},
      "jan-local/Jan-v3.5-4B-Q4_K_XL": {},
      "jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
      "jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
#
      "jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
      "lmstudio/google/gemma-4-e4b": {},
      "lmstudio/mistral-7b-instruct-v0.3": {}
    },
    "llm": {
      "idleTimeoutSeconds": 0
    },
    "experimental": {
      "localModelLean": true
    },
    "compaction": {
      "reserveTokensFloor": 0
    }
  }
}
#

A couple of important notes:

  • I changed the primary model to Gemma for testing.
  • I’d avoid Mistral first, because that earlier error looked like an LM Studio template issue.
  • The new bits are:
    • "experimental": { "localModelLean": true }
    • "compaction": { "reserveTokensFloor": 0 }

Important: the compat flags do not go in agents.defaults.models

Those {} entries are basically the allowed model list.

The real model behavior changes go in your other section:

models.providers.lmstudio.models
#

So in the Gemma entry, add:

"reasoning": false,
"compat": {
  "requiresStringContent": true,
  "supportsTools": false
}

and do the same for Mistral if you want to keep testing it later.

Also fix:

"apiKey": "${LM_API_TOKEN}"
#

instead of:

"apiKey": "LM_API_TOKEN"

So the plan is

  1. Set Gemma as primary
  2. Add localModelLean
  3. Add reserveTokensFloor: 0
  4. In the LM Studio provider model entry, set:
    • reasoning: false
    • compat.requiresStringContent: true
    • compat.supportsTools: false
  5. Save, restart OpenClaw, then do /new and test again
#

If you want, paste the full Gemma model entry after you edit it, and I’ll sanity-check it before you restart.

celest coral
#

"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"auth": "api-key",
"apiKey": "LM_API_TOKEN",
"models": [
{
"id": "mistral-7b-instruct-v0.3",
"name": "Mistral 7B Instruct v0.3",
"api": "openai-completions",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"contextTokens": 32768,
"maxTokens": 8192
"compat": {
"requiresStringContent": true,
"supportsTools": false
},
{
"id": "google/gemma-4-e4b",
"name": "Gemma 4 E4B",
"api": "openai-completions",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"contextTokens": 64000,
"maxTokens": 8192
"compat": {
"requiresStringContent": true,
"supportsTools": false

alpine rainBOT
#

You’re very close. The main issue now is syntax. You’re missing a few commas and closing } braces.

Here’s a full corrected lmstudio block you can paste in as-is:

"lmstudio": {
  "baseUrl": "http://localhost:1234/v1",
  "api": "openai-completions",
  "auth": "api-key",
  "apiKey": "${LM_API_TOKEN}",
  "models": [
    {
      "id": "mistral-7b-instruct-v0.3",
      "name": "Mistral 7B Instruct v0.3",
      "api": "openai-completions",
      "reasoning": false,
#
      "input": [
        "text"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 32768,
      "contextTokens": 32768,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
#
      }
    },
    {
      "id": "google/gemma-4-e4b",
      "name": "Gemma 4 E4B",
      "api": "openai-completions",
      "reasoning": false,
      "input": [
        "text",
        "image"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
#
        "cacheWrite": 0
      },
      "contextWindow": 131072,
      "contextTokens": 64000,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
    }
  ]
}

A few key fixes there:

#
  • apiKey changed to "${LM_API_TOKEN}"
  • reasoning changed to false
  • added the missing commas
  • added the missing closing braces

After saving:

  1. restart OpenClaw
  2. use /new
  3. test Gemma first, not Mistral

If you want, paste the next error after restart and I’ll keep walking it with you.

celest coral
#

is this correct.

"agents": {
"defaults": {
"workspace": "C:\Users\mainframe\.openclaw\workspace",
"model": {
"primary": "lmstudio/google/gemma-4-e4b"
},
"models": {
"ollama/llama3.1:8b": {},
"jan-local/Jan-v3.5-4B-Q4_K_XL": {},
"jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
"jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
"jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
"lmstudio/google/gemma-4-e4b": {},
"lmstudio/mistral-7b-instruct-v0.3": {}
},
"llm": {
"idleTimeoutSeconds": 0
},
"experimental": {
"localModelLean": true
},
"compaction": {
"reserveTokensFloor": 0
}
}
}

alpine rainBOT
#

Yes, that agents block looks correct âś…

Just two small notes:

  1. It has to sit inside your full top-level config object.
  2. If there is another section after it, make sure there’s a comma after the closing } for "agents".

So now your checklist is:

  • agents.defaults.primary = lmstudio/google/gemma-4-e4b âś…
  • experimental.localModelLean = true âś…
  • compaction.reserveTokensFloor = 0 âś…
  • your separate models.providers.lmstudio block also has:
    • reasoning: false
    • compat.requiresStringContent: true
    • compat.supportsTools: false
    • apiKey: "${LM_API_TOKEN}"
#

If those are all in place, next step is:

  1. save file
  2. restart OpenClaw
  3. run /new
  4. test with a simple message like hello

If it still fails after that, paste the next PowerShell error and we’ll keep going.

celest coral
#

is this correct

"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"auth": "api-key",
"apiKey": "${LM_API_TOKEN}",
"models": [
{
"id": "mistral-7b-instruct-v0.3",
"name": "Mistral 7B Instruct v0.3",
"api": "openai-completions",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"contextTokens": 32768,
"maxTokens": 8192,
"compat": {
"requiresStringContent": true,
"supportsTools": false
}
},
{
"id": "google/gemma-4-e4b",
"name": "Gemma 4 E4B",
"api": "openai-completions",
"reasoning": false,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"contextTokens": 64000,
"maxTokens": 8192,
"compat": {
"requiresStringContent": true,
"supportsTools": false
}
}
]
}
},

alpine rainBOT
#

Almost, yes.

The inside of the lmstudio block looks correct âś…
The only suspicious bit is the very end:

}
  },

That may be one extra } or one extra comma, depending on how the full file is structured.

It should normally sit inside something like:

"models": {
#
  "providers": {
    "lmstudio": {
      ...
    }
  }
}

So the ending should usually be more like:

        }
      ]
    }
  }
#
}

or, if there are more providers after lmstudio, then:

        }
      ]
    },
    "otherProvider": {
      ...
    }
  }
}
#

So:

  • the lmstudio contents themselves are good
  • just double-check the closing braces / trailing comma around it

If you want the safest next step, paste the full models section and I’ll verify the bracket nesting exactly.

celest coral
#

Config invalid
File: ~.openclaw\openclaw.json
Problem:

  • <root>: JSON5 parse failed: SyntaxError: JSON5: invalid character ',' at 56:4

so i need to remove the comma

alpine rainBOT
#

Yes, exactly.

That error usually means the parser hit an extra comma, which matches the }, we spotted earlier.

Most likely this:

}
  },

needs to become either:

}
#

or, if another provider comes after lmstudio:

},

So yes, remove the comma if lmstudio is the last provider block.

After saving, run:

openclaw doctor

If it still says invalid, paste around line 56 and I’ll pinpoint the exact character.

celest coral
#

line 56 is the {, imediately above "session": {
}
},
"agents": {
"defaults": {
"workspace": "C:\Users\mainframe\.openclaw\workspace",
"model": {
"primary": "lmstudio/google/gemma-4-e4b"
},
"models": {
"ollama/llama3.1:8b": {},
"jan-local/Jan-v3.5-4B-Q4_K_XL": {},
"jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
"jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
"jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
"lmstudio/google/gemma-4-e4b": {},
"lmstudio/mistral-7b-instruct-v0.3": {}
},
"llm": {
"idleTimeoutSeconds": 0
},
"experimental": {
"localModelLean": true
},
"compaction": {
"reserveTokensFloor": 0
}
}
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "coding"

alpine rainBOT
#

Yep, I think I see it.

You appear to have two session blocks:

  1. an empty one above agents
  2. the real one below agents

That empty one is likely the problem. I would remove the first empty session block completely and keep only the later one.

So this part:

"session": {
    }
  },
  "agents": {
#

should just become:

"agents": {

And the area should look like this:

"agents": {
  "defaults": {
    "workspace": "C:\\Users\\mainframe\\.openclaw\\workspace",
    "model": {
      "primary": "lmstudio/google/gemma-4-e4b"
    },
    "models": {
#
      "ollama/llama3.1:8b": {},
      "jan-local/Jan-v3.5-4B-Q4_K_XL": {},
      "jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
      "jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
      "jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
      "lmstudio/google/gemma-4-e4b": {},
      "lmstudio/mistral-7b-instruct-v0.3": {}
    },
    "llm": {
      "idleTimeoutSeconds": 0
    },
    "experimental": {
      "localModelLean": true
    },
    "compaction": {
#
      "reserveTokensFloor": 0
    }
  }
},
"session": {
  "dmScope": "per-channel-peer"
},
"tools": {
  "profile": "coding"
}

So:

  • delete the empty session block above agents
  • keep the real session block below
#
  • keep the comma after the closing agents block

If you want, paste 20 lines before and after agents and I can reconstruct the exact fixed chunk for you.

celest coral
#

this I typed in line 56 is the {, imediately above "session": {

it was meant to be
line 56 is the line with }, imediately above "session": {

to point you to where line 56 is

alpine rainBOT
#

Ah, got it, thanks. That helps.

If the error points at the line }, immediately above "session": {, then the problem is most likely one extra } before that line, not just the comma by itself.

The end of your agents block should look like this:

    "compaction": {
      "reserveTokensFloor": 0
    }
  }
},
"session": {
  "dmScope": "per-channel-peer"
},
"tools": {
#
  "profile": "coding"
}

So right before "session" you want:

  • one } to close "defaults"
  • one } to close "agents"
  • then ,
  • then "session"

If you currently have something like this:

    }
#
  }
}
  },
  "session": {

then that extra } is the problem.

So yes, the fix is probably:

  • remove one extra } above the }, line
  • keep the comma that separates "agents" from "session"

If you want, paste just the last 12 lines of agents plus the first 8 lines of session, and I’ll rewrite that exact chunk for you.

celest coral
#

i deleted the extra }
i am now getting Problem:

  • <root>: JSON5 parse failed: SyntaxError: JSON5: invalid end of input at 245:1
    but there is only 144 lines
alpine rainBOT
#

Yep, that’s actually progress.

invalid end of input means:

the file now ends before all { / [ were closed.

So you’re probably missing a closing } at the end, or a ]/} somewhere near the bottom.

Also, the 245:1 part is not unusual here. It can happen when the parser keeps reading to the end and only then realizes something never closed.

Most likely fix

Make sure the very end of the file looks something like this:

"session": {
#
  "dmScope": "per-channel-peer"
},
"tools": {
  "profile": "coding"
}
}

That final last } closes the whole config file.

In plain English

You need:

  • one } to close "tools"
  • one final } to close the root config object
#

Best next step

Paste just the last 25 lines of the file with any secrets redacted.
That should be enough for me to spot the missing closing brace exactly.

Do not paste API keys or tokens.

celest coral
#

i added an extra } at the end of the file.

no I am getting this

🦞 OpenClaw 2026.4.15 (041266a) — Alexa, but with taste.

│
◇ Config warnings ─────────────────────────────────────────────────────────────────────────╮
│ │
│ - models.providers.lmstudio.apiKey: Missing env var "LM_API_TOKEN" - feature using this │
│ value will be unavailable │
│ │
├───────────────────────────────────────────────────────────────────────────────────────────╯
Config invalid
File: ~.openclaw\openclaw.json
Problem:

  • models: Unrecognized keys: "auth", "wizard", "meta", "plugins"
alpine rainBOT
#

Good, this is progress too.

You’ve moved past JSON syntax problems.
Now it’s a config structure problem.

What this error means

models: Unrecognized keys: "auth", "wizard", "meta", "plugins"

That means those keys are currently sitting inside your models block, but they should be top-level siblings of models, not children of it.

So you likely have something shaped like this right now:

#
"models": {
  ...
  "auth": { ... },
  "wizard": { ... },
  "meta": { ... },
  "plugins": { ... }
}

But it should be more like:

{
  "models": {
    "providers": {
#
      "lmstudio": {
        ...
      }
    }
  },
  "auth": { ... },
  "wizard": { ... },
  "meta": { ... },
  "plugins": { ... },
  "agents": { ... },
  "session": { ... },
  "tools": { ... }
}

Also, about LM_API_TOKEN

#

This warning:

Missing env var "LM_API_TOKEN"

means OpenClaw is trying to read the environment variable, but it is not set.

If LM Studio auth is disabled, the docs say you can use any non-empty placeholder value instead, for example:

"apiKey": "placeholder-key"

If LM Studio auth is enabled, then you need to actually set LM_API_TOKEN.

Best next step

celest coral
#

That means those keys are currently sitting inside your models block, but they should be top-level siblings of models, not children of it.

but i did not change any of this. it was working before we made changes

alpine rainBOT
#

Yep, and that’s the frustrating part, you probably didn’t change those keys themselves.

What likely changed is just one brace or comma above them, which changed where OpenClaw thinks the models block ends.

So it’s not:

  • “you moved auth/wizard/meta/plugins on purpose”

It’s more like:

  • “the models section now closes in the wrong place, so OpenClaw is accidentally reading those old top-level keys as if they were inside models”

Same text, wrong nesting.

That’s very normal with hand-editing JSON, especially when you’re doing this for the first time.

Best way forward

#

Please paste from:

"models": {

down to just before:

"agents": {

Redact any secrets if needed.

That should be the exact chunk I need to reconstruct it cleanly for you, without guessing.

Also, separate thing:

#

If LM Studio auth is off, change this:

"apiKey": "${LM_API_TOKEN}"

to:

"apiKey": "placeholder-key"

That will remove the missing env-var warning.

You’re actually pretty close now. The issue is almost certainly just the block boundaries.

celest coral
#

agents comes before models here is the entire agents section of the file befor any changes.

"agents": {
"defaults": {
"workspace": "C:\Users\mainframe\.openclaw\workspace",
"model": {
"primary": "lmstudio/mistral-7b-instruct-v0.3"
},
"models": {
"ollama/llama3.1:8b": {},
"jan-local/Jan-v3.5-4B-Q4_K_XL": {},
"jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
"jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
"jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
"lmstudio/google/gemma-4-e4b": {},
"lmstudio/mistral-7b-instruct-v0.3": {}
},
"llm": {
"idleTimeoutSeconds": 0
}
}
},
"session": {
"dmScope": "per-channel-peer"
},
"tools": {
"profile": "coding"
},

alpine rainBOT
#

Yep, you’re right, and that’s my mistake. In your file, agents comes before models. Sorry about that.

This original chunk was basically fine. The only agents changes we wanted were:

  • change primary to Gemma
  • add experimental.localModelLean
  • add compaction.reserveTokensFloor

So your correct updated agents section should be:

"agents": {
  "defaults": {
    "workspace": "C:\\Users\\mainframe\\.openclaw\\workspace",
    "model": {
      "primary": "lmstudio/google/gemma-4-e4b"
#
    },
    "models": {
      "ollama/llama3.1:8b": {},
      "jan-local/Jan-v3.5-4B-Q4_K_XL": {},
      "jan-deepseek-14b/DeepSeek-R1-Distill-Qwen-14B-Q4_K_M.gguf": {},
      "jan-deep7b/DeepSeek-R1-Distill-Qwen-7B-Q4_K_M.gguf": {},
      "jan-gemma/gemma-4-E4B-it-Q4_K_M": {},
      "lmstudio/google/gemma-4-e4b": {},
      "lmstudio/mistral-7b-instruct-v0.3": {}
    },
    "llm": {
      "idleTimeoutSeconds": 0
    },
    "experimental": {
      "localModelLean": true
#
    },
    "compaction": {
      "reserveTokensFloor": 0
    }
  }
},
"session": {
  "dmScope": "per-channel-peer"
},
"tools": {
  "profile": "coding"
},

So, importantly:

#
  • this agents/session/tools area is not where the models: Unrecognized keys... error is coming from
  • that remaining issue is in the later top-level models block

Next thing I need

Please paste from:

"models": {

to the end of the file.

Redact secrets if needed.

That will let me reconstruct the rest exactly and stop the brace-chasing.

celest coral
#

the entire models block is too long. Here is from the start of the lmstudio section to the end of the models section. the lm studio is the last part before the models section ends.

"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"auth": "api-key",
"apiKey": "LM_API_TOKEN",
"models": [
{
"id": "mistral-7b-instruct-v0.3",
"name": "Mistral 7B Instruct v0.3",
"api": "openai-completions",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"contextTokens": 32768,
"maxTokens": 8192
},
{
"id": "google/gemma-4-e4b",
"name": "Gemma 4 E4B",
"api": "openai-completions",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"contextTokens": 64000,
"maxTokens": 8192
}
]
}
}
},

alpine rainBOT
#

This is helpful.

The end of the models block you pasted looks structurally fine:

      }
    }
  },

That means the models: Unrecognized keys: "auth", "wizard", "meta", "plugins" problem is probably not at the end of models.

It’s most likely near the start of the models block, where OpenClaw is seeing extra keys directly inside "models".

So I need the other end of it

Please paste just:

#
  • the line with "models": {
  • down to the line with "lmstudio": {

That should be enough.

In other words, I want the start of the models block, not the end.

Separate note

The snippet you pasted still has the old LM Studio settings:

  • "apiKey": "LM_API_TOKEN" should become either:
    • "apiKey": "${LM_API_TOKEN}", or
    • "apiKey": "placeholder-key" if LM Studio auth is off
  • reasoning is still true
  • compat is still missing
#

But first let’s fix the models block shape, because until the config parses, the rest won’t matter.

You’re narrowing it down, which is good.

celest coral
#

this file works. it does not have any problems. we just need to make surgical changes to it. you gave me the agents section. now give me the lmstudio section

alpine rainBOT
#

Yep, fair. Let’s do this surgically.

Replace only your current lmstudio block with this:

"lmstudio": {
  "baseUrl": "http://localhost:1234/v1",
  "api": "openai-completions",
  "auth": "api-key",
  "apiKey": "placeholder-key",
  "models": [
    {
      "id": "mistral-7b-instruct-v0.3",
      "name": "Mistral 7B Instruct v0.3",
      "api": "openai-completions",
      "reasoning": false,
#
      "input": [
        "text"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 32768,
      "contextTokens": 32768,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
#
      }
    },
    {
      "id": "google/gemma-4-e4b",
      "name": "Gemma 4 E4B",
      "api": "openai-completions",
      "reasoning": false,
      "input": [
        "text",
        "image"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
#
        "cacheWrite": 0
      },
      "contextWindow": 131072,
      "contextTokens": 64000,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
    }
  ]
}

A couple of notes:

#
  • I used:

    "apiKey": "placeholder-key"
    

    because if LM Studio auth is off, any non-empty value is fine and it avoids the missing env-var warning.

  • If LM Studio auth is actually on, change that one line to:

    "apiKey": "${LM_API_TOKEN}"
    

So the only surgical LM Studio changes are:

  • reasoning: false
  • add the compat block to both models
  • use a non-empty apiKey that actually resolves
#

Then keep the agents changes we already made, restart OpenClaw, do /new, and test Gemma first.

celest coral
#

i think i found the problem you did not give me the entire block until the end of the section. what is the entire block from the start of the lmstudioi block to the complete end of the models section like what i gave you

alpine rainBOT
#

Yep, good catch. Since lmstudio is the last provider before the models section ends, this is the full chunk from the start of lmstudio to the complete end of models:

"lmstudio": {
  "baseUrl": "http://localhost:1234/v1",
  "api": "openai-completions",
  "auth": "api-key",
  "apiKey": "placeholder-key",
  "models": [
    {
      "id": "mistral-7b-instruct-v0.3",
      "name": "Mistral 7B Instruct v0.3",
      "api": "openai-completions",
      "reasoning": false,
      "input": [
        "text"
#
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
      "contextWindow": 32768,
      "contextTokens": 32768,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
    },
#
    {
      "id": "google/gemma-4-e4b",
      "name": "Gemma 4 E4B",
      "api": "openai-completions",
      "reasoning": false,
      "input": [
        "text",
        "image"
      ],
      "cost": {
        "input": 0,
        "output": 0,
        "cacheRead": 0,
        "cacheWrite": 0
      },
#
      "contextWindow": 131072,
      "contextTokens": 64000,
      "maxTokens": 8192,
      "compat": {
        "requiresStringContent": true,
        "supportsTools": false
      }
    }
  ]
}
      }
    }
  },

Those last lines mean:

#
  • first } closes lmstudio
  • next } closes providers
  • next } closes models
  • trailing , means another top-level section follows after models

If you want, paste the exact chunk you replace it with after saving, and I’ll do one final sanity check before you restart.

celest coral
#

this is from the start of lm studio section to the end of the entire models block.

"lmstudio": {
"baseUrl": "http://localhost:1234/v1",
"api": "openai-completions",
"auth": "api-key",
"apiKey": "placeholder-key",
"models": [
{
"id": "mistral-7b-instruct-v0.3",
"name": "Mistral 7B Instruct v0.3",
"api": "openai-completions",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 32768,
"contextTokens": 32768,
"maxTokens": 8192,
"compat": {
"requiresStringContent": true,
"supportsTools": false
}
},
{
"id": "google/gemma-4-e4b",
"name": "Gemma 4 E4B",
"api": "openai-completions",
"reasoning": false,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 131072,
"contextTokens": 64000,
"maxTokens": 8192,
"compat": {
"requiresStringContent": true,
"supportsTools": false
}
}
]
}
}
},

alpine rainBOT
#

Yes, this chunk now looks structurally correct âś…

The ending:

    }
        ]
      }
    }
  },

is ugly indentation-wise, but the brace count is fine if:

  • ] closes the LM Studio models array
  • first } closes lmstudio
  • second } closes providers
#
  • final }, closes models and continues to the next top-level section

So at this point:

  1. save the file
  2. run openclaw doctor
  3. if config is valid, restart OpenClaw
  4. run /new
  5. test Gemma

Important

If OpenClaw still says:

models: Unrecognized keys: "auth", "wizard", "meta", "plugins"
#

then this LM Studio tail is not the problem anymore.
That would mean the remaining issue is earlier in the models block, before lmstudio.

So go ahead and test this version first. If it still errors, paste the exact new error and we’ll do the next surgical step.

celest coral
#

it crashed. logs from lm studio. heres the first part

2026-04-19 22:37:24 [INFO]
[google/gemma-4-e4b] Running chat completion on conversation with 7 messages.
2026-04-19 22:37:24 [INFO]
[google/gemma-4-e4b] Streaming response...
2026-04-19 22:37:24 [DEBUG]
LlamaV4::predict slot selection: session_id=<empty> server-selected (LCP/LRU)
2026-04-19 22:37:24 [DEBUG]
slot get_availabl: id 3 | task -1 | selected slot by LRU, t_last = -1
srv get_availabl: updating prompt cache
srv load: - looking for better prompt, base f_keep = -1.000, sim = 0.000
2026-04-19 22:37:24 [DEBUG]
srv update: - cache state: 0 prompts, 0.000 MiB (limits: 8192.000 MiB, 131072 tokens, 8589934592 est)
srv get_availabl: prompt cache update took 2.14 ms
2026-04-19 22:37:24 [DEBUG]
slot launch_slot_: id 3 | task -1 | sampler chain: logits -> penalties -> ?dry -> ?top-n-sigma -> top-k -> ?typical -> top-p -> min-p -> ?xtc -> ?temp-ext -> dist
slot launch_slot_: id 3 | task 0 | processing task, is_child = 0
slot update_slots: id 3 | task 0 | new prompt, n_ctx_slot = 131072, n_keep = 7039, task.n_tokens = 7490
slot update_slots: id 3 | task 0 | cache reuse is not supported - ignoring n_cache_reuse = 256
slot update_slots: id 3 | task 0 | n_tokens = 0, memory_seq_rm [0, end)
slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 512, batch.n_tokens = 512, progress = 0.068358
2026-04-19 22:37:24 [INFO]
[google/gemma-4-e4b] Prompt processing progress: 0.0%
2026-04-19 22:37:24 [DEBUG]
slot update_slots: id 3 | task 0 | n_tokens = 512, memory_seq_rm [512, end)
slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 1024, batch.n_tokens = 512, progress = 0.136716
2026-04-19 22:37:24 [INFO]

#

heres the second part
[google/gemma-4-e4b] Prompt processing progress: 6.8%
2026-04-19 22:37:36 [DEBUG]
slot update_slots: id 3 | task 0 | n_tokens = 1024, memory_seq_rm [1024, end)
2026-04-19 22:37:36 [DEBUG]
slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 1536, batch.n_tokens = 512, progress = 0.205073
2026-04-19 22:37:36 [INFO]
[google/gemma-4-e4b] Prompt processing progress: 13.7%
2026-04-19 22:37:51 [DEBUG]
slot update_slots: id 3 | task 0 | n_tokens = 1536, memory_seq_rm [1536, end)
slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 2048, batch.n_tokens = 512, progress = 0.273431
2026-04-19 22:37:51 [INFO]
[google/gemma-4-e4b] Prompt processing progress: 20.5%
2026-04-19 22:38:07 [DEBUG]
slot update_slots: id 3 | task 0 | n_tokens = 2048, memory_seq_rm [2048, end)
slot update_slots: id 3 | task 0 | prompt processing progress, n_tokens = 2560, batch.n_tokens = 512, progress = 0.341789
2026-04-19 22:38:07 [INFO]
[google/gemma-4-e4b] Prompt processing progress: 27.3%
2026-04-19 22:38:40 [ERROR]
[google/gemma-4-e4b] Model reloaded.. Error Data: n/a, Additional Data: n/a

alpine rainBOT
#

This is actually good news.

It means:

  • OpenClaw is reaching LM Studio
  • LM Studio is starting the request
  • the model is processing the prompt

So the config work got us past the earlier setup issues âś…

What you pasted is not the crash yet, it’s just the beginning of prompt processing.

The important part is the bottom of the log, where it actually fails.

Please paste next

  • the last 30 to 50 lines from the LM Studio log around the crash
#
  • and, if OpenClaw/PowerShell shows an error too, paste that as well

Right now the biggest clue I see is:

task.n_tokens = 7490

That means even a simple “hello” is turning into a fairly large prompt, so if this is failing it may be due to prompt pressure / backend limits. But I want the actual final error lines before guessing.

So, please send the end of the crash log, not the beginning.

#

Okay, this is the first really useful runtime clue.

This does not look like OpenClaw crashing now.
It looks like LM Studio is reloading/unloading the model during prompt processing:

[google/gemma-4-e4b] Model reloaded.. Error Data: n/a

And the other big clue is:

task.n_tokens = 7490
n_ctx_slot = 131072

So for a simple “hello”, OpenClaw is still sending a fairly large prompt, and your LM Studio/Gemma setup is trying to handle it with a very large context budget on a Core Ultra 5 laptop. I’m pretty sure that’s the real problem now.

#

What I would change next

In the Gemma entry, temporarily lower the context a lot:

{
  "id": "google/gemma-4-e4b",
  "name": "Gemma 4 E4B",
  "api": "openai-completions",
  "reasoning": false,
  "input": [
    "text",
    "image"
  ],
  "cost": {
    "input": 0,
#
    "output": 0,
    "cacheRead": 0,
    "cacheWrite": 0
  },
  "contextWindow": 16384,
  "contextTokens": 16384,
  "maxTokens": 2048,
  "compat": {
    "requiresStringContent": true,
    "supportsTools": false
  }
}

Why

#

Right now your config is effectively telling LM Studio / OpenClaw to work with a huge context for a laptop-class local model. That often causes reloads, evictions, or stalls before the model even starts answering.

Also do this

  • keep using Gemma, not Mistral, for now
  • restart OpenClaw after saving
  • do /new
  • test again with a tiny prompt like hello

If it still reloads after dropping context to 16384, then I’d try 8192 next.

Docs:
https://docs.openclaw.ai/providers/lmstudio
https://docs.openclaw.ai/gateway/local-models

If you want, after you change the Gemma entry, paste just that one entry and I’ll sanity-check it.

celest coral
#

i did not make any changes. I just reloaded the model in lm sudio and tried again.

2026-04-19 22:48:36 [INFO]
[google/gemma-4-e4b] Prompt processing progress: 20.3%
2026-04-19 22:49:07 [ERROR]
[google/gemma-4-e4b] The model has crashed without additional information. (Exit code: 18446744072635812000). Error Data: n/a, Additional Data: n/a

why is it doing this now. it seems like a step back. without the changes, it completed the heartbeat prompt showed up but did not provide a response. what is the reason this is happening

alpine rainBOT
#

I get why that feels like a step back, but I don’t think it actually is.

What changed is not the underlying problem, only how it is failing.

Before, the model was already not successfully completing the turn. It looked like:

  • heartbeat / bootstrap text appears
  • no final reply

Now LM Studio is showing the real failure more clearly:

  • prompt starts processing
  • model reaches ~20%
  • model process crashes

So the likely story is:

#
  1. OpenClaw sends a fairly large agent prompt
  2. LM Studio / Gemma on this laptop is right on the edge
  3. sometimes it stalls or silently fails
  4. sometimes it reloads
  5. sometimes it hard-crashes

That kind of inconsistency is very common when a local model/backend is under memory or context pressure.

Why it is doing this now

Because the model/backend is unstable at this workload.

The clues are:

  • earlier log showed about 7490 input tokens for a simple turn
  • LM Studio later showed:
#
  The model has crashed without additional information

So the issue is probably LM Studio/Gemma + hardware limits, not “you broke the config”.

Why the heartbeat showed up before

That does not mean the real turn succeeded.
It only means OpenClaw got far enough into bootstrap / prompt setup to show some activity.

The actual answer generation still never completed reliably.

My honest read

At this point, the config is no longer the main problem.
The main problem is that Gemma 4 E4B in LM Studio on that laptop is not handling OpenClaw’s prompt reliably.

#

Best next step

I would still do the same targeted reduction:

"contextWindow": 16384,
"contextTokens": 16384

for the Gemma entry, then restart and test again.

If it still crashes, drop to:

"contextWindow": 8192,
"contextTokens": 8192
#

That’s not random tweaking, it’s directly aimed at the failure the logs are showing.

If you want, I can give you the exact tiny 2-line Gemma edit only, nothing else.

steep reefBOT
celest coral
#

but before the llm would not crash it would complete

alpine rainBOT
#

You’re right, and that’s a fair point.

If before it completed without crashing, and now it crashes, then yes, the behavior changed.

The most likely reason is:

we changed the exact request shape OpenClaw sends to LM Studio.

Even though the user message is still just hello, these changes alter the payload:

  • reasoning: true → false
  • added compat.requiresStringContent
  • added compat.supportsTools: false
  • added localModelLean
  • changed model selection / session behavior

So LM Studio is now seeing a different prompt structure, and on a fragile local setup that can absolutely change the symptom from:

#
  • “completes but gives no useful reply”

to:

  • “crashes during prompt processing”

So no, you’re not imagining it. It really can get worse in a different way after config changes.

What I’d do now

At this point, the cleanest move is:

  1. go back to the last non-crashing config
  2. then apply one change at a time

That way we stop guessing.

#

If you want, I can help you do that in the safest order, with exactly one change per test. That’s probably the fastest way to figure out which setting is causing the crash versus which one might actually help.

celest coral
#

what model is recomended to run on a core ultra5 135u with 32 gigs of ran with openclaw

alpine rainBOT
#

Short version, on a Core Ultra 5 135U + 32 GB RAM, I would not expect local models to be reliable for full OpenClaw agent use.

They can sometimes handle plain chat, but OpenClaw is heavier than plain chat because it adds:

  • system instructions
  • session history
  • tools
  • compaction / memory behavior

So on that hardware, local models are usually demo / experiment tier, not “reliable daily driver” tier.

My honest recommendation:

  • for real use, pick a cloud model as primary
  • if you want, keep a local fallback for experiments
  • for current hands-on model recommendations, ask in #models because that changes fast