HOW-TO · DEV

How to configure Continue.dev with multiple AI providers and switch between them

intermediate15 minBy Fredoline Eruo
Target environment
Ubuntu 24.04 · Continue.dev 0.9.x
PREREQUISITES

Continue.dev installed, access to multiple providers

What this does

Continue.dev supports simultaneous configuration of multiple LLM providers, including OpenAI, Anthropic, local Ollama instances, and any OpenAI-compatible API. A model selector in the sidebar allows quick switching between providers without editing the configuration file. This flexibility enables teams to balance cost, latency, and privacy requirements per task.

Steps

  1. Open the configuration file at ~/.continue/config.json.
  2. Locate the models array in the JSON structure.
  3. Add the first provider entry: set "title" to a display name (for example, "GPT-4o"), "provider" to "openai", and "model" to "gpt-4o".
  4. Add a second provider entry: set "title" to "Ollama Local", "provider" to "openai", "model" to "llama3", and "api_base" to "http://localhost:11434/v1".
  5. Add a third entry using an Anthropic provider if desired, specifying "provider": "anthropic" and "model": "claude-3-5-sonnet-20241022".
  6. Optionally set a default model by adding "default": true to one entry within the models array.
  7. Save the file and reload the IDE window.
  8. Open the Continue.dev panel, click the model selector at the top of the sidebar, and confirm that all three entries appear in the dropdown.

Verification

cat ~/.continue/config.json | python3 -c "import sys,json; cfg=json.load(sys.stdin); models=cfg.get('models',[]); print('Configured providers:', [m.get('title') for m in models])"

Expected output: a list of configured provider titles, for example ['GPT-4o', 'Ollama Local', 'Claude'].

Common failures

  • Duplicate model titles: Each entry must have a unique "title" field; duplicate titles cause the selector to show only one entry.
  • Invalid api_base URL: A trailing slash or wrong path causes "connection failed" errors; ensure the URL ends with /v1 for OpenAI-compatible backends.
  • API key missing: Remote providers such as OpenAI and Anthropic require a valid "api_key" field; set it either in the config or as an environment variable referenced with ${OPENAI_API_KEY}.

Related guides