# Set up OpenClaw with a local LM Studio model

Canonical: https://cwyn.com/pages/openclaw-guide-first-lm-studio-model.html
Last updated: 2026-11-19T14:24:54-05:00

OpenClaw operations guide

Short answer. Start the LM Studio server on the Gateway host, choose a discovered model in OpenClaw onboarding, and verify a local reply. Use a fresh OpenClaw setup and install LM Studio on the same host. Make a chat model available in LM Studio before starting onboarding.

Last updated November 19, 2026

The [OpenClaw Complete Setup Pack](https://cwyn.com/pages/pack-openclaw-complete-setup-pack.html) is an optional paid kit ($14.95). Use its rollback checklist to record and retest your model settings when you change them.

OpenClaw Complete Setup Pack $14.95

Start an OpenClaw workspace with editable instructions, local Gateway and tool presets, and checklists for pairing, memory, costs and rollback.

By CWYN · Reviewed November 19, 2026 against OpenClaw 2026.11.6

## 1. Prepare a model in LM Studio

Use a fresh OpenClaw setup and install LM Studio on the same host. Make a chat model available in LM Studio before starting onboarding. The [provider guide](https://docs.openclaw.ai/providers/lmstudio) says automatic selection requires LM Studio to report tool training and at least 16K effective context. When a model is loaded, the loaded context takes precedence over its advertised maximum.

## 2. Start the local model server

Start LM Studio’s server and keep it on the same host for this test. If authentication is enabled, have the LM Studio token ready for the onboarding prompt. Leave the prompt blank when the server does not require a key.

```
lms server start --port 1234
```

## 3. Select LM Studio in OpenClaw onboarding

Start the wizard, choose LM Studio, and enter `localhost:1234` at the server URL prompt. Pick the intended model at Default model. The wizard checks the route with a model completion before saving it.

```
openclaw onboard
```

## 4. Check the model identifier

Refresh the LM Studio model list. Look for the `lmstudio/` entry for the model you chose. The rest of the identifier is the model key reported by LM Studio. If the list cannot refresh, confirm the server is still running and check its authentication settings.

```
openclaw models list --provider lmstudio --refresh
```

## 5. Run a prompt against the exact local model

Replace `<model-key>` with the part of the identifier after `lmstudio/`. Run the [inference command](https://docs.openclaw.ai/cli/infer) to pin the request to that model. `--local` refuses while a Gateway owns the OpenClaw state directory, so stop the Gateway first, or drop `--local` to send the same request through the running Gateway. Check that the result includes the test reply.

```
openclaw infer model run --local --model lmstudio/<model-key> --prompt "Reply with local model test" --json
```

[Get your free CWYN Score](https://cwyn.com/pages/score.html)

## Related guides

- [OpenClaw Ollama setup: connect your first local model](https://cwyn.com/pages/openclaw-guide-first-local-ollama-model.html)
- [Change the default OpenClaw model with the CLI](https://cwyn.com/pages/openclaw-guide-change-default-model.html)
- [OpenClaw Ollama Cloud rejects max_tokens](https://cwyn.com/pages/openclaw-guide-ollama-cloud-max-tokens.html)
- [Set up OpenClaw memory search with Ollama](https://cwyn.com/pages/openclaw-guide-first-ollama-memory-search.html)

## Next steps

- [All 135 OpenClaw guides](https://cwyn.com/guides/openclaw/)
- [OpenClaw setup walkthrough](https://cwyn.com/setup/openclaw/)
- [Estimate your AI costs](https://cwyn.com/score/ai-cost-calculator/)
- [OpenClaw Complete Setup Pack ($14.95)](https://cwyn.com/pages/pack-openclaw-complete-setup-pack.html)
