TA
Local models field guide
Hands-on guide · VS Code · Ollama + LM Studio

How to use VS Code with Local Models

Run an LLM on your own machine and wire it into VS Code — private, offline, and free. Two backends, one bridge, about ten minutes.

Goal: local AI in your editor Model: qwen3:4b Copy-ready commands
Option A

Ollama

CLI-first and the fastest way to start. One command pulls a model; it serves on a local port.

Option B

LM Studio

A point-and-click app. Browse and download models in a GUI, then flip on a local server.

SETUP Before you start

What you need

The number that matters most is RAM. qwen3:4b at Q4 needs only about 2.5 GB for the weights, so it fits comfortably on modest machines:

TierRAMWhat it runs
Minimum8 GBqwen3:4b on CPU, thinking mode off
Recommended16 GBqwen3:4b with room for longer context
Optional GPU4 GB+ VRAMNoticeably faster — not required
i

Long context and reasoning mode are what push a 4B model toward needing 16 GB+. For quick tasks, 8 GB is enough.


HOW IT WORKS The one bridge

The Continue bridge

VS Code only talks to GitHub Copilot out of the box. To reach a local model server, you need a connector — Continue, a free extension that plugs any local backend into the editor. Install it once; both options below use it.

vs code·Extensions panel
# search "Continue" in Extensions, or run:
code --install-extension Continue.continue
i

Heads-up: Continue is now maintained under Cursor and the open-source repo is frozen at its final release — but it still installs and the local-model path works fully. Cline is the active alternative if you prefer.


OPTION A CLI-first

Run it with Ollama

1Install Ollama
terminal·install
# macOS / Linux
curl -fsSL https://ollama.com/install.sh | sh
# Windows: download the installer from ollama.com
2Pull the model
terminal·pull
ollama pull qwen3:4b
3Test it
terminal·run
ollama run qwen3:4b          # chat here, /bye to exit

Ollama now serves on http://localhost:11434 — that's what Continue connects to.

4Add it to Continue

Open ~/.continue/config.yaml (%USERPROFILE%\.continue\config.yaml on Windows) and add:

yaml·config.yaml
models:
  - name: Qwen3 4B (Ollama)
    provider: ollama
    model: qwen3:4b
    apiBase: http://localhost:11434
    roles: [chat, edit]

OPTION B GUI

Run it with LM Studio

1Install & download the model
2Start the local server
3Point Continue at it
yaml·config.yaml
models:
  - name: Qwen3 4B (LM Studio)
    provider: lmstudio
    model: qwen3-4b            # match the ID in LM Studio
    apiBase: http://localhost:1234/v1
    roles: [chat, edit]
!

Keep LM Studio's server toggled on while you work — if the server stops, Continue can't reach the model.


DAILY USE In the editor

Use it in VS Code

That's the whole loop. A private Copilot running on your own hardware — your code never leaves the machine, and there's no API bill.


IF IT BREAKS Quick fixes

If it breaks