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:
-
Linux (systemd): Run
sudo systemctl edit ollamaand add:[Service] Environment="OLLAMA_NUM_PARALLEL=2" Environment="OLLAMA_MAX_LOADED_MODELS=2" Environment="OLLAMA_KEEP_ALIVE=-1"Apply changes with
sudo systemctl daemon-reload && sudo systemctl restart ollama. -
macOS: Execute in your terminal before launching the Ollama desktop service:
launchctl setenv OLLAMA_NUM_PARALLEL 2 launchctl setenv OLLAMA_MAX_LOADED_MODELS 2 launchctl setenv OLLAMA_KEEP_ALIVE -1 -
Windows: Open System Environment Variables and add
OLLAMA_NUM_PARALLELset to2,OLLAMA_MAX_LOADED_MODELSset to2, andOLLAMA_KEEP_ALIVEset to-1. If VS Code runs inside WSL2 while Ollama runs on Windows, also setOLLAMA_HOST=0.0.0.0:11434andOLLAMA_ORIGINS=*to permit cross-network binding.
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
- Launch VS Code.
- Open the Extensions view (
Ctrl+Shift+XorCmd+Shift+X). - Search for Continue (published by Continue) and click Install.
- 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:
- macOS / Linux:
~/.continue/config.yaml - Windows:
%USERPROFILE%\.continue\config.yaml
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 Memory | Recommended Chat Model | Recommended Autocomplete Model | Recommended Context Length |
|---|---|---|---|
| 8 GB VRAM | Qwen 2.5 Coder 7B (Q4_K_M) | Qwen 2.5 Coder 1.5B | 4,096 tokens |
| 16 GB VRAM | Qwen 2.5 Coder 14B (Q4_K_M) | Qwen 2.5 Coder 1.5B or StarCoder2 3B | 8,192 tokens |
| 24 GB+ VRAM | Qwen 2.5 Coder 32B or DeepSeek-Coder-V2 16B | Qwen 2.5 Coder 1.5B | 16,384 tokens |
| 32 GB+ Apple Silicon | Qwen 2.5 Coder 32B (Q4) | Qwen 2.5 Coder 1.5B | 16,384 tokens |
5. Troubleshooting Real-World Bottlenecks
1. Connection Refused or Network Hangs
If Continue reports that it cannot reach http://localhost:11434:
- Verify the daemon is active by running
curl http://localhost:11434in your terminal. It should returnOllama is running. - If running VS Code inside a DevContainer or remote SSH session, change
http://localhost:11434tohttp://host.docker.internal:11434or your host machine's local IP address. - Ensure Ollama is listening on all interfaces by launching it with
OLLAMA_HOST=0.0.0.0:11434.
2. Autocomplete Suggestions Never Trigger
- Open VS Code settings (
Cmd+,orCtrl+,), search forcontinue.enableTabAutocomplete, and ensure it is checked. - Verify in the Continue status bar (bottom right of the IDE window) that the autocomplete model name matches
qwen2.5-coder:1.5b. - Check if another completion extension, such as GitHub Copilot or Cody, is intercepting tab completion keybindings.
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:
- Type a partial function declaration in a source file to fire an inline autocomplete suggestion.
- Press
Ctrl+L(orCmd+L) to open the Continue chat panel, highlight a block of code, and submit a query. - 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.