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 (Documentation Index
Fetch the complete documentation index at: https://docs.openclaw.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
- If LM Studio authentication is enabled, 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.
For authenticated LM Studio servers, pass --lmstudio-api-key or set LM_API_TOKEN.
For unauthenticated LM Studio servers, omit the key; OpenClaw stores a local non-secret marker.
--custom-api-key remains supported for compatibility, but --lmstudio-api-key is preferred for LM Studio.
This writes models.providers.lmstudio and sets the default model to
lmstudio/<custom-model-id>. When you provide an API key, setup also 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.
LM Studio plugin config trusts the configured LM Studio endpoint for model requests, including loopback, LAN, and tailnet hosts. You can opt out by setting models.providers.lmstudio.request.allowPrivateNetwork: false.
Configuration
Streaming usage compatibility
LM Studio is streaming-usage compatible. When it does not emit an OpenAI-shapedusage object, OpenClaw recovers token counts from llama.cpp-style
timings.prompt_n / timings.predicted_n metadata instead.
Same streaming usage behavior applies to these OpenAI-compatible local backends:
- vLLM
- SGLang
- llama.cpp
- LocalAI
- Jan
- TabbyAPI
- text-generation-webui
Thinking compatibility
When LM Studio’s/api/v1/models discovery reports model-specific reasoning
options, OpenClaw exposes the matching OpenAI-compatible reasoning_effort
values in model compat metadata. Current LM Studio builds can advertise binary
UI options such as allowed_options: ["off", "on"] while rejecting those values
on /v1/chat/completions; OpenClaw normalizes that binary discovery shape to
none, minimal, low, medium, high, and xhigh before sending requests.
Older saved LM Studio config that contains off/on reasoning maps is
normalized the same way when the catalog is loaded.
Explicit configuration
Troubleshooting
LM Studio not detected
Make sure LM Studio is running. If authentication is enabled, also setLM_API_TOKEN:
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, leave the key blank during setup.
Just-in-time model loading
LM Studio supports just-in-time (JIT) model loading, where models are loaded on first request. OpenClaw preloads models through LM Studio’s native load endpoint by default, which helps when JIT is disabled. To let LM Studio’s JIT, idle TTL, and auto-evict behavior own model lifecycle, disable OpenClaw’s preload step:LAN or tailnet LM Studio host
Use the LM Studio host’s reachable address, keep/v1, and make sure LM Studio is bound beyond loopback on that machine:
lmstudio automatically trusts its configured local/private endpoint for guarded model requests. Custom loopback provider IDs such as localhost or 127.0.0.1 are also trusted automatically; for LAN, tailnet, or private DNS custom provider IDs, set models.providers.<id>.request.allowPrivateNetwork: true explicitly.