AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Continue with Local Ollama Models in VS Code

Lara Jorge Ricart · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Cloud-based AI assistants like GitHub Copilot or Cursor are slick, but they demand complete surrender of your codebase to remote servers. For teams bound by strict NDAs, proprietary algorithms, or developers working in air-gapped environments, shipping proprietary IP over external APIs is a dealbreaker. Continue paired with Ollama is the most practical self-hosted alternative available today. It delivers inline autocompletion, context-aware chat, and inline diff edits entirely inside VS Code, running directly on your machine's GPU or Apple Silicon.

However, 365Finds has seen far too many developers botch this setup by treating local models like cloud APIs. If you attempt to run a single monolithic 14B model for both chat and tab autocomplete on consumer hardware, VS Code will freeze, your keystrokes will lag, and you will abandon the experiment within fifteen minutes. Getting a fluid, production-ready local AI environment requires two things: adopting Continue's modern config.yaml schema and strictly separating your autocomplete model from your chat model.

The Architectural Rule: Split Your Models

Tab autocompletion and interactive chat require fundamentally different trade-offs:

Step 1: Prepare Ollama and Pull the Weights

Ensure Ollama is installed and active on your system. Before opening VS Code settings, download the models through your terminal:

ollama pull qwen2.5-coder:7b
ollama pull qwen2.5-coder:1.5b
ollama pull nomic-embed-text

Verify that the models exist and check the daemon:

ollama list
curl http://localhost:11434

If the terminal responds with Ollama is running, your local inference backend is active.

Step 2: Install Continue and Locate config.yaml

In VS Code, open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X), search for Continue, and install the official extension (Continue.continue).

A critical trap to avoid: early versions of Continue used config.json. That format is now officially deprecated. Continue has standardized on config.yaml. If you have a legacy config.json lingering in your configuration directory, delete or rename it so Continue does not load stale definitions.

The configuration file is located at:

You can also open it directly inside VS Code by clicking the gear icon at the bottom of the Continue side panel and selecting Open config.yaml.

Step 3: Write the Production Configuration

Replace the contents of config.yaml with the following configuration:

name: Local Ollama Environment
version: 0.0.1
schema: v1

models:
  # Primary chat, inline edit, and code generation model
  - name: Qwen2.5-Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      contextLength: 4096

  # Lightweight Fill-in-the-Middle (FIM) model for inline Tab autocomplete
  - name: Qwen2.5-Coder 1.5B Autocomplete
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://localhost:11434
    roles:
      - autocomplete

  # Semantic codebase embeddings provider
  - name: Nomic Embed
    provider: ollama
    model: nomic-embed-text
    apiBase: http://localhost:11434
    roles:
      - embed

Save the file. Continue watches config.yaml and reloads changes automatically without requiring a full IDE restart.

Step 4: Verification and Workflow in VS Code

Once saved, open the Continue panel in the VS Code sidebar:

  1. Interactive Chat & Edit: In the model selector dropdown at the bottom of the Continue chat window, verify that Qwen2.5-Coder 7B is selected. Highlight any block of code and press Ctrl+I (or Cmd+I) to open inline editing. Type a prompt like refactor this loop into a list comprehension and inspect the diff.
  2. Tab Autocomplete: Open any code file and start typing a function signature. Within moments, gray ghost text should appear ahead of your cursor. Press Tab to accept the suggestion.
  3. Status Bar Indicator: Check the VS Code status bar (bottom right). Ensure the Continue icon is enabled with a checkmark indicating tab autocomplete is active. Clicking the icon lets you toggle autocomplete on or off on the fly.

Troubleshooting: Four Gotchas That Trip Up Developers

Even with clean configurations, local inference introduces system-level friction. Here are the issues 365Finds encounters most often:

  1. "Model requires more system memory than available" Continue defaults to a generous context window, but running a 7B or 14B model with an 8K or 16K context window can cause Ollama to spill from VRAM into regular system RAM, slashing tokens per second from 40 down to 2. If you see memory warnings or sluggish responses, explicitly cap the context window using defaultCompletionOptions.contextLength: 2048 or 4096 inside your model block.

  2. Connecting from Remote Machines or WSL2 If VS Code runs on Windows while Ollama runs inside WSL2 or on a dedicated home lab server, http://localhost:11434 will fail or get refused. On the host running Ollama, set environment variables before launching Ollama:

export OLLAMA_HOST="0.0.0.0:11434"
export OLLAMA_ORIGINS="*"

Then update your apiBase in config.yaml to point to the host machine's LAN or WSL virtual IP (for example, http://192.168.1.120:11434).

  1. Autocomplete Latency Stutter If typing feels jittery, you are likely either running an autocomplete model that is too large (like a 7B model on a mid-tier GPU) or sharing the GPU while another background job runs. Drop the autocomplete model to qwen2.5-coder:1.5b. If you still experience issues, check whether another extension (such as GitHub Copilot or built-in TypeScript IntelliSense) is fighting for tab completion focus.

  2. 404 Model Not Found Errors Continue is literal about model tags. If your config specifies model: qwen2.5-coder:7b but you pulled qwen2.5-coder:latest, Ollama will return a 404. Match the string in config.yaml exactly to the output of ollama list.

365Finds Take

Running Continue with Ollama is not a turn-key consumer product; it is developer infrastructure. If you want magic that requires zero hardware awareness, stick with hosted cloud subscriptions. But if your priority is absolute code sovereignty, zero monthly seat licensing, and a development environment that continues working when Wi-Fi cuts out at 35,000 feet, this stack is remarkably capable. Keep your autocomplete model small, keep your chat model sensible, and let Continue handle the glue.

References