AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Route Tab Autocomplete and Chat to Separate Models in Continue

365Finds Editorial
Indexed 11,430 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Developers using Continue in VS Code or JetBrains often face an architectural dilemma: keystroke-level tab autocomplete requires near-instantaneous responses (under 300 milliseconds), while complex codebase refactoring and sidebar chat require deep reasoning models with expansive context windows. Forcing a heavyweight reasoning model like Claude 3.5 Sonnet or GPT-4o into tab completion introduces intolerable typing latency and ballooning API costs. Conversely, relying on a lightweight completion model for multi-file architectural planning leads to shallow code analysis.

The solution is role-based model routing. Continue decouples real-time inline completion from exploratory conversational reasoning. This guide demonstrates how to configure Continue to route tab autocomplete and chat requests to separate, specialized models across both the modern config.yaml standard and legacy config.json environments, optimize local and cloud endpoints, and prevent latency bottlenecks.


Architectural Separation: Autocomplete vs. Chat

Tab autocomplete and chat operate under fundamentally divergent performance constraints and model architectures:

FeatureTab AutocompleteChat & Edit
Primary MetricTime-To-First-Token (TTFT < 300ms)Reasoning depth, context comprehension
Trigger FrequencyHundreds of times per hour on keystroke pausesDozens of times per day on deliberate prompt submission
Model ArchitectureFill-In-The-Middle (FIM) specialized small models (1B–7B)Dense or MoE frontier reasoning models (14B–70B+ / Frontier APIs)
Recommended DeploymentLocal engine (Ollama, vLLM, llama.cpp) or low-latency cloud endpointCloud API (Anthropic, OpenAI, Mistral) or high-capacity local host
Prompt StructureStrict prefix-suffix code context with AST/LSP definitionsConversational history, multi-file attachments, agentic system prompts

By routing these tasks to separate engines, developers achieve local zero-cost, privacy-first typing assist while retaining frontier model intelligence in the sidebar.


Method 1: The Modern Standard (config.yaml)

In modern releases of Continue, configuration is driven by config.yaml located at ~/.continue/config.yaml. Task dispatching is governed by the roles array assigned to each model entry.

To isolate tab autocomplete from chat:

  1. Define a high-throughput, low-parameter FIM model with roles: [autocomplete].
  2. Define one or more frontier models with roles: [chat, edit].

Production Configuration Example

name: Continue Hybrid Routing
version: 0.0.1
schema: v1

models:
  # 1. Specialized Tab Autocomplete Model (Local via Ollama)
  - name: Qwen2.5 Coder 1.5B (Autocomplete)
    provider: ollama
    model: qwen2.5-coder:1.5b
    roles:
      - autocomplete
    autocompleteOptions:
      debounceDelay: 250
      maxPromptTokens: 1024

  # 2. Frontier Reasoning Model for Chat and Refactoring (Cloud via Anthropic)
  - name: Claude 3.5 Sonnet (Chat & Edit)
    provider: anthropic
    model: claude-3-5-sonnet-latest
    apiKey: YOUR_ANTHROPIC_API_KEY
    roles:
      - chat
      - edit

  # 3. Alternative Cloud Chat Model (OpenAI)
  - name: GPT-4o (Chat)
    provider: openai
    model: gpt-4o
    apiKey: YOUR_OPENAI_API_KEY
    roles:
      - chat

Key Parameters in config.yaml


Method 2: Legacy Configuration (config.json)

If your team maintains an older deployment using ~/.continue/config.json, the routing architecture relies on a dedicated top-level object named tabAutocompleteModel distinct from the models array.

[!NOTE] config.json and the top-level tabAutocompleteModel key are deprecated in favor of config.yaml. However, Continue maintains backward compatibility during the transition period.

Legacy Configuration Example

{
  "models": [
    {
      "title": "Claude 3.5 Sonnet",
      "provider": "anthropic",
      "model": "claude-3-5-sonnet-latest",
      "apiKey": "YOUR_ANTHROPIC_API_KEY"
    },
    {
      "title": "GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiKey": "YOUR_OPENAI_API_KEY"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Qwen2.5-Coder 1.5B",
    "provider": "ollama",
    "model": "qwen2.5-coder:1.5b"
  },
  "tabAutocompleteOptions": {
    "debounceDelay": 250,
    "maxPromptTokens": 1024
  }
}

In this schema:


Recommended Model Pairings by Scenario

Choosing the right pairing depends on available local compute, latency expectations, and budget.

Scenario A: Hybrid Local/Cloud (Optimal for Most Developers)

Scenario B: Full Air-Gapped / Privacy-First Local Setup

Scenario C: High-Accuracy Dedicated Cloud Autocomplete


Endpoint Optimization and Latency Tuning

Routing requests to separate models only solves half the problem; developers must also optimize the underlying inference endpoints to avoid resource contention.

1. Optimize Local Ollama for Concurrent Execution

When running a local autocomplete model while querying chat or edit models, default Ollama settings may queue requests, causing the editor to freeze autocomplete while chat is streaming.

2. Configure Debounce and Context Sizing

In fast typing workflows, an aggressive debounce delay triggers speculative completions that are immediately discarded by subsequent keystrokes.

3. Eliminate IDE Extension Collisions

If inline suggestions fail to appear after configuring roles: [autocomplete]:


Summary and Verification

By explicitly assigning the autocomplete and chat roles in Continue’s config.yaml, developers establish a dual-engine workflow: millisecond-level local completions keep developers in flow state while frontier cloud models handle complex software engineering tasks.

To verify your configuration in VS Code or JetBrains:

  1. Open the Continue extension panel (Ctrl+L / Cmd+L) and click the gear icon to open configuration.
  2. Ensure your chat model appears in the dropdown menu at the bottom of the chat panel.
  3. Open a code file, type a partial function signature, and pause for 300 milliseconds. A light-gray ghost text suggestion confirming the local model trigger should appear immediately.

References