# Local AI Code Completion in VS Code with Qwen2.5-Coder and Ollama

> Source: <https://sourcefeed.dev/a/local-ai-code-completion-in-vs-code-with-qwen25-coder-and-ollama>
> Published: 2026-08-05 17:40:00+00:00

# Local AI Code Completion in VS Code with Qwen2.5-Coder and Ollama

Wire Qwen2.5-Coder through Ollama and Continue for private, offline autocomplete and chat in VS Code.

[Rachel Goldstein](https://sourcefeed.dev/u/rachel_goldstein)

## What you'll build

A fully local AI coding setup in VS Code: [Qwen2.5-Coder](https://github.com/QwenLM/Qwen2.5-Coder) running under [Ollama](https://ollama.com), wired into the [Continue](https://continue.dev) extension for tab autocomplete and inline chat. Nothing leaves your machine — it works on a plane, and proprietary code never touches a third-party API.

## Prerequisites

- macOS, Linux, or Windows with at least 8 GB of RAM (16 GB is comfortable if you want the 7B chat model alongside your editor)
- About 6 GB of free disk for the two models
- A current
[VS Code](https://code.visualstudio.com)install with the`code`

CLI on your PATH - Verified against Ollama 0.32.5, Continue extension 2.1.0, and the
`qwen2.5-coder`

tags on the Ollama library, August 2026

## 1. Install Ollama

Ollama is the local model server everything else talks to. On macOS or Windows, download the installer from [ollama.com/download](https://ollama.com/download) and run it — the app starts a server on `localhost:11434`

and keeps it running in the background. On Linux:

```
curl -fsSL https://ollama.com/install.sh | sh
```

The script installs Ollama and registers a systemd service, so the server is already running. Confirm:

```
curl http://localhost:11434
```

You should get back `Ollama is running`

.

## 2. Pull the Qwen2.5-Coder models

You want two models for two jobs: a small one for autocomplete, where latency matters more than brains, and a bigger one for chat and edits.

```
ollama pull qwen2.5-coder:1.5b
ollama pull qwen2.5-coder:7b
```

The 1.5B is a 986 MB download; the 7B is 4.7 GB. Always pin the size tag — a bare `qwen2.5-coder`

resolves to `:latest`

, which is the 7B, and that's too slow for autocomplete on most laptops.

## 3. Install the Continue extension

Install Continue from the VS Code Marketplace (search "Continue", publisher *Continue*), or from the terminal:

```
code --install-extension Continue.continue
```

On first launch Continue creates its config file and adds a chat icon to the sidebar — you can skip any sign-in it offers, since local models need no account.

## 4. Point Continue at your local models

Continue reads `~/.continue/config.yaml`

(`%USERPROFILE%\.continue\config.yaml`

on Windows). Open it directly in your editor, or from Continue's chat sidebar (`Cmd/Ctrl+L`

): click the agent selector above the input and hit the gear icon next to your local config. Replace the `models`

section so the file looks like this:

```
name: Local Assistant
version: 1.0.0
schema: v1

models:
  - name: Qwen2.5-Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    roles:
      - chat
      - edit
      - apply
  - name: Qwen2.5-Coder 1.5B
    provider: ollama
    model: qwen2.5-coder:1.5b
    roles:
      - autocomplete
```

Save the file — Continue reloads automatically, no restart needed. It assumes Ollama's default address; you'd only add an `apiBase`

if Ollama runs on another machine or port. Finally, make sure VS Code's `editor.inlineSuggest.enabled`

setting is on (it is by default), and disable GitHub Copilot if you have it installed, so two extensions aren't fighting over the same ghost text.

## Verify it works

First check both models are in place:

```
ollama list
NAME                  ID              SIZE      MODIFIED
qwen2.5-coder:7b      2b0496514337    4.7 GB    2 minutes ago
qwen2.5-coder:1.5b    d7372fb82b10    986 MB    4 minutes ago
```

(Your `ID`

values will differ.) Then in VS Code, create `test.py`

and type `def fibonacci(`

— pause, and gray ghost text should appear with a suggested completion. Press `Tab`

to accept it. The very first completion takes a few seconds while Ollama loads the model into memory; after that it's near-instant. Running `ollama ps`

in a terminal should now show `qwen2.5-coder:1.5b`

loaded.

For chat, press `Cmd/Ctrl+L`

, pick *Qwen2.5-Coder 7B* in the model dropdown, and ask it to explain the file. Final proof: turn off Wi-Fi and do it all again — everything still works.

## Troubleshooting

** Error: listen tcp 127.0.0.1:11434: bind: address already in use** — you ran

`ollama serve`

while the server was already running (the desktop app and the Linux systemd service start it for you). Don't run `serve`

manually; just use `ollama pull`

and friends.**A Continue error ending in not found, try pulling it first** — your config names a tag that isn't downloaded. Continue never pulls models itself. Run

`ollama list`

and make the `model:`

values match the listed tags exactly, size suffix included.**Ghost text never appears** — autocomplete may be paused: click the *Continue* item in VS Code's status bar and re-enable it. Then confirm `editor.inlineSuggest.enabled`

is `true`

and that Copilot's inline suggestions are off.

**Completions show up but take seconds** — the autocomplete role is on a model that's too big, or you're low on RAM. Keep autocomplete on the 1.5B; on older hardware drop to `qwen2.5-coder:0.5b`

, and use `ollama ps`

to see what's actually loaded.

## Next steps

If you've got the hardware (24 GB+ RAM or a decent GPU), swap the chat role to `qwen2.5-coder:14b`

or `:32b`

— same config shape, better answers. Add codebase-aware chat by pulling `nomic-embed-text`

and giving it the `embed`

role, which powers Continue's `@Codebase`

context. And when completions feel too eager or too sluggish, tune `debounceDelay`

and `maxPromptTokens`

— the [autocomplete deep dive](https://docs.continue.dev/customize/deep-dives/autocomplete) covers both.

## Sources & further reading

-
[Continue Autocomplete Setup and Configuration Guide](https://docs.continue.dev/customize/deep-dives/autocomplete)— docs.continue.dev -
[How to Configure Continue](https://docs.continue.dev/customize/deep-dives/configuration)— docs.continue.dev -
[config.yaml Reference](https://docs.continue.dev/reference)— docs.continue.dev -
[qwen2.5-coder model library page](https://ollama.com/library/qwen2.5-coder)— ollama.com -
[Download Ollama](https://ollama.com/download)— ollama.com -
[Ollama Releases](https://github.com/ollama/ollama/releases)— github.com

[Rachel Goldstein](https://sourcefeed.dev/u/rachel_goldstein)· Dev Tools Editor

Rachel has been embedded in the developer tooling ecosystem for nearly eight years, covering everything from IDE wars and package-manager drama to the quiet rise of AI-assisted coding. She has a soft spot for open-source maintainers and an unhealthy number of terminal emulators installed on a single laptop.

## Discussion 0

No comments yet

Be the first to weigh in.
