AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Configuring Continue with Local Ollama in VS Code: The Complete Dual-Model Setup

Judith Campos · 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

Running an AI coding assistant completely offline inside VS Code is no longer a compromise—if you configure it correctly. For development teams bound by strict data governance policies, air-gapped infrastructure, or engineers who simply refuse to send their intellectual property across third-party cloud APIs, the pairing of the Continue extension with Ollama is our definitive recommendation at 365Finds.

Yet, most developer guides fail at the first hurdle. They tell you to download a single large model, drop it into Continue's settings, and call it a day. Do that, and your editor will lock up with multi-second latency spikes as Ollama repeatedly evicts and reloads models between inline code completions and conversational chats.

At 365Finds, we advocate for a strict dual-engine configuration: an agile, low-latency Fill-in-the-Middle (FIM) model dedicated to inline tab autocomplete, paired with a capable reasoning or coding model for architectural discussions and refactoring. Here is how to configure this production-ready local pipeline from scratch.


1. Preparing Ollama and Daemon Tuning

Continue relies on Ollama's local HTTP API server running on port 11434. By default, Ollama only loads one model at a time into GPU memory and unloads idle models after five minutes. To support simultaneous code completion and chat without crippling disk and VRAM thrashing, you must tune Ollama's daemon parameters before pulling models.

Step 1.1: Configure Environment Variables

Set the daemon to hold at least two models concurrently in memory and eliminate idle unloading timeouts:

Step 1.2: Pull Tested Local Models

Open a terminal and pull the models matching your hardware tier. 365Finds recommends the Qwen 2.5 Coder series for coding tasks:

# 1. Main Chat and Refactoring Model (Requires 6GB - 12GB VRAM)
ollama pull qwen2.5-coder:7b

# 2. Fast Inline Autocomplete Model (Fill-in-the-Middle, ~1.5GB VRAM)
ollama pull qwen2.5-coder:1.5b

# 3. Local Embeddings Model for Codebase Semantic Search
ollama pull nomic-embed-text

Do not pull reasoning-focused models like DeepSeek-R1 for tab autocomplete. Reasoning models output thinking tokens that introduce intolerable 2-to-5-second pauses while typing. Keep tab completion on dedicated 1.5B or 3B FIM models.


2. Installing Continue in VS Code

  1. Launch VS Code.
  2. Open the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  3. Search for Continue (published by Continue) and click Install.
  4. Once installed, the Continue icon appears in the VS Code Activity Bar on the left or secondary sidebar. Click it to open the assistant panel.

3. Configuring Continue (config.yaml)

Modern versions of Continue use a YAML configuration file located at:

You can open this file directly from VS Code by clicking the gear icon at the bottom-right of the Continue sidebar panel.

Replace the file content with the following verified schema:

name: Local Ollama Stack
version: 1.0.0
schema: v1

models:
  # Chat, Code Review, and Refactor Role
  - name: Qwen 2.5 Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply
    defaultCompletionOptions:
      contextLength: 8192

  # Inline Tab Autocomplete Role
  - name: Qwen 2.5 Coder 1.5B (Autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://localhost:11434
    roles:
      - autocomplete
    defaultCompletionOptions:
      contextLength: 2048

  # Codebase Indexing Embeddings Role
  - name: Nomic Embed Code
    provider: ollama
    model: nomic-embed-text
    apiBase: http://localhost:11434
    roles:
      - embed

context:
  - provider: code
  - provider: docs
  - provider: diff
  - provider: terminal
  - provider: problems
  - provider: folder
  - provider: codebase

Legacy Format Fallback (config.json)

If your installation is pinned to an older Continue release using config.json, the equivalent configuration assigns the completion model under the dedicated tabAutocompleteModel key:

{
  "models": [
    {
      "title": "Qwen 2.5 Coder 7B",
      "provider": "ollama",
      "model": "qwen2.5-coder:7b",
      "apiBase": "http://localhost:11434",
      "contextLength": 8192
    }
  ],
  "tabAutocompleteModel": {
    "title": "Qwen 2.5 Coder 1.5B",
    "provider": "ollama",
    "model": "qwen2.5-coder:1.5b",
    "apiBase": "http://localhost:11434"
  },
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text",
    "apiBase": "http://localhost:11434"
  }
}

4. Hardware Sizing and Role Allocation

The biggest operational friction 365Finds observes with local coding assistants is out-of-memory (OOM) crashing when developers select models too large for their dedicated GPU VRAM. When VRAM fills up, Ollama offloads computational layers to system RAM, causing inference speed to plummet from 60 tokens/sec down to 3 tokens/sec.

VRAM / Unified MemoryRecommended Chat ModelRecommended Autocomplete ModelRecommended Context Length
8 GB VRAMQwen 2.5 Coder 7B (Q4_K_M)Qwen 2.5 Coder 1.5B4,096 tokens
16 GB VRAMQwen 2.5 Coder 14B (Q4_K_M)Qwen 2.5 Coder 1.5B or StarCoder2 3B8,192 tokens
24 GB+ VRAMQwen 2.5 Coder 32B or DeepSeek-Coder-V2 16BQwen 2.5 Coder 1.5B16,384 tokens
32 GB+ Apple SiliconQwen 2.5 Coder 32B (Q4)Qwen 2.5 Coder 1.5B16,384 tokens

5. Troubleshooting Real-World Bottlenecks

1. Connection Refused or Network Hangs

If Continue reports that it cannot reach http://localhost:11434:

2. Autocomplete Suggestions Never Trigger

3. "Model Requires More System Memory" Error

Continue requests a large default context window unless constrained. In config.yaml, explicitly set contextLength: 4096 or contextLength: 2048 under defaultCompletionOptions.


6. Verifying Concurrent GPU Residency

To confirm your dual-engine setup is operating without disk thrashing, trigger both functionalities in VS Code:

  1. Type a partial function declaration in a source file to fire an inline autocomplete suggestion.
  2. Press Ctrl+L (or Cmd+L) to open the Continue chat panel, highlight a block of code, and submit a query.
  3. Open your system terminal and execute:
    ollama ps
    

A properly configured workstation displays both qwen2.5-coder:7b and qwen2.5-coder:1.5b running concurrently with 100% GPU utilization and positive UNTIL durations. If only one model appears or the processor shows 100% CPU, check your OLLAMA_MAX_LOADED_MODELS environment variable and total VRAM allocation.

References