Skip to main content

News

  • 2026/05/21: We now recommend Qwen3.6-35B-A3B as the first local model to try with OpenHands. It is an open-weight MoE model built for agentic coding, supports a large context window, and is available through LM Studio, Ollama, vLLM, and SGLang.

Quickstart: Running OpenHands with a Local LLM using LM Studio

This guide explains how to serve a local LLM using LM Studio and have OpenHands connect to it. We recommend:
  • LM Studio as the local model server, which handles metadata downloads automatically and offers a simple, user-friendly interface for configuration.
  • Qwen3.6-35B-A3B as the LLM for software development. This model is optimized for agentic coding and works well with tool-heavy workflows like OpenHands.

Hardware Requirements

Running Qwen3.6-35B-A3B requires:
  • A recent GPU with at least 24GB of VRAM for quantized variants, or multiple GPUs for full precision and larger context windows, or
  • A Mac with Apple Silicon with at least 64GB of unified memory for quantized variants

1. Install LM Studio

Download and install the LM Studio desktop app from lmstudio.ai.

2. Download the Model

  1. Make sure to set the User Interface Complexity Level to “Power User”, by clicking on the appropriate label at the bottom of the window.
  2. Click the “Discover” button (Magnifying Glass icon) on the left navigation bar to open the Models download page.
image
  1. Search for “Qwen3.6-35B-A3B”, confirm you’re downloading from the official Qwen publisher, then proceed to download.
image
  1. Wait for the download to finish.

3. Load the Model

  1. Click the “Developer” button (Console icon) on the left navigation bar to open the Developer Console.
  2. Click the “Select a model to load” dropdown at the top of the application window.
image
  1. Enable the “Manually choose model load parameters” switch.
  2. Select Qwen3.6-35B-A3B from the model list.
image
  1. Enable the “Show advanced settings” switch at the bottom of the Model settings flyout to show all the available settings.
  2. Set “Context Length” to at least 22000 (for lower VRAM systems) or 32768 (recommended for better performance) and enable Flash Attention.
  3. Click “Load Model” to start loading the model.
image

4. Start the LLM server

  1. Enable the switch next to “Status” at the top-left of the Window.
  2. Take note of the Model API Identifier shown on the sidebar on the right.
image
Linux users: By default, LM Studio only listens on 127.0.0.1 (localhost). If OpenHands runs inside a Docker container, it cannot reach 127.0.0.1 on the host — even with --add-host host.docker.internal:host-gateway.To fix this, enable “Serve on Local Network” in LM Studio’s server settings. This switches the bind address to 0.0.0.0, making the server reachable from Docker.You can verify connectivity from inside the container:
If this returns the model list, the connection is working. If it hangs or errors, LM Studio is still bound to localhost only.

5. Start OpenHands

  1. Check the installation guide and ensure all prerequisites are met before running OpenHands, then run:
  1. Wait until the server is running (see log below):
  1. Visit http://localhost:3000 in your browser.

6. Configure OpenHands to use the LLM server

Once you open OpenHands in your browser, you’ll need to configure it to use the local LLM server you just started. When started for the first time, OpenHands will prompt you to set up the LLM provider.
  1. Click “see advanced settings” to open the LLM Settings page.
image
  1. Enable the “Advanced” switch at the top of the page to show all the available settings.
  2. Set the following values:
    • Custom Model: openai/qwen/qwen3.6-35b-a3b (the Model API identifier from LM Studio, prefixed with “openai/”)
    • Base URL: http://host.docker.internal:1234/v1
    • API Key: local-llm
  3. Click “Save Settings” to save the configuration.
image That’s it! You can now start using OpenHands with the local LLM server. If you encounter any issues, let us know on Slack.

Community-Reported Notes and Troubleshooting

If OpenHands behaves like a plain chatbot, refuses to use tools or files, or has constant failed tool calls with a local model, the issue may be with the model itself rather than your setup. Even with a large context window, some local models may struggle with reliable tool use. Community-reported working models:
  • qwen2.5-coder-14b-instruct — reported to resolve chatbot-like behavior
  • qwopus3.5-27b-v3 Q8_0 (and similar retrained qwopus variants) — reported to work well with tool calls
If you’re experiencing issues, try switching to one of these models before assuming the setup is broken.

Advanced: Alternative LLM Backends

This section describes how to run local LLMs with OpenHands using alternative backends like Ollama, SGLang, or vLLM — without relying on LM Studio.

Create an OpenAI-Compatible Endpoint with Ollama

Create an OpenAI-Compatible Endpoint with vLLM or SGLang

First, download the model checkpoint:

Serving the model using SGLang

Serving the model using vLLM

If you are interested in further improved inference speed, you can also try Snowflake’s version of vLLM, ArcticInference, which can achieve up to 2x speedup in some cases.
  1. Install the Arctic Inference library that automatically patches vLLM:
  1. Run the launch command with speculative decoding enabled:

Run OpenHands (Alternative Backends)

Using Docker

Run OpenHands using the official docker run command.

Using Development Mode

Use the instructions in Development.md to build OpenHands. Start OpenHands using make run.

Configure OpenHands (Alternative Backends)

Once OpenHands is running, open the Settings page in the UI and go to the LLM tab.
  1. Click “see advanced settings” to access the full configuration panel.
  2. Enable the Advanced toggle at the top of the page.
  3. Set the following parameters, if you followed the examples above:
    • Custom Model: openai/<served-model-name>
      • For Ollama: openai/qwen3.6:35b-a3b
      • For SGLang/vLLM: openai/Qwen3.6-35B-A3B
    • Base URL: http://host.docker.internal:<port>/v1 Use port 11434 for Ollama, or 8000 for SGLang and vLLM.
    • API Key:
      • For Ollama: any placeholder value (e.g. dummy, local-llm)
      • For SGLang or vLLM: use the same key provided when starting the server (e.g. mykey)