#Make OpenClaw work with a local LLM.

1 messages · Page 1 of 1 (latest)

low slateBOT
#

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

severe creekBOT
#

Yes — OpenClaw can talk to a local LLM via LM Studio as long as LM Studio is running its OpenAI-compatible HTTP server (/v1/...).

Docs + working config examples:

High-level setup:

  1. In LM Studio: start the local server (default is usually http://127.0.0.1:1234), and confirm http://127.0.0.1:1234/v1/models returns a model list.
  2. In OpenClaw config: add an lmstudio provider with baseUrl: "http://127.0.0.1:1234/v1" and register the model ID you see from /v1/models.
  3. Point your agent default model at lmstudio/<model-id>.
  4. Verify with openclaw models status.

Important reality check: local models work, but for “full OpenClaw agent” behavior (big context, tool calling, jailbreak resistance), you generally need a pretty serious GPU box. If you tell me:

  • what OS you’re on,
  • whether OpenClaw runs on the same machine as LM Studio,
  • and your GPU (and VRAM),
    …I can point you at the least-painful way to wire it up.
#

On a single Windows 11 box + a 4060, this is totally doable — just set expectations: a 4060 (usually 8GB VRAM) will run smaller/quantized models fine for chat, but OpenClaw’s “full agent” behavior (huge context + reliable tool calling) can get shaky on small local models.

Recommended setup on Windows: OpenClaw in WSL2 + LM Studio on Windows

Windows docs: https://docs.openclaw.ai/platforms/windows
Local models docs (LM Studio): https://docs.openclaw.ai/gateway/local-models

  1. Run LM Studio server
  • Start the Local Server in LM Studio (default: http://127.0.0.1:1234)
  • Make sure a model is loaded
  1. From WSL2, verify you can reach LM Studio
    In WSL:
curl http://127.0.0.1:1234/v1/models

If that fails, WSL2 localhost-forwarding is the culprit. Easiest workaround: set LM Studio server to listen on 0.0.0.0 or use the Windows host IP from inside WSL (the “default gateway” IP) as the baseUrl.

#
  1. Add an lmstudio provider + pick the model id
    Use the model id you see in /v1/models (replace <MODEL_ID> below):
{
agents: {
defaults: {
model: { primary: "lmstudio/<MODEL_ID>" },
models: {
"lmstudio/<MODEL_ID>": { alias: "LM Studio Local" },
},
},
},

models: {
mode: "merge",
#
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio",
api: "openai-completions",
models: [
{
id: "<MODEL_ID>",
name: "Local (LM Studio)",
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

// set these to what your model/runtime can actually do
contextWindow: 8192,
maxTokens: 2048
}
#
]
}
}
}
}
  1. Sanity-check:
openclaw models status

What I’d do with a 4060

  • Start with basic chat + light tasks (no heavy browsing/coding expectations).
  • Keep contextWindow realistic (8k/16k is common on small local builds).
  • If you hit “tool calling JSON” weirdness, that’s usually the local model quality/quantization — not you.
#

If you paste the output of:

  • curl http://127.0.0.1:1234/v1/models (just the model IDs), and
  • whether your 4060 is 8GB or 16GB,
    …I can tell you what to put for <MODEL_ID>, contextWindow, and maxTokens so it doesn’t instantly fall over.
severe creekBOT
#

Step 3 is basically: (a) figure out your LM Studio model “id” and (b) put that id into ~/.openclaw/openclaw.json under models.providers.lmstudio + set it as your default model.

3.1 Get the model id from LM Studio

Run this in the same place OpenClaw runs (likely WSL2 Ubuntu):

curl http://127.0.0.1:1234/v1/models

You’ll get JSON back. Look for something like:

{ "id": "your-model-id-here", ... }

Copy the id exactly (case-sensitive).

#

If you have jq, this is easier:

curl -s http://127.0.0.1:1234/v1/models | jq -r '.data[].id'

3.2 Edit your OpenClaw config

Open the config file (JSON5) here:

Edit it:

nano ~/.openclaw/openclaw.json

Then add/merge this (replace <MODEL_ID> with what you copied):

#
{
agents: {
defaults: {
// this sets your default model
model: { primary: "lmstudio/<MODEL_ID>" },

// if you have an allowlist, make sure the lmstudio model is in it
models: {
"lmstudio/<MODEL_ID>": { alias: "LM Studio Local" },
},
},
},

models: {
mode: "merge",
#
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio",
api: "openai-responses",
models: [
{
id: "<MODEL_ID>",
name: "LM Studio Local",
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
// optional, but nice to set to something realistic for your local model:
// contextWindow: 8192,
// maxTokens: 2048,
},
],
#
},
},
},
}

3.3 Validate it

openclaw doctor
openclaw models status

If you get an error about the LM Studio API mode, switch this line:

  • api: "openai-responses" → api: "openai-completions" (LM Studio support varies by build/model)

If you paste the output of curl http://127.0.0.1:1234/v1/models (or at least the model ids), I’ll tell you exactly what to use for <MODEL_ID>.

#

openclaw.json is not inside the OpenClaw install folder/repo — it lives in your state dir and it’s optional, so it often doesn’t exist yet.

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

First: are you running OpenClaw in WSL2 or native Windows?

  • If you installed via WSL2 (recommended): the file is inside Linux, at ~/.openclaw/openclaw.json
  • If you’re running native in PowerShell: it should be at:
    C:\Users\<YOU>\.openclaw\openclaw.json

Quick way to locate the state dir

Run:

openclaw status --all

It usually prints paths (state/workspace/config) so you can see exactly where it’s looking.

If the file doesn’t exist: create it (native Windows / PowerShell)

#
mkdir $env:USERPROFILE\.openclaw -ea 0
notepad $env:USERPROFILE\.openclaw\openclaw.json

Then paste your config in there and save.

If you’re in WSL2 instead

In Ubuntu (WSL):

ls -la ~/.openclaw
nano ~/.openclaw/openclaw.json

Tell me which one you’re using (WSL2 or native), and paste the output of openclaw status --all (you can redact tokens) — then I’ll point you to the exact path + next command.

#

Cool — now we need to (1) grab your LM Studio model id, then (2) paste a config block that tells OpenClaw to use it.

1) Get the LM Studio model id (PowerShell)

Make sure LM Studio’s Local Server is running first.

In PowerShell, run:

(Invoke-RestMethod http://127.0.0.1:1234/v1/models).data | Select-Object id

You’ll see one or more id values. Copy the one you want (exactly).

2) Paste this into openclaw.json

Replace <MODEL_ID> with the id you copied:

#
{
agents: {
defaults: {
model: { primary: "lmstudio/<MODEL_ID>" },
models: {
"lmstudio/<MODEL_ID>": { alias: "LM Studio Local" },
},
},
},

models: {
mode: "merge",
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
#
apiKey: "lmstudio",
api: "openai-completions", // if this errors, tell me what it says
models: [
{
id: "<MODEL_ID>",
name: "LM Studio Local",
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 8192,
maxTokens: 2048,
},
],
},
},
},
}
#

Save the file.

3) Restart + verify

openclaw gateway restart
openclaw models status

If you paste the output of the /v1/models call (or just the model id you chose) + any error you get from models status, I’ll tell you the exact fix.

#

That error means OpenClaw is still trying to use liquid/lfm2.5-1.2b as your default model, but you don’t have a liquid provider configured, so it can’t resolve it.

You want your default to be lmstudio/<something> instead.

Fix it (in openclaw.json)

  1. Open openclaw.json again and CTRL+F for lfm or liquid.

  2. Find the default model line. It’ll look like one of these:

model: "liquid/lfm2.5-1.2b"

or

#
model: { primary: "liquid/lfm2.5-1.2b" }

Change it to your LM Studio model:

model: { primary: "lmstudio/<YOUR_LMSTUDIO_MODEL_ID>" }
  1. Make sure you also have the LM Studio provider block somewhere in the file (under models.providers.lmstudio) and that the id matches the same model id:
models: {
mode: "merge",
providers: {
#
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio",
api: "openai-completions",
models: [{ id: "<YOUR_LMSTUDIO_MODEL_ID>", name: "LM Studio Local" }],
},
},
},

Then restart + verify

openclaw gateway restart
openclaw models status
#

If you paste the output of:

(Invoke-RestMethod http://127.0.0.1:1234/v1/models).data | Select-Object id

…I’ll tell you exactly which <YOUR_LMSTUDIO_MODEL_ID> string to use, and I can sanity-check your config if you paste just the agents + models sections (no secrets needed).

#

Perfect — that explains the error.

Your LM Studio model id contains a slash (liquid/lfm2.5-1.2b). In OpenClaw, the provider is still lmstudio, so your model ref must be:

lmstudio/liquid/lfm2.5-1.2b (NOT liquid/lfm2.5-1.2b)

Put this in openclaw.json (or merge into what you have)

Replace only the relevant parts:

{
agents: {
defaults: {
model: { primary: "lmstudio/liquid/lfm2.5-1.2b" },
models: {
"lmstudio/liquid/lfm2.5-1.2b": { alias: "LM Studio" },
#
},
},
},

models: {
mode: "merge",
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio",
api: "openai-completions",
models: [
{
id: "liquid/lfm2.5-1.2b",
name: "LFM 2.5 1.2B (LM Studio)",
#
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
},
],
},
},
},
}

Restart + check

openclaw gateway restart
openclaw models status

If it still complains, paste your openclaw models status output (and the agents.defaults + models.providers.lmstudio sections of your config).

#

That means OpenClaw thinks the lmstudio provider has no API key.

Even though LM Studio doesn’t really require auth, OpenClaw still wants a non-empty apiKey for OpenAI-compatible providers.

1) Make sure your openclaw.json has this (exactly)

Under models.providers.lmstudio, set a dummy key:

models: {
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio", // <- must be non-empty
api: "openai-completions",
models: [{ id: "liquid/lfm2.5-1.2b", name: "LFM 2.5 1.2B" }],
},
#
},
},

Save the file, then:

openclaw gateway restart
openclaw models status

2) If it STILL says “Missing auth: lmstudio”

Set an env var (some setups check this path):

Temporary (current PowerShell only):

#
$env:LMSTUDIO_API_KEY="lmstudio"
openclaw gateway restart
openclaw models status

Permanent:

setx LMSTUDIO_API_KEY "lmstudio"

Then open a new PowerShell and restart the gateway again.

If you paste just your models: { ... } block from openclaw.json, I’ll spot what key/path is off.

#

Yep — that auth.profiles block is not where the LM Studio “API key” goes.

  • auth.profiles is basically metadata (“this provider uses api_key auth”), it does not configure the provider endpoint or store the key.
  • For LM Studio you want a custom provider under models.providers.lmstudio and give it a dummy apiKey string (LM Studio doesn’t validate it, but OpenClaw wants something there).

Paste this into the top level of your openclaw.json (you can keep your existing auth block too — just don’t duplicate keys):

{
agents: {
defaults: {
model: { primary: "lmstudio/liquid/lfm2.5-1.2b" },
models: {
"lmstudio/liquid/lfm2.5-1.2b": { alias: "LM Studio" },
},
},
#
},

models: {
mode: "merge",
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
apiKey: "lmstudio", // <- dummy is fine, but must exist
api: "openai-completions",
models: [
{
id: "liquid/lfm2.5-1.2b",
name: "LFM 2.5 1.2B (LM Studio)",
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
},
#
],
},
},
},
}

Then run:

openclaw gateway restart
openclaw models status

If it still says “Missing auth: lmstudio”, paste your full models: { ... } section from openclaw.json (no secrets needed — “lmstudio” is not a real secret anyway) and I’ll point out what’s not being picked up.

#

That error means: OpenClaw can’t find that model in its model registry (so it never even tries to call LM Studio).

To fix it, we need to confirm whether your lmstudio provider + model entry actually made it into the registry (models.json) that the embedded agent uses.

1) Quick check: does OpenClaw “see” your lmstudio model?

Run in PowerShell and paste output:

openclaw models list --all --provider lmstudio --plain

You should see a line like:
lmstudio/liquid/lfm2.5-1.2b

If you don’t see it, OpenClaw isn’t picking up your models.providers.lmstudio.models config.

2) Check the file OpenClaw actually uses for custom providers

#

OpenClaw writes custom providers into:

%USERPROFILE%\.openclaw\agents\main\agent\models.json

Can you check if that file exists, and whether it contains liquid/lfm2.5-1.2b under an lmstudio provider?

(Quick way to locate it:)

dir $env:USERPROFILE\.openclaw\agents -Recurse -Filter models.json

3) Paste these two outputs so I can point to the exact mismatch

openclaw --version
openclaw config get models.providers.lmstudio
#

Common cause here: you edited openclaw.json, but the running Gateway/service is using a different config file (or never restarted the running process). openclaw gateway status will also reveal that if needed.

#

If models.json doesn’t exist, OpenClaw has no local model registry, so lmstudio/... models will stay Unknown model.

Easiest fix: create models.json manually in the agent dir (LM Studio ignores the key, but the registry requires it).

1) Find your OpenClaw agent dir (where models.json must live)

Run in PowerShell:

openclaw gateway status

Look for a line like Agent dir (or anything showing ...\.openclaw\agents\main\agent).
That folder is where models.json goes.

2) Create models.json there

Most common path on Windows is:
%USERPROFILE%\.openclaw\agents\main\agent\models.json

#

Create folders + open the file:

mkdir $env:USERPROFILE\.openclaw\agents\main\agent -Force
notepad $env:USERPROFILE\.openclaw\agents\main\agent\models.json

Paste this JSON and save:

{
"providers": {
"lmstudio": {
"baseUrl": "http://127.0.0.1:1234/v1",
"api": "openai-completions",
"apiKey": "lmstudio",
"models": [
#
{ "id": "liquid/lfm2.5-1.2b", "name": "LFM 2.5 1.2B (LM Studio)" }
]
}
}
}

3) Restart + verify OpenClaw can see it

openclaw gateway restart
openclaw models list --all --provider lmstudio --plain

You should see:
lmstudio/liquid/lfm2.5-1.2b

#

If you don’t, paste the output of openclaw gateway status (you can redact tokens) and I’ll tell you the exact folder OpenClaw is using on your machine.

#

openclaw config get models.providers.lmstudio returning “Config path not found” means OpenClaw is not loading any models.providers from your config right now (either you edited the wrong file, or the gateway isn’t using that config).

Let’s make it concrete and get you unblocked.

1) Confirm where OpenClaw is reading config + where the agent dir is

In PowerShell run:

openclaw gateway status

You’re looking for two things in the output:

  • Config path (where it expects openclaw.json)
  • Agent dir (where it expects models.json)

2) Put openclaw.json in the state dir (not your C:\Users\jakes\openclaw\ repo folder)

On Windows it should be here:

#
notepad $env:USERPROFILE\.openclaw\openclaw.json

Paste this minimal config (JSON5 is fine):

{
agents: {
defaults: {
model: { primary: "lmstudio/liquid/lfm2.5-1.2b" },
models: {
"lmstudio/liquid/lfm2.5-1.2b": { alias: "LM Studio" },
},
},
},
#
}

Save.

3) Create the actual model registry file (models.json)

This is the part that fixes “Unknown model: lmstudio/…”.

Create/open:

mkdir $env:USERPROFILE\.openclaw\agents\main\agent -Force
notepad $env:USERPROFILE\.openclaw\agents\main\agent\models.json

Paste and save:

#
{
"providers": {
"lmstudio": {
"baseUrl": "http://127.0.0.1:1234/v1",
"api": "openai-completions",
"apiKey": "lmstudio",
"models": [
{ "id": "liquid/lfm2.5-1.2b", "name": "LFM 2.5 1.2B (LM Studio)" }
]
}
}
}

4) Restart + verify it’s visible

#
openclaw gateway restart
openclaw models list --all --provider lmstudio --plain

If you paste the output of openclaw gateway status, I can tell you the exact config path + agent dir it’s using (in case yours differs from the defaults).

#

Nice — that status output tells us the important bit:

  • Config (service) is: C:\Users\jakes\.openclaw\openclaw.json
    So you’re editing the right file now.

Your “Unknown model: lmstudio/liquid/lfm2.5-1.2b” + “models.json doesn’t exist” basically means: your config still doesn’t contain the models: { providers: { lmstudio: ... } } block, so OpenClaw never registers the LM Studio model.

1) Open the right config file and add the LM Studio provider

Open:

notepad $env:USERPROFILE\.openclaw\openclaw.json

Make sure it contains both of these top-level blocks (you can paste them into your existing file; don’t put them inside auth:):

#
{
agents: {
defaults: {
model: { primary: "lmstudio/liquid/lfm2.5-1.2b" },
models: {
"lmstudio/liquid/lfm2.5-1.2b": { alias: "LM Studio" },
},
},
},

models: {
mode: "merge",
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1",
#
apiKey: "lmstudio",
api: "openai-completions",
models: [
{ id: "liquid/lfm2.5-1.2b", name: "LFM 2.5 1.2B (LM Studio)" },
],
},
},
},
}

Also: double-check Windows didn’t save it as openclaw.json.txt.

2) Restart + verify OpenClaw can now “see” the provider

#
openclaw doctor
openclaw gateway restart
openclaw config get models.providers.lmstudio
openclaw models list --all --provider lmstudio --plain

At the end you should see:
lmstudio/liquid/lfm2.5-1.2b

3) If the gateway service keeps exiting immediately

Your status says the Scheduled Task is “Ready” (not running) and “likely exited immediately”. In that case, the log will tell us exactly why:

Get-Content C:\tmp\openclaw\openclaw-2026-02-06.log -Tail 80
#

Paste that tail if step 2 still doesn’t work.

#

Found the problem in your openclaw.json: you’re setting the default model to liquid/lfm2.5-1.2b, but you never defined a models.providers.lmstudio provider, so OpenClaw has no idea where “liquid/…” should come from.

You want:

  • model ref (what the agent uses): lmstudio/liquid/lfm2.5-1.2b
  • provider config (where LM Studio server lives): models.providers.lmstudio

Edit these 2 spots in your file

1) Change the default model + allowlist entry

Replace:

"primary": "liquid/lfm2.5-1.2b"

with:

#
"primary": "lmstudio/liquid/lfm2.5-1.2b"

And replace:

"models": {
"liquid/lfm2.5-1.2b": {}
}

with:

"models": {
#
"lmstudio/liquid/lfm2.5-1.2b": {}
}

2) Add the LM Studio provider under your existing "models": { ... }

Right now your models block only has bedrockDiscovery. Change it to include mode + providers like this:

"models": {
"bedrockDiscovery": {
"defaultContextWindow": 128000
},
"mode": "merge",
"providers": {
"lmstudio": {
#
"baseUrl": "http://127.0.0.1:1234/v1",
"api": "openai-completions",
"apiKey": "lmstudio",
"models": [
{
"id": "liquid/lfm2.5-1.2b",
"name": "LFM 2.5 1.2B (LM Studio)",
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }
}
]
}
}
}

Restart + verify

#
openclaw gateway restart
openclaw models list --all --provider lmstudio --plain
openclaw models status

You should see lmstudio/liquid/lfm2.5-1.2b in the list, and the “Unknown model” error should go away.

If the Scheduled Task still exits immediately, paste the last ~80 lines of:
C:\tmp\openclaw\openclaw-2026-02-06.log (that will show the exact crash reason).

#

If the Gateway starts but you get no replies, it’s almost always one of these:

  1. No chat “surface” is configured (so nothing is delivering messages to the agent), or
  2. Messages are arriving but being blocked by policy (pairing / allowlist / require-mention), or
  3. Messages arrive but the LM Studio call is erroring (often “context too large” because the defaults assume huge context).

Let’s pinpoint which one in 2 minutes.

1) Are you talking to it on Discord, or somewhere else?

Your config you pasted earlier only had iMessage enabled — iMessage won’t work on Windows, and there was no channels.discord block.

So if you expect Discord replies, you need Discord configured:
Docs: https://docs.openclaw.ai/channels/discord

2) Check whether any channel is connected

Run (PowerShell) and paste the output:

#
openclaw channels status --probe
  • If Discord isn’t listed / is disabled → you’re not actually connected to a chat surface yet.
  • If it is listed but says pairing/allowlist/mention required → that explains “no response”.

3) Check logs while you send a test message

In one terminal:

openclaw logs --follow

Then send a message to your bot (DM or in a server channel).

What we’re looking for in logs:

  • No inbound message at all → channel not connected / wrong bot token / permissions.
#
  • Inbound message shows up, then an LLM error → LM Studio/provider config issue (very common).

4) If it’s the LM Studio call failing: set realistic limits

Right now your model is a 1.2B model; if OpenClaw thinks it has a 200k context window, LM Studio will reject the request and you’ll get no reply.

In your models.providers.lmstudio.models[0] entry, add something like:

contextWindow: 8192,
maxTokens: 1024,

Then restart gateway.


Paste these two outputs and I’ll tell you exactly what’s wrong: