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
- Tab Autocomplete runs continuously as you write. Every pause in your keystrokes triggers an inference call. The developer expectations for autocomplete are ruthless: suggestions must render within 150ms to 300ms, or the suggestion appears after the developer has already typed the intended characters. Furthermore, autocomplete models do not rely on standard instruction-following; they rely on Fill-in-the-Middle (FIM) training, taking code before your cursor (prefix) and code after your cursor (suffix) to predict what bridges the gap.
- Chat and Code Refactoring, by contrast, are deliberate, interactive operations. Engineers are comfortable waiting two to five seconds while a model ingests hundreds of lines of code, analyzes structural dependencies, and streams a refactored implementation.
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:
- You ask a question in Continue's sidebar chat (Ollama loads your 14B chat model).
- You return to the editor and type code (Ollama evicts the 14B chat model and loads the autocomplete model from disk).
- 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:
- Tab Autocomplete Engine:
qwen2.5-coder:1.5b-base(orqwen2.5-coder:1.5b) orstarcoder2:3b. At 1.5B parameters, Qwen2.5-Coder consumes less than 1.5 GB of VRAM in 4-bit/8-bit quantization and generates inline suggestions in under 180ms on modest GPUs. - Chat & Edit Engine:
qwen2.5-coder:7b(for workstations with 8GB to 12GB VRAM) orqwen2.5-coder:14b(for workstations with 16GB to 24GB VRAM).
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.
-
On Linux (systemd): Run
sudo systemctl edit ollamaand add:[Service] Environment="OLLAMA_MAX_LOADED_MODELS=2" Environment="OLLAMA_KEEP_ALIVE=4h" Environment="OLLAMA_NUM_PARALLEL=2"Then reload and restart the service:
sudo systemctl daemon-reload sudo systemctl restart ollama -
On macOS: Set environment variables via launchctl:
launchctl setenv OLLAMA_MAX_LOADED_MODELS 2 launchctl setenv OLLAMA_KEEP_ALIVE 4h launchctl setenv OLLAMA_NUM_PARALLEL 2 -
On Windows: Add
OLLAMA_MAX_LOADED_MODELSwith value2andOLLAMA_KEEP_ALIVEwith value4hto your System Environment Variables, then restart Ollama from the system tray.
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:
- macOS / Linux:
~/.continue/config.yaml - Windows:
%USERPROFILE%\.continue\config.yaml
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
roles: [autocomplete]vsroles: [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,@filecontext inclusions, and code diff edits.contextLength: 2048for 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.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.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.
- In VS Code, open Settings (
Ctrl+,orCmd+,). - Search for
Continue: Allow Anonymous Telemetry. - Uncheck the box (or add
"continue.telemetry": falseto your VS Codesettings.json).
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 Tier | Primary Chat Model | Tab Autocomplete Model | Total VRAM Footprint | Observed Autocomplete Latency |
|---|---|---|---|---|
| 8 GB VRAM (RTX 4060 / T4) | qwen2.5-coder:7b-instruct-q4_K_M | qwen2.5-coder:1.5b | ~6.2 GB | ~220ms – 280ms |
| 16 GB VRAM (RTX 4080 / V100) | qwen2.5-coder:14b-instruct-q4_K_M | qwen2.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_M | qwen2.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.