16. Continue.dev Integration

Chapter 16 of 20 · 15 min

Continue.dev is a VS Code extension that uses Ollama for code completion and chat. It integrates directly into the IDE, providing context-aware assistance while you write code.

Installation

  1. Install VS Code
  2. Open Extensions (Ctrl+Shift+X)
  3. Search for "Continue" and install the "Continue" extension

Configuration

After installation, open the Continue settings (click the Continue icon in the sidebar or press Ctrl+Shift+=). Configure the Ollama connection:

{
  "models": [
    {
      "title": "Codellama",
      "provider": "ollama",
      "model": "codellama:7b",
      "api_base": "http://localhost:11434"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codellama",
    "provider": "ollama",
    "model": "codellama:7b",
    "api_base": "http://localhost:11434"
  }
}

The models array configures chat models, while tabAutocompleteModel sets the model used for inline code completion.

Features

  • Inline completion - Autocomplete suggestions as you type, powered by the tabAutocompleteModel.
  • Chat panel - Ask questions about your codebase in the sidebar.
  • Context retrieval - Continue automatically includes relevant file contents in prompts.

Model Selection

Continue works best with code-focused models:

  • codellama:7b - General code completion and explanation
  • codellama:13b - More capable, requires more VRAM
  • deepseek-coder:6.7b - Specialized for code generation

For autocomplete specifically, smaller models (7B parameters) respond faster and work well for single-line completions.

Troubleshooting

No completions appearing:

  1. Verify Ollama is running: curl http://localhost:11434
  2. Check the api_base in Continue settings matches your Ollama URL
  3. Try a different model-some models are not well-tuned for code completion

Slow responses:

  1. Reduce the tabAutocompleteModel size (try codellama:3b instead of 7b)
  2. Limit context by adjusting Continue's retrieval settings
  3. Ensure GPU acceleration is working (see Chapter 8)

Model not found:

  1. Pull the model: ollama pull codellama:7b
  2. Check the model name in Continue settings matches exactly (including version tag)
EXERCISE

Install Continue, configure it with codellama:7b, and verify inline completions work in a Python file. If completion is slow, switch to codellama:3b and compare response times.