LM Studio
LM Studio is a friendly yet powerful app for running open-weight models on your own hardware. It lets you run llama.cpp (GGUF) or MLX models (Apple Silicon). Comes in a GUI package or headless daemon (llmster). For product and setup docs, see lmstudio.ai.
Quick start
- Install LM Studio (desktop) or
llmster(headless), then start the local server:
- Start the server
- OpenClaw requires an LM Studio token value. Set
LM_API_TOKEN:
- Run onboarding and choose
LM Studio:
- In onboarding, use the
Default modelprompt to pick your LM Studio model.
author/model-name format (e.g. qwen/qwen3.5-9b). OpenClaw
model refs prepend the provider name: lmstudio/qwen/qwen3.5-9b. You can find the exact key for
a model by running curl http://localhost:1234/api/v1/models and looking at the key field.
Non-interactive onboarding
Use non-interactive onboarding when you want to script setup (CI, provisioning, remote bootstrap):--custom-model-id takes the model key as returned by LM Studio (e.g. qwen/qwen3.5-9b), without
the lmstudio/ provider prefix.
Non-interactive onboarding requires --lmstudio-api-key (or LM_API_TOKEN in env).
For unauthenticated LM Studio servers, any non-empty token value works.
--custom-api-key remains supported for compatibility, but --lmstudio-api-key is preferred for LM Studio.
This writes models.providers.lmstudio, sets the default model to
lmstudio/<custom-model-id>, and writes the lmstudio:default auth profile.
Interactive setup can prompt for an optional preferred load context length and applies it across the discovered LM Studio models it saves into config.
Configuration
Explicit configuration
Troubleshooting
LM Studio not detected
Make sure LM Studio is running and that you setLM_API_TOKEN (for unauthenticated servers, any non-empty token value works):
Authentication errors (HTTP 401)
If setup reports HTTP 401, verify your API key:- Check that
LM_API_TOKENmatches the key configured in LM Studio. - For LM Studio auth setup details, see LM Studio Authentication.
- If your server does not require authentication, use any non-empty token value for
LM_API_TOKEN.