Want GitHub Copilot-level code assistance — but fully offline, air-gapped, and private? This guide walks you through setting up Continue (a VSCode extension) with Ollama (a local model runner) so you get chat, autocomplete, and inline editing powered entirely by models running on your own machine. No internet required at runtime.
What Are Continue and Ollama?
Continue is an open-source VSCode (and JetBrains) extension that adds AI-powered coding features directly into your editor — think chat, inline edits, and tab autocomplete. By default it can connect to Claude, GPT-4, or any API. But it also supports local providers, which is exactly what we want here.
Ollama is a tool that lets you download and run large language models locally on your machine with a single command. It exposes those models via a simple REST API on localhost:11434, which Continue can talk to — no cloud involved.
Together, they replicate the core experience of GitHub Copilot or the Claude VSCode extension, but 100% offline and private.
Prerequisites & Hardware Requirements
| Requirement | Minimum | Recommended |
|---|---|---|
| OS | Windows 10 / Linux / macOS 12 | Any modern 64-bit OS |
| RAM | 8 GB | 16 GB+ |
| Storage | 10 GB free | 20 GB+ free |
| GPU | Not required | NVIDIA (CUDA) or AMD (ROCm) |
| VSCode | 1.80+ | Latest stable |
Choosing the Right Models
We'll use three models, each optimised for a different role inside Continue. This covers everything from fast keystroke-level autocomplete to deep reasoning during chat.
Step 1 — Installing Ollama & Pulling Models
Install Ollama
# Linux curl -fsSL https://ollama.ai/install.sh | sh # macOS brew install ollama # Windows → download installer from ollama.ai/download
Start the Service & Verify
# Start Ollama in the background ollama serve # In a second terminal — check it's running curl http://localhost:11434 # Should respond: Ollama is running
Pull the Three Models
Always use ollama pull with the exact tag. Using just the model name without a tag pulls :latest, which might not be the version you expect.
# Code generation + chat ollama pull qwen2.5-coder:7b # Reasoning + agent mode (tool support) ollama pull llama3.1:8b # Lightweight autocomplete ollama pull qwen2.5-coder:1.5b # Verify all three are downloaded ollama list
Enable as a System Service (Linux)
This ensures Ollama starts automatically on boot — important in offline environments where you can't just re-run a command.
sudo systemctl enable ollama sudo systemctl start ollama systemctl status ollama
Step 2 — Installing Continue in VSCode (Offline)
In an air-gapped environment, you cannot install extensions from the VSCode Marketplace. Instead, grab the .vsix bundle while you have internet access.
continue-*.vsix file.Step 3 — Configuring config.yaml
Open your Continue config file. Its location depends on your OS:
| OS | Path |
|---|---|
| Linux / macOS | ~/.continue/config.yaml |
| Windows | %USERPROFILE%\.continue\config.yaml |
Replace the entire file contents with the following configuration:
name: Local Offline Config version: 0.0.1 schema: v1 models: # ── CHAT & REASONING ───────────────────────────────────────── - name: Llama 3.1 8B provider: ollama model: llama3.1:8b apiBase: http://localhost:11434 roles: - chat - edit - apply capabilities: - tool_use # enables Agent mode defaultCompletionOptions: contextLength: 8192 temperature: 0.7 # ── CODE GENERATION ────────────────────────────────────────── - name: Qwen2.5 Coder 7B provider: ollama model: qwen2.5-coder:7b apiBase: http://localhost:11434 roles: - chat - edit - apply defaultCompletionOptions: contextLength: 8192 temperature: 0.3 # lower = more deterministic code # ── AUTOCOMPLETE ───────────────────────────────────────────── - name: Qwen2.5 Coder 1.5B (Autocomplete) provider: ollama model: qwen2.5-coder:1.5b apiBase: http://localhost:11434 roles: - autocomplete defaultCompletionOptions: contextLength: 4096 temperature: 0.1 num_predict: 256 # keep suggestions short & fast # Disable telemetry — critical for offline / air-gapped setups analytics: enabled: false
Step 4 — Disabling Telemetry
Continue, by default, sends anonymous usage data to PostHog. In an offline environment this will cause silent errors or slow timeouts as it tries to reach an external server. Disable it at two levels:
In config.yaml (already included above)
analytics: enabled: false
In VSCode Settings
Open settings.json (Ctrl+Shift+P → "Open User Settings JSON") and add:
{
"continue.telemetryEnabled": false
}Alternatively: File → Preferences → Settings → search "Continue telemetry" → uncheck the box.
After making both changes, restart VSCode to ensure they take effect.
Step 5 — Usage & Keyboard Shortcuts
| Action | Shortcut | What it does |
|---|---|---|
| Open Chat | Ctrl+L | Opens the Continue chat panel on the right |
| Inline Edit | Ctrl+I | Opens an inline prompt to edit selected code |
| Accept Autocomplete | Tab | Accepts the grey ghost suggestion |
| Reject Autocomplete | Esc | Dismisses the suggestion |
| Select model | Dropdown in panel | Switch between your configured models |
Quick Workflow Examples
Troubleshooting
"Model not found" / 404 error
# Check which models are actually installed ollama list # If missing, pull the exact tag ollama pull qwen2.5-coder:7b
The model name in config.yaml must match exactly what ollama list shows.
"Model requires more system memory"
Reduce the context length in your config:
defaultCompletionOptions: contextLength: 2048 # down from 8192
Continue can't connect to Ollama
# Verify Ollama is running curl http://localhost:11434 # Check Linux service status systemctl status ollama # Check port isn't blocked ss -tlnp | grep 11434
"Agent mode is not supported"
Not all models support function calling. Make sure you're using llama3.1:8b and that your config includes:
capabilities: - tool_use
Slow autocomplete
num_predict to 128 or lower in the autocomplete model config. You can also try qwen2.5-coder:1.5b with contextLength: 2048 for the fastest possible suggestions.You're Set
With Ollama serving models locally and Continue wired up to use them, your VSCode now has a fully offline, private AI coding assistant. Chat with Llama 3.1 for reasoning, generate and refactor code with Qwen 7B, and let Qwen 1.5B handle fast tab completions — all without a single byte leaving your machine.
The same setup works in air-gapped corporate environments, secure networks, or simply when you'd rather keep your codebase off third-party servers. The only thing you need the internet for is the initial download — after that, everything runs entirely on your hardware.
docs.continue.devOllama model library:
ollama.com/libraryContinue GitHub releases (for .vsix):
github.com/continuedev/continue/releases
Comments
Post a Comment