AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Software Engineers Configure Continue with Ollama for Completely Offline AI Code Generation and Tab Autocomplete in VS Code

Kyle Muscato · 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

Software engineering in strictly air-gapped defense enclaves, core banking data centers, and confidential enterprise networks often faces an unpleasant choice: work in total isolation without modern AI coding assistants, or risk compliance penalties by punching holes through network perimeters.

Continue combined with Ollama solves this problem. It allows engineering teams to construct an entirely offline, zero-telemetry, zero-egress AI programming pipeline inside VS Code.

Yet many engineers attempt this migration and immediately abandon it within twenty minutes. They type code in VS Code, and the editor stutters, drops frames, and freezes for three to six seconds per line. The underlying issue is almost always architectural: developers mistakenly configure a single large language model—such as a 7B, 14B, or 32B chat model, or worse, a reasoning model like DeepSeek-R1—for both sidebar chat and inline tab autocomplete.

At 365Finds, our research and deployment benchmarks show that offline AI coding succeeds only under a dual-engine asymmetric architecture. Inline tab autocomplete and multi-turn conversational chat are distinct cognitive workloads requiring different parameter scales, specialized prompt templates, and dedicated memory allocations.

Here is how to configure Continue and Ollama in VS Code to achieve responsive offline code generation and sub-250ms inline tab autocompletion.


1. Why Single-Model Offline Setups Cause Severe VS Code Stutter

To fix editor lag, we must understand why it happens in an offline setup.

The Physics of Inline Autocomplete vs. Conversational Chat

When an engineer directs Continue to query a 14B chat model for inline autocomplete, VS Code makes a heavy forward pass through tens of billions of weights every 300 milliseconds. Compute queues choke, GPU thermals spike, and the editor's cursor visibly lags.

The Ollama "Ping-Pong" Model Thrashing Trap

By default, if Ollama is not explicitly instructed otherwise, its memory manager can aggressively unload inactive models or struggle when two models compete for VRAM. If your workstation has Ollama set to allow only one active model in memory (OLLAMA_MAX_LOADED_MODELS=1), a catastrophic cycle begins:

  1. You ask a question in Continue's sidebar chat (Ollama loads your 14B chat model).
  2. You return to the editor and type code (Ollama evicts the 14B chat model and loads the autocomplete model from disk).
  3. You highlight code and ask for an explanation (Ollama evicts the autocomplete model and reloads the 14B chat model).

This constant swapping over PCIe buses and NVMe drives converts your NVMe SSD into a bottleneck and turns VS Code into a slideshow.


2. Infrastructure Setup: Pinning Models in Ollama

Before touching Continue's settings, configure the Ollama host process to host two models concurrently in GPU memory.

Step 1: Pull the Asymmetric Model Pair

We recommend pairing an ultra-lightweight FIM model for tab completion with a capable coder model for sidebar chat and file edits:

Run the following commands in your terminal:

# Pull the dedicated inline completion model
ollama pull qwen2.5-coder:1.5b

# Pull the primary chat, edit, and refactoring model
ollama pull qwen2.5-coder:7b

Step 2: Configure Ollama Environment Variables

To prevent model thrashing, instruct Ollama to keep both models resident in memory simultaneously and extend their idle unload timeout.

To verify that Ollama is ready to hold both models, start them once and run:

ollama ps

Both models should display 100% GPU under the processor column. If either model spills into CPU RAM, you must reduce the parameter size or lower the context window length.


3. Configuring Continue via Native config.yaml

Modern versions of Continue deprecated the legacy config.json format and its old tabAutocompleteModel top-level object in favor of a declarative config.yaml schema (v1).

Open or create your Continue configuration file:

Populate config.yaml with the following configuration:

name: Offline Ollama Setup
version: 0.0.1
schema: v1

models:
  # Primary Chat and Refactoring Model
  - name: Qwen2.5-Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://127.0.0.1:11434
    roles:
      - chat
      - edit
    defaultCompletionOptions:
      contextLength: 8192

  # Dedicated Low-Latency Tab Autocomplete Engine
  - name: Qwen2.5-Coder 1.5B (Tab)
    provider: ollama
    model: qwen2.5-coder:1.5b
    apiBase: http://127.0.0.1:11434
    roles:
      - autocomplete
    defaultCompletionOptions:
      contextLength: 2048
    autocompleteOptions:
      disable: false
      debounceDelay: 250
      maxPromptTokens: 1024
      modelTimeout: 2000
      maxSuffixPercentage: 0.2
      prefixPercentage: 0.3

Explaining the Key Optimization Parameters

  1. roles: [autocomplete] vs roles: [chat, edit]: Continue explicitly binds models to their operational scopes. The 1.5B model handles exclusively inline completion requests, while the 7B model handles chat prompts, @file context inclusions, and code diff edits.
  2. contextLength: 2048 for Autocomplete: By default, Continue or Ollama can allocate a 32,768-token KV cache for Qwen2.5 models. For tab autocomplete, scanning 32k tokens on every keystroke exhausts GPU memory and adds massive prefill latency. Restricting autocomplete to 2,048 tokens preserves VRAM and keeps time-to-first-token minimal.
  3. debounceDelay: 250: This introduces a 250-millisecond quiet window before firing an autocomplete request. If you type continuously at high speed, Continue will wait until you pause before generating suggestions, saving your GPU from processing discarded predictions.
  4. modelTimeout: 2000: If an autocomplete request cannot complete within 2,000 milliseconds, Continue cancels it, guaranteeing that the editor UI never blocks or queues up stale suggestions.

4. Hardening Offline Security & Disabling Network Telemetry

In classified, banking, or air-gapped environments, tools attempting outbound network requests can trigger IDS/IPS firewall alerts or get killed by security daemons.

Step 1: Disabling Continue Telemetry

By default, Continue sends anonymous usage metrics to PostHog. In an isolated environment with no internet egress, these queries will fail silently, but they consume socket timeouts and pollute internal network logs.

Step 2: VS Code Inline Completion Settings

Ensure VS Code's native inline suggestion subsystem is configured to give priority to Continue without internal collision:

{
  "editor.inlineSuggest.enabled": true,
  "editor.suggest.preview": true,
  "editor.inlineSuggest.suppressSuggestions": false
}

If you previously used extensions like GitHub Copilot or Supermaven, disable them to prevent competing event listeners from firing on the same keystroke.


5. Hardware Sizing and Institutional Verdict from 365Finds

The viability of a fully offline AI coding stack hinges on respecting your GPU's physical VRAM ceiling. 365Finds evaluated common enterprise hardware configurations to establish practical deployment boundaries:

VRAM TierPrimary Chat ModelTab Autocomplete ModelTotal VRAM FootprintObserved Autocomplete Latency
8 GB VRAM (RTX 4060 / T4)qwen2.5-coder:7b-instruct-q4_K_Mqwen2.5-coder:1.5b~6.2 GB~220ms – 280ms
16 GB VRAM (RTX 4080 / V100)qwen2.5-coder:14b-instruct-q4_K_Mqwen2.5-coder:1.5b~11.8 GB~160ms – 210ms
24 GB VRAM (RTX 3090 / 4090 / A10)qwen2.5-coder:14b (Q8 / FP16)starcoder2:3b or qwen2.5-coder:1.5b~16.5 GB~120ms – 180ms
Apple Silicon (36GB+ Unified)qwen2.5-coder:32b-instruct-q4_K_Mqwen2.5-coder:1.5b~22.4 GB~200ms – 300ms

365Finds advises against attempting to use 7B or larger models for tab autocomplete unless you possess dedicated multi-GPU inference nodes serving vLLM. On a single local workstation, the 1.5B model delivers nearly identical FIM code completion accuracy for typical functions and boilerplate, while executing fast enough to match natural human typing rhythms.

Set OLLAMA_MAX_LOADED_MODELS=2, separate your models by role in config.yaml, clamp autocomplete context length to 2,048 tokens, and your offline VS Code environment will provide a seamless coding experience completely severed from the public internet.


References