Switching the underlying large language model (LLM) in Sourcegraph Cody takes two clicks, but only if you know where the tool’s boundaries lie.
At 365Finds, one of the biggest reasons we preferred Sourcegraph Cody over single-vendor tools like GitHub Copilot was model neutrality. Cody never forced you into a single proprietary silo. If Anthropic released a breakthrough reasoning engine, you used Claude. If OpenAI led in multimodal speed, you switched to GPT-4o.
However, switching models in Sourcegraph Cody comes with a critical architectural nuance that confuses many engineers: Chat and Edit models are completely decoupled from Code Completion (Autocomplete) models. Switching your chat dropdown does not change your autocomplete engine.
Here is how to switch models across every layer of Sourcegraph Cody, how to configure local LLMs, and how 365Finds evaluates each model option.
1. Switching Models in Cody Chat (The Quick Dropdown)
For conversational code explanations, test generation, and deep debugging, switching models happens directly in the IDE extension interface (VS Code, JetBrains, or Cody Web).
Step-by-Step Instructions:
- Open the Cody Chat Panel: Open your IDE sidebar and click the Sourcegraph Cody icon, or press
Alt + /(Windows/Linux) orOpt + /(macOS). - Locate the Model Selector: Look at the bottom of the chat panel right above the input box (or along the top toolbar in older extension versions). You will see a pill-shaped button showing the currently active model—typically
Claude 3.5 SonnetorClaude 3.7 Sonnet. - Open the Dropdown Menu: Click the model button to reveal the list of available LLMs provisioned for your account.
- Select Your Target Model: Click any listed model (such as
GPT-4o,Claude 3.5 Sonnet,Gemini 1.5 Pro, orMixtral 8x22B). - Send Your Prompt: Your new conversation immediately runs against the selected model's API.
Note: Changing the model mid-thread applies to your subsequent prompt. If you want a pristine context window without legacy model tokens bleeding into the new conversation, 365Finds recommends starting a fresh chat session (
New Chat) after switching models.
2. Model Switching for Inline Edits (Ctrl + K / Cmd + K)
When you highlight code and hit Ctrl + K (Windows/Linux) or Cmd + K (macOS) to run an inline instruction, Cody invokes its Edit command.
- In recent versions of the Sourcegraph Cody extension, the inline floating input bar includes its own model picker icon on the right side.
- If your editor layout does not show an inline selector, Cody Edit automatically inherits the default model configured in your global chat settings or falls back to the instance default.
- For heavy multi-file refactoring, ensure your edit model matches your chat model choice (Claude 3.5 Sonnet is our institutional recommendation here).
3. Switching the Autocomplete Model (VS Code Settings)
Developers frequently ask why switching the chat dropdown to GPT-4o leaves autocomplete behaving exactly the same. The answer is latency.
Autocomplete requires sub-200ms token generation. Running high-parameter reasoning engines like Claude 3.5 Sonnet on every keystroke would create unbearable typing lag and astronomical API costs. As a result, Sourcegraph Cody routes inline completions through dedicated, lightweight code models (such as DeepSeek V2 Lite Base or StarCoder variants).
To switch or adjust the autocomplete engine in VS Code:
- Open the Command Palette:
Ctrl + Shift + P(Windows/Linux) orCmd + Shift + P(macOS). - Select Preferences: Open User Settings (JSON).
- Configure the autocomplete advanced settings:
{
"cody.autocomplete.advanced.provider": "default",
"cody.autocomplete.advanced.model": "starcoder-16b"
}
Unless you are addressing specific enterprise latency or private VPC endpoint constraints, 365Finds advises leaving autocomplete settings on default. Sourcegraph's automatic routing handles completion throughput far better than manual overrides.
4. Connecting and Switching to Local LLMs via Ollama
If your organization enforces strict air-gapped data policies or you want zero cloud egress, Sourcegraph Cody supports local model execution via Ollama.
Step 1: Prepare Ollama Locally
Pull your chosen code-specialized model in your local terminal:
ollama pull deepseek-coder:6.7b
ollama serve
Step 2: Update VS Code settings.json
Add the experimental Ollama flags to your configuration:
{
"cody.autocomplete.advanced.provider": "experimental-ollama",
"cody.autocomplete.experimental.ollamaOptions": {
"url": "http://localhost:11434",
"model": "deepseek-coder:6.7b"
},
"cody.experimental.ollamaChat": true
}
Once saved, reload your IDE window. When you open the Cody Chat dropdown, your local Ollama instance appears as an available target.
5. Enterprise Controls: Cody Gateway vs. BYOK
If your model dropdown is locked or only shows a single entry, you are running inside a Sourcegraph Enterprise deployment where choices are dictated by administrative policy.
Sourcegraph Enterprise manages LLM access through two mechanisms:
- Sourcegraph Model Provider (Cody Gateway): A managed proxy allowing administrators to grant team-wide access to Anthropic, OpenAI, and Google models without managing individual corporate API billing accounts.
- Bring Your Own Key (BYOK): Administrators configure direct endpoints via AWS Bedrock, Azure OpenAI Service, Google Cloud Vertex AI, or internal self-hosted gateways inside the Sourcegraph site configuration (
modelConfiguration).
If an administrator does not explicitly enable multi-model selection in the site configuration, client-side developers will not see alternative models in their IDE dropdown.
6. Model Selection Guide: How 365Finds Chooses
Having five LLMs in a dropdown is useless if you don't know when to use which. Here is our direct, field-tested guidance:
| Model | Ideal Use Case | 365Finds Assessment |
|---|---|---|
| Claude 3.5 Sonnet / 3.7 Sonnet | Architectural design, refactoring, cross-file logic, test writing | Our primary recommendation. Anthropic produces the lowest hallucination rate in complex codebases and follows subtle multi-step instructions better than anyone else. |
| OpenAI GPT-4o | Fast algorithmic utility, boilerplate scripting, SQL tuning | Snappy and dependable for self-contained algorithms and standard scripts. Less disciplined than Claude on massive unified diffs. |
| Google Gemini 1.5 Pro | Giant repo context, ingesting massive docs / API specs | The best choice when you need to paste entire documentation libraries or massive context windows into a single query. |
| Claude 3.5 Haiku / GPT-4o mini | Quick syntax lookups, regex generation, docstrings | Ultra-fast and economical for simple questions where deep reasoning isn't required. |
| Local Models (Ollama) | Air-gapped environments, strict zero-cloud compliance | Necessary for compliance, but inference speed is strictly bounded by your local GPU VRAM. |
7. Institutional Perspective and Status
Sourcegraph Cody demonstrated the immense value of decoupling the developer IDE assistant from proprietary model vendors. Being able to toggle between Claude for difficult architectural reasoning and GPT-4o for quick scripting remains the gold standard for developer flexibility.
Teams utilizing this feature should keep infrastructure roadmaps in mind: Sourcegraph shifted Cody strictly into Enterprise contracts and set its official end-of-life for January 31, 2027, transitioning its product focus toward Model Context Protocol (MCP) and agentic developer architectures.