VS Code + Continue for Local AI Coding
Set up the most popular local-first coding extension. Connect VS Code to Ollama for autocomplete, chat, and tab completion without sending code to the cloud.
Continue is the most popular open-source AI coding extension for VS Code. Unlike GitHub Copilot or Cursor, it lets you use your own local models through Ollama. Your code never leaves your machine, and you pay zero subscription fees.
This recipe sets up Continue with Ollama for both chat (ask questions about your code) and autocomplete (tab to accept suggestions). It is the standard local coding setup recommended by the clearinghouse.
- Continue extension installed in VS Code
- Ollama connected for chat and autocomplete
- Context-aware suggestions that understand your entire codebase
- Zero cloud dependency for day-to-day coding
| Task | Model | RAM needed |
|---|---|---|
| Chat / complex tasks | qwen2.5-coder:14b | ~10GB |
| Fast autocomplete | qwen2.5-coder:1.5b | ~2GB |
| Balanced | qwen2.5-coder:7b | ~5GB |
| Apple Silicon | qwen2.5-coder:14b | Runs on 16GB Mac |
Continue automatically includes nearby code as context. For better results:
- Use
@filesto include specific files in the context - Use
@codebaseto search your entire codebase - Use
@diffto include the current git diff
Example prompt:
@codebase How does authentication work in this project?
"Connection refused" error
Ollama is not running. Start it:
ollama serve
Or on macOS, ensure the Ollama menu bar app is running.
Slow autocomplete
The 14B model is too large for autocomplete. Use the 1.5B model for autocomplete and keep the 14B for chat:
"tabAutocompleteModel": {
"title": "Autocomplete",
"provider": "ollama",
"model": "qwen2.5-coder:1.5b"
}
Poor quality suggestions
- Ensure you are using a coding-specific model (qwen2.5-coder, not generic qwen)
- Include more context by selecting the entire function, not just one line
- Use
@filesto include relevant files
Developers who want Copilot-like functionality without cloud dependency or subscription costs. Particularly strong for: security-conscious teams, air-gapped environments, cost-sensitive projects, and anyone who prefers keeping their code local.
Steps
In VS Code:
- Open Extensions (
Cmd+Shift+Xon Mac,Ctrl+Shift+Xon Linux/Windows) - Search for "Continue"
- Install the extension by Continue Devs
Or via CLI:
code --install-extension Continue.continue
Continue uses a config.json file for model configuration. Open it:
- Press
Cmd+Shift+P(Mac) orCtrl+Shift+P(Linux/Windows) - Type "Continue: Open Config"
- Select the option
Add this configuration:
{
"models": [
{
"title": "Local Qwen Coder",
"provider": "ollama",
"model": "qwen2.5-coder:14b",
"apiBase": "http://localhost:11434"
}
],
"tabAutocompleteModel": {
"title": "Autocomplete",
"provider": "ollama",
"model": "qwen2.5-coder:1.5b",
"apiBase": "http://localhost:11434"
},
"customCommands": [
{
"name": "test",
"prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the above code. Include edge cases and error handling.",
"description": "Write unit tests for selected code"
}
]
}
Save the file. Continue automatically reloads the configuration.
In your terminal:
ollama pull qwen2.5-coder:14b
ollama pull qwen2.5-coder:1.5b
The 14B model handles chat and complex tasks. The 1.5B model is optimized for fast autocomplete suggestions.
- Open any code file in VS Code
- Select a function or block of code
- Press
Cmd+L(Mac) orCtrl+L(Linux/Windows) to open Continue panel - Ask: "Explain this function" or "Refactor this to use async/await"
You should see responses from your local model. If you see "Connection error," Ollama is not running — start it with ollama serve.
- Start typing a function:
function calculateTotal(items) {
//
- Wait 1–2 seconds
- You should see gray ghost text suggesting the implementation
- Press
Tabto accept the suggestion
If autocomplete is not working:
- Check that
qwen2.5-coder:1.5bis pulled:ollama list - Ensure the
tabAutocompleteModelis configured in Continue settings - Try restarting VS Code
Recipe verified Mon Jun 15 2026 00:00:00 GMT+0000 (Coordinated Universal Time). Commands are tested but your environment may differ.
Browse related services