HOW-TO · SET

How to connect to LM Studio from Continue.dev

intermediate10 minBy Eruo Fredoline
Target environment
Ubuntu 24.04 · Ollama 0.4.xWindows 11 · Ollama 0.4.xmacOS 15 · Ollama 0.4.x
PREREQUISITES

Continue.dev installed, LM Studio running with API server

What this does

Configures the Continue.dev AI coding assistant to route chat completions and code suggestions through the local LM Studio REST API. After completion, all inference runs on-premises with no cloud dependency.

Steps

  1. Start the LM Studio API server. Open LM Studio, navigate to the Server tab, select a downloaded model, and click Start Server. Confirm the green status indicator is active.

  2. Open the Continue.dev configuration file. In VS Code, click the Continue.dev sidebar icon to reveal the config panel. Locate the config.json link.

  3. Add an LM Studio provider block to the config. Insert a new entry in the models list specifying the local server as the base URL.

    {
        "title": "Local LM Studio",
        "provider": "openai",
        "model": "lmstudio-community/Mistral-7B-Instruct-v0.3",
        "api_base": "http://localhost:1234/v1"
    }
    

    Save the file. Continue.dev reloads the configuration automatically.

  4. Select the local model in the Continue.dev chat panel. Activate the Continue.dev sidebar and use the model selector dropdown to choose Local LM Studio. Type a test prompt. The response is generated by the model running in LM Studio.

Verification

curl -X POST http://localhost:1234/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model": "lmstudio-community/Mistral-7B-Instruct-v0.3", "messages": [{"role": "user", "content": "Ping"}], "max_tokens": 5}'
# Expected: JSON response with a choices array containing model-generated text

Common failures

  • Continue.dev shows "Could not connect" — The LM Studio server is not running. Confirm the green status indicator in the Server tab.
  • Wrong model identifier — The model name in the config must exactly match the identifier in the LM Studio server dropdown.
  • API base URL misconfigured — The base URL must include the /v1 suffix, for example http://localhost:1234/v1 with no trailing slash.
  • Firewall blocks localhost connections — Verify with a direct curl test from a terminal first.

Related guides

RELATED GUIDES