Back to recipes
IDE IntegrationBeginner15 minVerified 45 days ago

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.

vscodecontinueollamalocal-llmcodingautocomplete
The promise

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.

What you'll get
  • 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
Prerequisites
  • VS Code installed
  • Ollama running locally (see macOS or Ubuntu recipes)
  • A coding model pulled in Ollama (qwen2.5-coder:14b recommended)
Model recommendations
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
Advanced: context awareness

Continue automatically includes nearby code as context. For better results:

  • Use @files to include specific files in the context
  • Use @codebase to search your entire codebase
  • Use @diff to include the current git diff

Example prompt:

@codebase How does authentication work in this project?

Troubleshooting

"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 @files to include relevant files
Best fit

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

1

In VS Code:

  1. Open Extensions (Cmd+Shift+X on Mac, Ctrl+Shift+X on Linux/Windows)
  2. Search for "Continue"
  3. Install the extension by Continue Devs

Or via CLI:

code --install-extension Continue.continue
2

Continue uses a config.json file for model configuration. Open it:

  1. Press Cmd+Shift+P (Mac) or Ctrl+Shift+P (Linux/Windows)
  2. Type "Continue: Open Config"
  3. 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.

3

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.

4
  1. Open any code file in VS Code
  2. Select a function or block of code
  3. Press Cmd+L (Mac) or Ctrl+L (Linux/Windows) to open Continue panel
  4. 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.

5
  1. Start typing a function:
function calculateTotal(items) {
  //
  1. Wait 1–2 seconds
  2. You should see gray ghost text suggesting the implementation
  3. Press Tab to accept the suggestion

If autocomplete is not working:

  • Check that qwen2.5-coder:1.5b is pulled: ollama list
  • Ensure the tabAutocompleteModel is 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