Continue + Ollama: Local AI Coding Assistant Guide

Why run your coding assistant locally?

Cloud coding assistants are convenient, but they come with a monthly bill, usage limits, and one condition many developers dislike: your code leaves your machine. A local setup flips that trade. Running an open model locally with Ollama costs nothing after the hardware you already own, works offline, and keeps proprietary or client code entirely on your own disk. The catch used to be the setup. That is no longer true: Ollama serves the model, and Continue, an open-source VS Code extension, turns it into chat, inline edits, and tab autocomplete inside your editor.




Source: DEV — VS Code connected to a local Ollama model.
This guide wires those two pieces together in about 30 minutes. You will end up with a private Copilot-style workflow: a chat panel that answers questions about your code, an edit mode that rewrites selected code, and ghost-text completions as you type.

Prerequisites

You need VS Code, a machine with at least 8 GB of RAM, and ideally a GPU with 8 GB or more of VRAM. A smaller model will still run on CPU or a modest GPU, just more slowly. If you are unsure what your hardware can handle, read our guide on how much VRAM you need to run an LLM locally before picking a model. The two-model pattern below is the key to a good experience: a small, fast model for autocomplete, and a larger, smarter model for chat and edits.

Step 1: Install Ollama and pull two coding models

Install Ollama from ollama.com, then pull one chat model and one autocomplete model. Qwen2.5-Coder is a solid, well-tested choice for both roles, and its tags must match exactly what you later put in the Continue config:

ollama pull qwen2.5-coder:7b     # chat and edits (about 4.7 GB download)
ollama pull qwen2.5-coder:1.5b  # fast tab autocomplete
ollama list                     # confirm both models are installed

On a machine with 24 GB of VRAM, swap the 7B chat model for qwen2.5-coder:32b. On a weaker machine, start with the 1.5B model for everything and upgrade only if completions feel fast enough. Verify Ollama is actually serving before touching the editor:

ollama run qwen2.5-coder:7b "Write a Python function that reverses a string"
curl http://localhost:11434

If the curl request returns a response, Ollama is listening on its default port. If it fails, Ollama is not running yet — start it and retry before moving on.

Step 2: Install the Continue extension

In VS Code, open the Extensions panel, search for "Continue", and install the extension published by Continue. From the command line, the same install is:

code --install-extension continue.continue

After installation, a Continue icon appears in the sidebar. Clicking it opens the chat panel. Do not sign in to any cloud provider: this setup points Continue at your local Ollama instance instead.

Step 3: Configure Continue

Open the command palette with Ctrl+Shift+P (Cmd+Shift+P on macOS) and run "Continue: Open Config". This opens ~/.continue/config.yaml. Replace its contents with a two-model local config:

Source: Local LLM Deployment Toolkit — Continue's chat, edit, and autocomplete panel in VS Code.

name: Local AI Coding Stack
version: 1.0.0
schema: v1
models:
  - name: Qwen2.5-Coder 7B (Chat)
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      contextLength: 8192
      temperature: 0.1
  - name: Qwen2.5-Coder 1.5B (Autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://localhost:11434
    roles:
      - autocomplete
    autocompleteOptions:
      debounceDelay: 250
      maxPromptTokens: 1024
      onlyMyCode: true

Save the file. Continue picks up config changes without restarting VS Code. If you prefer not to write YAML, Continue can also autodetect your installed Ollama models: set a model to model: AUTODETECT with provider: ollama, or choose Autodetect from the model selector dropdown, and Continue will scan what Ollama has available.

Step 4: Use chat, edits, and autocomplete

Three workflows cover most daily coding, and each uses a different model role:

  • Chat: Open the Continue panel with Ctrl+L (Cmd+L on macOS), select the 7B model, and ask about your code. Use @ to add context, such as @file or @codebase, so the model answers about your actual project rather than generic code.
  • Edit: Highlight code, press Ctrl+I (Cmd+I on macOS), and describe the change in plain language — "make this handle empty input" or "convert this loop to a list comprehension". Review the diff before accepting it.
  • Autocomplete: Just type. The 1.5B model offers ghost-text completions; press Tab to accept or keep typing to dismiss. If completions lag, that is a signal to use a smaller model or raise the debounce delay, not to abandon the setup.

Troubleshooting

  • "404 model not found": The model tag in config.yaml does not match an installed model. Run ollama list and copy the tag exactly, including the size suffix such as :7b.
  • Empty or hanging chat: Check that Ollama is running and reachable at http://localhost:11434, then reload the Continue config from the model dropdown.
  • Slow completions: Autocomplete is latency-sensitive. Drop to qwen2.5-coder:1.5b, raise debounceDelay, or reduce maxPromptTokens until suggestions feel instant.
  • Weak answers on hard tasks: That is the honest limit of a small local model. Use the local setup for routine code, refactoring, and explanations, and keep a frontier cloud model for genuinely hard architecture or debugging problems. Local does not have to mean local-only.

Going further

Once this works, the same Ollama server can power more of your workflow. If you are choosing between local front ends, our comparison of Ollama vs LM Studio vs GPT4All explains where each fits. You can also add a second chat model for reasoning-heavy questions or point a terminal coding tool at the same Ollama endpoint.

The real win is not saving a subscription fee, though that helps. It is control. You choose the model, you see the config, and you can swap either piece tomorrow without migrating an account. For everyday coding, that is already good enough — and it only gets better as open coding models improve.

Comments

Popular posts from this blog

Open-Source AI Weekly: Bonsai, GigaChat 4 Lead

Claude Claims Proof of Riemann Hypothesis After 167 Years

How to Build an AI Agent with LangGraph in 30 Minutes