Running local large language models inside your IDE offers total code privacy, offline autonomy, and complete control over quantization tradeoffs. For developers seeking this balance without maintaining headless terminal daemons or brittle Docker containers, pairing the Continue extension in Visual Studio Code with LM Studio represents one of the most accessible local AI development workflows available today.
At 365Finds, we favor this specific combination because LM Studio handles model downloads, hardware acceleration, and quantization presets behind a polished graphical interface, while Continue provides a first-class editor integration for chat, inline refactoring, and code completion. However, getting smooth streaming responses and reliable code generation requires understanding how Continue coordinates with LM Studio's OpenAI-compatible HTTP server, how model identifiers align, and how hardware latency dictates the boundary between interactive chat and tab autocomplete.
Architectural Overview
Continue acts as the client inside VS Code. LM Studio acts as the local inference backend.
+-------------------------------------------------------+
| VS Code |
| +--------------------------------------------------+ |
| | Continue Extension | |
| | - Chat Interface (Cmd/Ctrl + L) | |
| | - Inline Edit (Cmd/Ctrl + I) | |
| | - Tab Autocomplete (Inline suggestions) | |
| +-------------------------+------------------------+ |
+----------------------------|--------------------------+
| OpenAI-Compatible API
| HTTP / SSE Streaming
| http://localhost:1234/v1
+----------------------------v--------------------------+
| LM Studio Local Server (Port 1234) |
| - GGUF Model Runtime (llama.cpp engine) |
| - GPU Layer Offloading (Metal / CUDA / ROCm) |
| - Context Window Allocation |
+-------------------------------------------------------+
LM Studio exposes a local web server mimicking OpenAI's /v1/chat/completions and /v1/models endpoints, typically bound to http://localhost:1234/v1. Continue dispatches requests to this endpoint using Server-Sent Events (SSE) to stream generated tokens directly into the editor.
Step 1: Configure LM Studio's Local Server
Before touching VS Code, you must prepare the model and inference server inside LM Studio.
1. Download an Appropriate Coding Model
For local code generation, general instruct models often lag behind coding-specialized architectures. 365Finds strongly recommends quantizations of:
- Qwen2.5-Coder-7B-Instruct or 14B-Instruct (Q4_K_M or Q5_K_M) for an ideal balance of reasoning depth and token throughput.
- DeepSeek-Coder-V2-Lite-Instruct for expansive multilingual coding capabilities.
- Qwen2.5-Coder-1.5B if you intend to experiment with low-latency inline autocomplete.
2. Configure Server and Hardware Parameters
- Open LM Studio and navigate to the Developer / Local Server tab (the
</>icon on the left navigation bar). - Select your downloaded model from the top dropdown menu to load it into memory.
- In the right-hand server settings panel, configure the following critical parameters:
- Context Length: Increase this from the default 2048/4096 to at least 8192 or 16384 tokens, provided your system has sufficient VRAM. Coding workflows inject substantial context from open files and system prompts; a cramped context window causes truncated code blocks or silent context dropping.
- GPU Offload: Set this to Max or calculate the maximum layers your GPU VRAM can fit without swapping into system RAM.
- Cross-Origin Resource Sharing (CORS): Toggle Enable CORS to
ON. While Continue's extension host communicates via Node.js, enabling CORS avoids webview handshake failures. - Port: Ensure the listening port is set to
1234(the default).
- Click Start Server. Confirm that the status indicator turns green and displays
Running on http://localhost:1234. - Note the Model Identifier displayed under the loaded model (e.g.,
qwen2.5-coder-7b-instructor the model path). You can customize this alias in LM Studio's settings to match what you write in your configuration.
Step 2: Configure Continue in VS Code
Continue has transitioned from its legacy config.json schema to a modern YAML-based specification (config.yaml). Both structures work, but 365Finds recommends using the YAML configuration for current releases.
Opening the Configuration File
- Install the Continue extension from the VS Code Marketplace if you have not already done so.
- Open the Continue sidebar using the shortcut
Ctrl+L(Windows/Linux) orCmd+L(macOS). - Click the gear icon at the bottom-right or top-right of the Continue panel. This opens your active configuration file (located at
~/.continue/config.yamlor%USERPROFILE%\.continue\config.yaml).
Modern YAML Configuration (config.yaml)
Add LM Studio under the models list. You can assign explicit roles such as chat and edit:
name: LM Studio Local Setup
version: 0.0.1
schema: v1
models:
- name: LM Studio - Qwen 2.5 Coder
provider: lmstudio
model: qwen2.5-coder-7b-instruct
apiBase: http://localhost:1234/v1
roles:
- chat
- edit
requestOptions:
timeout: 120
If you prefer using the generic OpenAI provider wrapper, Continue supports identical behavior with provider: openai:
models:
- name: LM Studio Local (OpenAI Compatible)
provider: openai
model: qwen2.5-coder-7b-instruct
apiBase: http://localhost:1234/v1
apiKey: "lm-studio"
roles:
- chat
- edit
Legacy JSON Configuration (config.json)
If you are running an older release of Continue that still requires config.json, configure the model array as follows:
{
"models": [
{
"title": "LM Studio - Qwen 2.5 Coder",
"provider": "lmstudio",
"model": "qwen2.5-coder-7b-instruct",
"apiBase": "http://localhost:1234/v1"
}
]
}
The Autocomplete Dilemma: Reality and Recommendation
One of Continue's most compelling features is tab-triggered inline autocomplete. However, running autocomplete against a local model hosted in LM Studio requires strict technical pragmatism.
Inline code completion demands sub-300 millisecond time-to-first-token (TTFT) latency to feel responsive. If you attempt to point tabAutocompleteModel to a 7B or 14B parameter model running on consumer hardware:
- Every keystroke generates inference queries that choke your local GPU.
- The server queues requests sequentially, causing active chat queries in Continue to freeze while intermediate typing suggestions complete.
- Suggestion popups feel sluggish, trailing several seconds behind your actual cursor.
# Optional: Configure a dedicated lightweight model for autocomplete
models:
- name: Fast Autocomplete
provider: lmstudio
model: qwen2.5-coder-1.5b-base
apiBase: http://localhost:1234/v1
roles:
- autocomplete
365Finds recommends a deliberate separation: use LM Studio to host a capable 7B or 14B model strictly for interactive chat (Cmd/Ctrl + L) and targeted inline edits (Cmd/Ctrl + I). For tab autocomplete, either deploy a dedicated sub-2B parameter model (such as Qwen2.5-Coder-1.5B) or disable local tab autocomplete entirely until your machine possesses multi-GPU or dedicated NPU throughput.
Step 3: Verification and Streaming Response Debugging
Once configured, verify communication between the two systems and inspect the stream.
1. Test Interactive Chat
Open the Continue panel in VS Code (Cmd/Ctrl + L), ensure your LM Studio model is selected in the bottom model picker, and submit a brief prompt:
"Write a TypeScript function to debounce an event handler with cancel support."
Switch to your LM Studio window. You should immediately observe:
- A new
POST /v1/chat/completionslog entry. - Real-time generation statistics displaying Time-to-First-Token, tokens generated, and generation speed in tokens per second (tok/s).
- Words streaming into the VS Code chat interface without buffering delays.
2. Diagnosing Common Stream and Connection Failures
| Symptom | Root Cause | Resolution |
|---|---|---|
Connection Refused (ECONNREFUSED 1234) | LM Studio server is stopped or binding address is inaccessible | Verify the server is running in LM Studio. If running VS Code inside WSL2 while LM Studio runs on Windows host, replace localhost with your Windows host IP or host.docker.internal. |
| Model Not Found (404 Error) | model string in config.yaml does not match the loaded identifier | Check the active identifier in LM Studio's Local Server tab. Copy the exact model string into Continue's model: field. |
| Streaming Freezes Mid-Generation | Context length overflow or VRAM exhaustion | Increase context size in LM Studio settings, or lower quantization/offload layers if the GPU is spilling into system RAM swap. |
| Chat Dumps All Tokens at Once (No Streaming) | Proxy or intermediate buffer intercepting SSE chunks | Ensure direct HTTP connection without local corporate proxies intercepting localhost. Verify provider: lmstudio is used rather than custom unbuffered proxies. |
By maintaining realistic expectations regarding model sizes and aligning your context limits with local VRAM availability, the combination of Continue and LM Studio transforms VS Code into a secure, private, and capable coding environment.