AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Configure Model Switching in JetBrains AI Assistant (Claude 3.5 Sonnet vs. GPT-4o)

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 working across JetBrains IDEs—including IntelliJ IDEA, PyCharm, WebStorm, Rider, GoLand, and CLion—can switch between Anthropic Claude 3.5 Sonnet and OpenAI GPT-4o directly within the AI Chat tool window via its model selector dropdown, or globally configure their access through Settings | Tools | AI Assistant | Providers & API keys.

However, effective model switching requires understanding how JetBrains AI Assistant separates task layers: interactive chat and coding agents let you alternate between foundation models like Claude 3.5 Sonnet and GPT-4o, whereas inline code completion runs on dedicated low-latency engines (local models or JetBrains Mellum) and does not automatically follow your chat model selection.


1. Where Model Switching Happens: Chat Dropdown vs. Global Settings

JetBrains provides two complementary ways to manage models: per-conversation selection in the chat window and provider management in IDE settings.

Method A: Per-Task Model Switching in the AI Chat Window

For day-to-day coding, you do not need to open the global settings dialog every time you want a different model.

  1. Open the AI Chat tool window from the right toolbar (or press Alt+Enter / double Shift and search for "AI Chat").
  2. At the top toolbar of the AI Chat window, locate the Model Selector dropdown (it displays the currently active model or Auto).
  3. Click the dropdown to view available models:
    • Select Claude 3.5 Sonnet when tackling complex multi-file refactoring, deep algorithmic design, or nuanced architecture reviews.
    • Select GPT-4o for broad code generation, fast troubleshooting, conversational planning, or scripting.
    • Select Auto if you want JetBrains to dynamically route your prompt based on benchmarked performance and token cost.
  4. Start a prompt or attach relevant project context (files, symbols, or git diffs).

Tip: Switching models midway through an active conversation can inflate token usage because the entire conversational history is resubmitted to the newly selected model. If you are changing tasks, click the + (New Chat) icon before selecting a different model.

Method B: Connecting Custom Models via "Providers & API keys" (BYOK)

If your team does not use a managed JetBrains AI subscription, or if you prefer using your organization's direct API credits, you can use the Bring Your Own Key (BYOK) feature:

  1. Open IDE settings:
    • Windows / Linux: File | Settings (or Ctrl+Alt+S)
    • macOS: IntelliJ IDEA | Settings (or Cmd+,)
  2. Navigate to Tools | AI Assistant | Providers & API keys.
  3. Under Third-party AI providers, choose your provider:
    • Anthropic: Enter your Anthropic API key to enable Claude 3.5 Sonnet and related models.
    • OpenAI: Enter your OpenAI API key to enable GPT-4o, GPT-4o mini, and reasoning models.
    • OpenAI Compatible / Local: Connect endpoints like Ollama, LM Studio, or LiteLLM if you host models privately.
  4. Click Test Connection to confirm network connectivity and key permissions.
  5. Click Apply and OK. The newly authorized models will immediately appear in the AI Chat model selector dropdown.

2. The Architectural Boundary: Chat Models vs. Code Completion

A frequent point of confusion is expecting inline keystroke suggestions (ghost text while typing boilerplate code) to change when you pick Claude 3.5 Sonnet in the chat window. In JetBrains AI Assistant, these tasks are strictly partitioned by design:

Feature LayerPrimary Models UsedWhy They Are Separated
AI Chat & AgentsClaude 3.5 Sonnet; GPT-4o; o1/o3; GeminiHeavy reasoning and long-context comprehension; tolerates latencies of 1 to 5 seconds.
In-Editor Generation & RefactoringCore feature model (GPT-4o / Claude / Gemini)Triggered intentionally via Alt+Enter or contextual menus for structured code edits.
Inline Code Completion (Ghost Text)JetBrains Mellum; Local Full Line modelsRequires ultra-low latency (<50ms) and specialized Fill-in-the-Middle (FIM) training. General chat models would cause typing lag.
Instant HelpersGPT-4o mini; Gemini FlashLightweight background tasks: generating chat titles, collecting symbol context, and naming suggestions.

If you need custom completion models, JetBrains allows configuring an OpenAI-compatible provider specifically under the AI Completion section in Providers & API keys. However, the model must explicitly support FIM or edit-prediction schemas; generic chat models cannot be assigned to keystroke completion.


3. Task Allocation Strategy: When to Use Claude 3.5 Sonnet vs. GPT-4o

Both models are top-tier, but each excels in distinct software engineering workflows.

Choose Claude 3.5 Sonnet For:

Choose GPT-4o For:


4. Quota and Credit Management

Model switching directly influences your billing and rate limits. Keep these factors in mind:

  1. JetBrains AI Service Credits (AI Pro / AI Ultimate):
    • Cloud requests consume AI Credits that reset every 30 days.
    • Claude 3.5 Sonnet and GPT-4o are categorized as full-capability foundation models, consuming more credits per request than lightweight models like GPT-4o mini or Gemini Flash.
    • The UI displays informative tags (such as Reasoning model or High cost model) to help you gauge credit impact before dispatching queries.
  2. Context Accumulation Multipliers:
    • Because language models process the full chat history on every turn, a conversation with 20 back-and-forth exchanges burns significantly more tokens on turn 20 than on turn 1.
    • Always click New Chat when transitioning from system design questions to unrelated bug hunts.
  3. BYOK Cost Advantages:
    • If your organization already has enterprise Anthropic or OpenAI agreements, setting up BYOK allows developers to avoid JetBrains cloud credit caps entirely. You pay only for raw token usage directly to your provider.
  4. Enterprise Policy Governance:
    • If your IDE is managed via JetBrains Central or JetBrains IDE Services, administrators can centrally lock or restrict third-party providers. In enterprise environments where external cloud calls are regulated, certain model toggles may be greyed out.

5. Summary: Recommended Setup Workflow

To alternate smoothly between Claude 3.5 Sonnet and GPT-4o across your JetBrains tools:

References