Model Switching
Copair supports multiple AI providers and models. You can switch between them at any time during a session — no need to restart.
Supported Providers
| Provider | Models | API Key Required |
|---|---|---|
| Anthropic | Claude Opus 4.6, Sonnet 4.6, Haiku 4.5 | Yes |
| OpenAI | GPT-5.4, GPT-4.1, o3, o4-mini | Yes |
| Gemini 3.1 Pro, Gemini 3 Flash, Gemini 2.5 Pro | Yes | |
| Ollama | Llama 4, Qwen 2.5, Mistral, DeepSeek V3, etc. | No |
| Any OpenAI-compatible | vLLM, LM Studio, llama.cpp | Varies |
Switching Models Mid-Session
Use the /model command to switch models without losing your conversation context:
> /model
Copair will display a list of configured providers and models. Select one to switch immediately.
Quick Switch
You can also specify the model directly:
> /model anthropic:claude-sonnet-4.6
> /model openai:gpt-5.4
> /model ollama:llama4Configuring Providers
Add providers by editing ~/.copair/config.yaml (global) or .copair/config.yaml (project-level).
Single provider
# ~/.copair/config.yaml
version: 1
default_model: claude-sonnet
providers:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
models:
claude-sonnet:
id: claude-sonnet-4-20250514Multiple providers
You can configure multiple providers simultaneously — all appear in the /model menu:
version: 1
default_model: claude-sonnet
providers:
anthropic:
api_key: ${ANTHROPIC_API_KEY}
models:
claude-sonnet:
id: claude-sonnet-4-20250514
openai:
api_key: ${OPENAI_API_KEY}
models:
gpt-5:
id: gpt-5
google:
api_key: ${GOOGLE_API_KEY}
models:
gemini-flash:
id: gemini-3-flashOpenAI-Compatible Endpoints
For self-hosted or alternative providers that use the OpenAI API format, set type: openai-compatible:
providers:
ollama:
type: openai-compatible
base_url: http://localhost:11434/v1
models:
llama4:
id: llama4
supports_tool_calling: falseThis works with Ollama, vLLM, LM Studio, llama.cpp, and any OpenAI-compatible server.
When to Switch Models
- Complex reasoning — Use Claude Opus 4.6 or GPT-5.4 for architecture decisions and multi-step refactoring
- Quick edits — Use a faster model like Gemini 3 Flash or Claude Haiku 4.5 for small changes
- Local/offline — Switch to Ollama with Llama 4 or Qwen 2.5 when you don't have internet access
- Cost optimization — Use local models for exploration, cloud models for final implementation