#About using local LLM by LM Studio
1 messages Β· Page 1 of 1 (latest)
"models": {
"mode": "merge",
"providers": {
"lmstudio": {
"baseUrl": "http://127.0.0.1:1234/v1",
"apiKey": "lmstudio",
"api": "openai-responses",
"models": [
{
"id": "qwen/qwen3.5-27b",
"name": "qwen3.5 27B",
"reasoning": true,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 64000,
"maxTokens": 8196
}
]
},```
"agents": {
"defaults": {
"model": {
"primary": "qwen/qwen3.5-27b",
},
"models": {
"qwen/qwen3.5-27b": {
"alias": "qwen3.5"
}
change baseUrl port no. as per your lm studio.
Edit ~/.openclaw/openclaw.json (itβs JSON5, not strict JSON), and make sure the default model includes the lmstudio/ provider prefix.
This is the shape from the docs:
{
agents: {
defaults: {
model: { primary: "lmstudio/qwen/qwen3.5-27b" },
models: {
"lmstudio/qwen/qwen3.5-27b": { alias: "qwen3.5" },
},
},
},
models: {
mode: "merge",
providers: {
lmstudio: {
baseUrl: "http://127.0.0.1:1234/v1", // change port if needed
apiKey: "lmstudio", // any non-empty value if LM Studio auth is off
api: "openai-completions",
models: [
{
id: "qwen/qwen3.5-27b",
name: "qwen3.5 27B",
reasoning: false,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 128000,
maxTokens: 8192,
},
],
},
},
},
}
A couple of fixes vs your snippet:
primaryshould belmstudio/..., not justqwen/...idshould match the exact LM Studio model key, usually something likeqwen/qwen3.5-27b, not a display name with spaces
You can get the exact LM Studio model key with:
curl http://localhost:1234/api/v1/models
Then validate with:
openclaw config validate
openclaw models set lmstudio/qwen/qwen3.5-27b
openclaw status
Easiest path, honestly: just run openclaw onboard and choose LM Studio.
Docs: