HOW-TO · DEV
How to configure Continue.dev with multiple AI providers and switch between them
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
- Open the configuration file at
~/.continue/config.json. - Locate the
modelsarray in the JSON structure. - Add the first provider entry: set
"title"to a display name (for example, "GPT-4o"),"provider"to"openai", and"model"to"gpt-4o". - Add a second provider entry: set
"title"to "Ollama Local","provider"to"openai","model"to"llama3", and"api_base"to"http://localhost:11434/v1". - Add a third entry using an Anthropic provider if desired, specifying
"provider": "anthropic"and"model": "claude-3-5-sonnet-20241022". - Optionally set a default model by adding
"default": trueto one entry within themodelsarray. - Save the file and reload the IDE window.
- 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_baseURL: A trailing slash or wrong path causes "connection failed" errors; ensure the URL ends with/v1for 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}.