Connect OpenClaw to LM Studio & Qwen3.6:27b
This guide covers how to transition your OpenClaw environment to LM Studio to take advantage of advanced GPU routing, specific cache quantizations, and larger model parameters.
Step 1: Disable Previous Providers (Optional)
Section titled “Step 1: Disable Previous Providers (Optional)”If you previously set up Ollama and want to strictly route traffic to LM Studio, you should disable Ollama in the configuration file to prevent OpenClaw from falling back to it.
-
Open your Ubuntu terminal and launch the configuration file:
bash xdg-open ~/.openclaw/openclaw.json -
Locate the ollama block under the providers section.
-
Change “enabled”: true to “enabled”: false. (Note: You can use this exact method in the future to toggle any provider ON or OFF based on your preference).
-
Save the file (Ctrl + S) and close the editor.
Step 2: Install & Start LM Studio
Section titled “Step 2: Install & Start LM Studio”Next, we must set up the new LLM engine on your Windows host.
-
Download the installer from the official website: https://lmstudio.ai/download
-
Run the setup file and launch LM Studio.
-
Click the Local Server icon (the double arrows) on the left sidebar and click Start Server to allow external connections. (Note: The default port is 1234).
Step 3: Dual GPU Configuration
Section titled “Step 3: Dual GPU Configuration”If your host machine has two graphics cards, we need to dedicate the second GPU entirely to the LLM to prevent Windows desktop stuttering.
-
In LM Studio, press Ctrl + Shift + H to open the advanced GPU control panel.
-
Set the priority to your second graphics card (GPU 1).
-
Confirm the first graphics card (GPU 0) is left primarily for OS tasks.
Step 4: Download & Configure Qwen3.6:27b
Section titled “Step 4: Download & Configure Qwen3.6:27b”We will now pull the 27B model and configure it with specific memory and caching rules for optimal OpenClaw performance.
-
In LM Studio, use the top search bar to find and download Qwen3.6:27b.
-
Click the folder icon (My Models) on the left panel.
-
Under the LLMs section, select Qwen3.6:27b and click Load on the right panel.
Apply these exact settings in the right panel:
Context Length: 131,072 (Max)
GPU Offload: Set to MAX (ensure your GPU has enough VRAM)
Keep model in memory: Toggle OFF
Try mmap: Toggle OFF
K Cache Quantization: Toggle ON and select Q4_0
V Cache Quantization: Toggle ON and select Q4_0
Step 5: Open Windows Firewall
Section titled “Step 5: Open Windows Firewall”Just like Ollama, we must allow the Ubuntu VM to talk to LM Studio through the Windows host network.
Open PowerShell as Administrator on your Windows host and run:
New-NetFirewallRule -DisplayName "LM Studio API" -Direction Inbound -LocalPort 1234 -Protocol TCP -Action AllowStep 6: Reconfigure OpenClaw
Section titled “Step 6: Reconfigure OpenClaw”Now that the Windows side is ready, return to your Ubuntu VM terminal to update OpenClaw’s routing.
- Run the configuration wizard:
openclaw configure-
Follow the simplified prompts.
-
When asked to choose a model provider, select LM Studio.
-
When asked for the host IP, enter your Windows Real IP followed by the port (e.g., http://192.168.X.X:1234).
-
Finish the setup wizard.
Step 7: Restart & Test
Section titled “Step 7: Restart & Test”To apply the deep network and provider changes cleanly, reboot your Ubuntu VM.
sudo rebootOnce logged back in, open your terminal and launch the OpenClaw visual dashboard:
openclaw dashboardClick the generated localhost link to open the web interface. You can now test your prompts and watch the 27B model process them via LM Studio!