In this categoryLocal AI · 24
Local AIIntermediate

Replace GitHub Copilot With a Local Coding Model (Qwen2.5-Coder + Continue.dev)

Drop the $10–19/month subscription and run your own coding assistant inside VS Code. This is the exact setup: Ollama plus Qwen2.5-Coder for chat and tab-autocomplete through the free Continue.dev extension, with honest notes on what you give up.

12 minIntermediate

GitHub Copilot and Cursor are excellent, and they also cost $10–19 a month, send your code to a server, and stop working on a plane. If any of those bother you, you can build a close replacement that runs entirely on your own machine for $0: Ollama serving a Qwen2.5-Coder model, wired into VS Code through the free, open-source Continue.dev extension. You get inline chat and tab-autocomplete that look and feel like Copilot, with your code never leaving the laptop. This guide is the full setup, plus an honest section on where local still loses.

Why go local

  • Cost: $0 forever instead of $10/month (Copilot) or $20/month (Cursor Pro). The model and the extension are both free and open source.
  • Privacy: your code, prompts, and completions stay on your machine. Nothing is sent to a vendor, which matters for proprietary or client work under NDA.
  • Offline: it keeps working on a plane, in a tunnel, or behind a locked-down corporate network with no outbound access.
  • Control: you choose the model, the context size, and how warm it stays. No silent model swaps or rate limits.
What you give up — honestly
A local 7B–32B coder is not a frontier model. Expect weaker multi-file reasoning, less reliable agentic editing across a whole repo, and no GPT-5-class brain for gnarly architecture questions. You also own the setup: model updates, VRAM management, and the occasional slow first token are now your job. For everyday autocomplete and single-file help it is genuinely close to Copilot; for sweeping cross-codebase refactors, the paid tools still win.

Step 1 — Hardware check

Pick the model size your memory can hold. The model has to fit in VRAM (discrete GPU) or unified memory (Apple Silicon) to run fast; otherwise it spills to CPU and autocomplete gets sluggish.

Model sizeMemory it wantsRealistic hardware
Qwen2.5-Coder 7B~8 GBRTX 4060 Ti / RTX 5070, or a 16 GB Apple Silicon Mac
Qwen2.5-Coder 14B~12–16 GBRTX 4060 Ti 16 GB, RTX 5070 Ti, or a 24 GB+ unified-memory Mac
Qwen2.5-Coder 32B24 GB+RTX 5090 (32 GB), or a 32 GB+ unified-memory Mac
Start one size below your ceiling
For autocomplete you want speed more than raw intelligence, because completions fire on every pause. The 7B is fast enough to feel like Copilot on an 8 GB card. Use a bigger model for the chat side, where you can wait a second or two, and a smaller one for tab-autocomplete.

Step 2 — Pick your model

Qwen2.5-Coder is the practical default. It is Apache 2.0 (so commercial use is fine), it was trained specifically for code, and it ships in 7B, 14B, and 32B sizes — plus it supports fill-in-the-middle (FIM), which is exactly what tab-autocomplete needs. If you would rather run a single generalist for both chat and code, Gemma 4 12B (Apache 2.0) is a solid fallback, though a dedicated coder model autocompletes better.

Step 3 — Install Ollama and pull the model

Ollama is the free runner that downloads and serves the model on a local OpenAI-compatible endpoint at localhost:11434. On macOS or Windows, grab the installer from ollama.com. On Linux, one command installs it. Then pull a coder model and verify it runs:

zsh — install Ollama and pull Qwen2.5-Coder
Linux install (macOS/Windows: use the ollama.com installer)
$curl -fsSL https://ollama.com/install.sh | sh
Pull the 7B coder (swap :7b for :14b or :32b for more power)
$ollama pull qwen2.5-coder:7b
pulling manifest
success
Smoke-test it
$ollama run qwen2.5-coder:7b
$>>> Write a Python function that checks if a string is a palindrome.
def is_palindrome(s): return s == s[::-1]
$
Pull a separate autocomplete model
Continue uses two models: one for chat and one for tab-autocomplete. The 1.5B coder is great for the fast autocomplete slot — run `ollama pull qwen2.5-coder:1.5b` for completions and keep the 7B/14B for chat. Smaller = lower latency on every keystroke.

Step 4 — Install the Continue.dev extension

Continue is the open-source VS Code extension that gives you the Copilot-style sidebar chat and inline autocomplete, but lets you point it at any backend — including your local Ollama. In VS Code, open the Extensions panel (Cmd/Ctrl+Shift+X), search for "Continue", and install the one published by Continue.dev. A new Continue icon appears in the left activity bar.

Step 5 — Point Continue at your local model

Continue is configured with a YAML file at ~/.continue/config.yaml (open it from the gear icon in the Continue sidebar). Define a chat model and a separate autocomplete model, both using the ollama provider so nothing leaves your machine:

~/.continue/config.yaml
name: Local assistant
version: 1.0.0
models:
  - name: Qwen2.5-Coder 7B (chat)
    provider: ollama
    model: qwen2.5-coder:7b
    roles:
      - chat
      - edit
      - apply
  - name: Qwen2.5-Coder 1.5B (autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b
    roles:
      - autocomplete

Save the file. The chat model now answers in the Continue sidebar, and the autocomplete model drives the gray inline suggestions. Because Qwen2.5-Coder supports fill-in-the-middle, Continue knows how to feed it the code before and after your cursor, which is what makes the completions land in the right place instead of dumping a whole function at the end of the line.

Make sure Ollama is running
Continue talks to Ollama at http://localhost:11434. If chat or autocomplete sits silent, confirm the server is up with `ollama list` in a terminal. On macOS/Windows the Ollama app must be open; on Linux it runs as a background service after install.

Step 6 — Use codebase context with @-mentions

Copilot Chat's edge is that it knows your repo. Continue does the same through @-mentions: type @file to pull a specific file into the prompt, @code to reference a symbol, or @codebase to let it search the whole project and answer with repo-aware context. Highlight a block, hit Cmd/Ctrl+L to send it to chat, and ask for a refactor — the model sees exactly the code you mean instead of guessing.

Step 7 — Tune for speed

  • Keep the model warm: set OLLAMA_KEEP_ALIVE so the model stays loaded in memory between requests instead of cold-starting on every completion. `export OLLAMA_KEEP_ALIVE=30m` before launching Ollama keeps it resident for half an hour.
  • Right-size the context window: a smaller context (for example 8K instead of 32K) means less to process per keystroke, so autocomplete fires faster. Bump it up only for chat, where you actually need the repo context.
  • Low temperature for code: keep the chat model deterministic (temperature around 0–0.2) so it stops inventing API calls that do not exist.
  • Smaller = snappier autocomplete: if completions lag, drop the autocomplete model to the 1.5B coder. The intelligence gap barely shows on single-line completions but the latency difference is obvious.

Reality check: when to size up

On a fast GPU, local autocomplete is comparable to Copilot's; on CPU or a starved card it lags noticeably, and that lag is the main thing that makes people quit. If the 7B feels dumb on harder chat questions — weak refactors, shaky reasoning across files — that is the signal to move up to Qwen2.5-Coder 14B (if you have ~12–16 GB) or 32B (24 GB+). The jump from 7B to 14B is the one most people feel. Beyond that you are mostly buying marginal quality at a real speed cost.

Other editors, same backend

The Ollama server is editor-agnostic, so the same local model powers other IDEs. Continue ships a JetBrains plugin (IntelliJ, PyCharm, WebStorm, GoLand) that uses the identical config.yaml. For Neovim, plugins like codecompanion.nvim or avante.nvim point at the same localhost:11434 endpoint. Set the model up once; reuse it everywhere.

The bottom line — and the one hardware upgrade that helps

For autocomplete and single-file chat, a local Qwen2.5-Coder through Continue is a real, free replacement for Copilot, with privacy and offline use thrown in. The single thing that most improves the experience is enough VRAM to run the 14B model comfortably while keeping it warm. If you are buying a GPU for this, a current-gen card with 16 GB or more (an RTX 5070 Ti, or an RTX 5090 with 32 GB if you want to reach the 32B coder) is the sweet spot that turns local coding from a tolerable experiment into something you actually leave on all day.

Local models run better with more VRAM. CompareRTX GPUs on Amazonbefore you upgrade.(affiliate link. We may earn a commission at no extra cost. Disclosure)

Related guides

Watch related tutorials

Free weekly email

Weekly local AI drops

New models, what runs on your hardware, and the guides to set them up. One email a week, unsubscribe any time.

Tags
#replace github copilot local#local copilot alternative#qwen2.5-coder copilot#continue.dev ollama setup#free local copilot vs code