AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Continue with Local LLMs in VS Code for Secure, Offline Code Completion

Lindsay Darrach · 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

For developers trapped between strict corporate compliance policies and the productivity boost of AI code assistants, Continue paired with local large language models represents the cleanest escape hatch. 365Finds considers Continue the premier open-source bridge for zero-trust, air-gapped environments. When configured properly with local inference engines like Ollama, not a single byte of your proprietary codebase leaves your workstation or internal subnet.

Getting local code completion right is tricky. If you point Continue's tab autocomplete to an oversized 8B or 14B model on standard hardware, the typing latency will destroy your flow. A smooth setup demands a split-model architecture: a lightweight, low-latency Fill-in-the-Middle (FIM) model dedicated to inline tab autocomplete, paired with a larger instruction-tuned model for sidebar chat and interactive refactoring.

+-------------------------------------------------------------------------+
|                               VS Code                                   |
|  +-------------------------------------------------------------------+  |
|  |                            Continue                               |  |
|  |  +---------------------+                   +-------------------+  |  |
|  |  | Tab Autocomplete    |                   | Chat, Edit &      |  |  |
|  |  | (FIM, low-latency)  |                   | @codebase Search  |  |  |
|  |  +----------+----------+                   +---------+---------+  |  |
|  +-------------|----------------------------------------|------------+  |
+----------------|----------------------------------------|---------------+
                 | HTTP / REST                            | HTTP / REST
                 v                                        v
+-------------------------------------------------------------------------+
|                     Local Inference Host (e.g., Ollama)                 |
|  +------------------------------------+  +---------------------------+  |
|  | qwen2.5-coder:1.5b (autocomplete)  |  | qwen2.5-coder:7b (chat)   |  |
|  +------------------------------------+  +---------------------------+  |
|  +-------------------------------------------------------------------+  |
|  | nomic-embed-text (local vector indexing via LanceDB)              |  |
|  +-------------------------------------------------------------------+  |
+-------------------------------------------------------------------------+

1. Preparing the Local Inference Engine

Before touching VS Code, you need a local model runner exposing an OpenAI-compatible or native REST endpoint. Ollama is 365Finds' default recommendation due to its automated model management, reliable system tray daemon, and efficient memory offloading.

Pull three specialized models: one for inline FIM autocomplete, one for sidebar chat and multi-file edits, and one for local semantic codebase search:

# High-speed Fill-in-the-Middle autocomplete
ollama pull qwen2.5-coder:1.5b

# Sidebar chat, instruction following, and code refactoring
ollama pull qwen2.5-coder:7b

# Local vector embeddings for @codebase context retrieval
ollama pull nomic-embed-text

Verify that Ollama is listening locally by opening http://localhost:11434 in your browser or executing curl http://localhost:11434/api/tags in your terminal. For secure air-gapped workstations, ensure the Ollama process binds strictly to 127.0.0.1 rather than 0.0.0.0.


2. Air-Gap Lockdown: Disabling Telemetry in VS Code

Compliance teams often overlook the extension layer. By default, Continue gathers anonymized diagnostic data via PostHog. While Continue guarantees this telemetry never contains source code or prompt content, a strict offline audit requires cutting all telemetry pings entirely.

Open your VS Code settings.json (via Ctrl + Shift + P or Cmd + Shift + P, then select Preferences: Open User Settings (JSON)) and add the following flags:

{
  "continue.allowAnonymousTelemetry": false,
  "telemetry.telemetryLevel": "off"
}

Setting continue.allowAnonymousTelemetry to false disables all outbound analytical requests from the Continue runtime.


3. Configuring Continue (config.yaml)

Modern versions of Continue use a YAML configuration located at ~/.continue/config.yaml on Linux and macOS, or %USERPROFILE%\.continue\config.yaml on Windows. You can access this directly inside VS Code by opening the Continue sidebar and clicking the gear icon at the bottom right.

365Finds recommends replacing the default cloud templates with this fully local configuration:

name: Offline Local Assistant
version: 1.0.0
schema: v1

models:
  # Primary chat, multi-file edit, and apply role
  - name: Qwen 2.5 Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply

  # Dedicated Tab Autocomplete model
  - name: Qwen 2.5 Coder 1.5B
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://localhost:11434
    roles:
      - autocomplete

  # Embeddings for semantic codebase context
  - name: Nomic Embed
    provider: ollama
    model: nomic-embed-text
    apiBase: http://localhost:11434
    roles:
      - embed

tabAutocompleteOptions:
  debounceDelay: 250
  maxPromptTokens: 1024
  multilineCompletions: "auto"

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

Legacy JSON Syntax (config.json)

If your deployment still relies on the legacy config.json schema, define autocomplete and embeddings through dedicated top-level keys instead of the roles array:

{
  "models": [
    {
      "title": "Qwen 2.5 Coder 7B",
      "provider": "ollama",
      "model": "qwen2.5-coder:7b",
      "apiBase": "http://localhost:11434"
    }
  ],
  "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"
  },
  "tabAutocompleteOptions": {
    "debounceDelay": 250,
    "maxPromptTokens": 1024,
    "multilineCompletions": "auto"
  }
}

4. Hardware Sizing and Model Selection

The biggest frustration developers face with local code completion is latency. Cloud assistants return suggestions in under 300 milliseconds. If your local model takes 1.5 seconds to suggest a bracket closure, you will end up typing over it.

RoleRecommended ModelMinimum RAM / VRAMQuantizationLatency Expectation
Tab Autocompleteqwen2.5-coder:1.5b4 GBQ4_K_M or Q8_080 ms to 180 ms
Tab Autocomplete (High Precision)qwen2.5-coder:7b8 GB VRAM dedicatedQ4_K_M220 ms to 450 ms
Interactive Chat & Refactoringqwen2.5-coder:7b or llama3.1:8b8 GB to 16 GBQ4_K_M15 to 35 tokens/sec
Local Vector Embeddingsnomic-embed-text2 GBDefaultUnder 50 ms per chunk

365Finds strongly advises against using models larger than 3B parameters for tab autocomplete unless you have a dedicated GPU with at least 12 GB of VRAM. On unified memory systems like Apple Silicon M-series chips, qwen2.5-coder:1.5b runs almost entirely within cache, keeping inline ghost text responsive.


5. Offline Semantic Indexing with @codebase

One significant advantage of Continue over basic autocomplete plugins is full-codebase understanding without third-party cloud vector databases.

When you configure nomic-embed-text under the embed role, Continue utilizes a local LanceDB instance stored inside ~/.continue/index. On initial project load, Continue walks your workspace, chunks your files according to your .gitignore rules, and produces local vector embeddings.

To query your project offline:

  1. Open the Continue sidebar (Ctrl + L or Cmd + L).
  2. Type @codebase followed by your architectural question (for example, @codebase where are authentication middleware tokens validated?).
  3. Continue queries LanceDB locally, retrieves relevant code blocks via cosine similarity, and injects them into the prompt for qwen2.5-coder:7b.

6. Verification and Troubleshooting

Once you restart VS Code or reload the Continue extension window (Developer: Reload Window), confirm three indicators:

  1. Status Bar Indicator: Check the bottom status bar for the Continue icon. Clicking it shows whether tab autocomplete is active and displays the loaded model.
  2. Ghost Text Evaluation: Open any source file and type a function signature. Ghost text should appear within a quarter of a second. Press Tab to accept.
  3. Network Isolation Audit: Disconnect your machine from Wi-Fi or run tcpdump -i any port 11434 on Linux to inspect local traffic. You should see local HTTP calls between VS Code and Ollama, with zero outbound connections to external endpoints.

For teams operating under strict non-disclosure agreements, financial regulations, or defense isolation policies, this Continue and Ollama combination establishes a reliable, productive coding environment where intellectual property never crosses the localhost boundary.

References