Skip to content

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.

  1. Open your Ubuntu terminal and launch the configuration file:

    bash
    xdg-open ~/.openclaw/openclaw.json
  2. Locate the ollama block under the providers section.

  3. 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).

  4. Save the file (Ctrl + S) and close the editor.

Next, we must set up the new LLM engine on your Windows host.

  1. Download the installer from the official website: https://lmstudio.ai/download

  2. Run the setup file and launch LM Studio.

  3. 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).

If your host machine has two graphics cards, we need to dedicate the second GPU entirely to the LLM to prevent Windows desktop stuttering.

  1. In LM Studio, press Ctrl + Shift + H to open the advanced GPU control panel.

  2. Set the priority to your second graphics card (GPU 1).

  3. Confirm the first graphics card (GPU 0) is left primarily for OS tasks.

We will now pull the 27B model and configure it with specific memory and caching rules for optimal OpenClaw performance.

  1. In LM Studio, use the top search bar to find and download Qwen3.6:27b.

  2. Click the folder icon (My Models) on the left panel.

  3. 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

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:

PowerShell
New-NetFirewallRule -DisplayName "LM Studio API" -Direction Inbound -LocalPort 1234 -Protocol TCP -Action Allow

Now that the Windows side is ready, return to your Ubuntu VM terminal to update OpenClaw’s routing.

  1. Run the configuration wizard:
bash
openclaw configure
  1. Follow the simplified prompts.

  2. When asked to choose a model provider, select LM Studio.

  3. When asked for the host IP, enter your Windows Real IP followed by the port (e.g., http://192.168.X.X:1234).

  4. Finish the setup wizard.

To apply the deep network and provider changes cleanly, reboot your Ubuntu VM.

bash
sudo reboot

Once logged back in, open your terminal and launch the OpenClaw visual dashboard:

bash
openclaw dashboard

Click 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!