AI Assistant 2026.2 Help

Use third-party and local models

In addition to the models provided by JetBrains AI, AI Assistant can use models from third-party AI providers and models that run locally on your machine:

After you connect your own models, you can use them in the following ways:

  • AI Chat – select your models in the model selector.

  • AI Assistant features – use your models for features such as code generation.

  • Agents – select your models in the model selector of compatible agents.

Connect a third-party AI provider

To use models from a third-party provider, enter your API key for that provider in the AI Assistant settings. Some providers require additional parameters.

  1. Navigate to Settings | Tools | AI Assistant | Providers & API keys.

    Providers & API keys settings
  2. In the Third-party AI providers section, select the Provider.

  3. Configure the connection. The required parameters depend on the provider:

    Provide API key

    Enter the API Key and click Test Connection.

    1. Select the authentication Method:

      • API key – use an API key for Vertex AI in express mode.

        Google Vertex AI API key
      • ADC (Application Default Credentials) – use the Google Cloud credentials already configured in your environment, for example, by your local Google Cloud setup or a service account. Also specify the Project ID and Location.

        Google Vertex AI ADC
    2. Click Test Connection.

    OpenAI-compatible provider
    1. In the URL field, specify the address of the provider's API endpoint.

    2. Enter your API Key.

    3. If the model can call tools from MCP servers, enable Tool calling.

    4. Click Test Connection.

  4. Click Apply to save changes.

To check the result, open AI Chat and click the model selector. The provider's models appear in a separate section. They also appear in the model selector of compatible agents.

Third-party provider models in chat

Connect local models

Ollama and LM Studio run models on your machine. After you connect AI Assistant to one of them, you can use its models in AI Chat and other AI Assistant features.

Before you start, install Ollama or LM Studio, make sure it is running, and download at least one model.

  1. Navigate to Settings | Tools | AI Assistant | Providers & API keys.

  2. In the Third-party AI providers section, select Ollama or LM Studio as the Provider.

  3. In the URL field, specify the address of the local server and click Test Connection.

    Enable Third-party AI providers
  4. In the Models Assignment section, select the local models to use for AI Assistant features. Without this step, local models are available only in AI Chat. For details, refer to Assign models manually.

  5. Click Apply to save changes.

Choose models for AI Assistant features

By default, AI Assistant features use cloud-based models provided through the JetBrains AI service, so all features are available. When you connect your own models, the way they are assigned to features depends on where the models come from:

Model source

How models are assigned to features

Anthropic, Google, OpenAI

Automatically. Each feature uses a model from its predefined list. If none of the provider's models is on the list, the feature is unavailable. For details, refer to How automatic assignment works.

OpenAI-compatible endpoints and local models

Manually. Until you assign models, these models are available only in AI Chat.

Assign models manually

To assign models from an OpenAI-compatible endpoint or local models to AI Assistant features:

  1. Navigate to Settings | Tools | AI Assistant | Providers & API keys.

  2. In the Models Assignment section, configure the following settings:

    Local models setup
    • Core features – the model for in-editor code generation, commit message generation, and other core features. It is also the default model in AI Chat.

    • Instant helpers – the model for lightweight features, such as chat context collection, chat title generation, and name suggestions.

    • Context window – the size of the model context window for local models, in tokens. A larger window lets the model process more context in a single request. A smaller window uses less memory and can improve performance. The default value is 64 000 tokens.

  3. Click Apply to save changes.

AI Assistant now uses the assigned models when you trigger the corresponding features.

How automatic assignment works

Each AI Assistant feature has a list of assigned models. Some features also have a list of fallback models. When you trigger a feature, AI Assistant selects a model as follows:

  1. If one of your available models is on the feature's list of assigned models, AI Assistant uses it.

  2. Otherwise, if the feature has fallback models, AI Assistant looks for one of your available models on the fallback list.

  3. If neither list contains an available model, the feature is unavailable.

Yes

No

No

Yes

Yes

No

You trigger a feature

Is an available model on the assigned list?

Does the feature have fallback models?

Is an available model on the fallback list?

Feature works

Feature is unavailable

List of assigned and fallback models

This section lists AI Assistant features and the models they require, helping you assess compatibility with models from third-party providers.

Core features

Feature

Application area

Used model(s)

In-editor code generation

Editor

  • Anthropic models: Claude 4.5 Sonnet

  • Google models: Gemini 2.5 Pro

  • OpenAI models: GPT-4o

Generate documentation

Editor

  • Google models: Gemini 2.5 Pro

  • OpenAI models: GPT-4o

Generate tests

Editor

  • Google models: Gemini 2.5 Pro

  • OpenAI models: GPT-4o

Fix with AI (only in RustRover)

Editor

  • Anthropic models: Claude 3.7 Sonnet

Resolve Git conflicts with AI

VCS

  • Google models: Gemini 2.5 Pro

  • OpenAI models: GPT-4o

Perform Self-Review with AI

VCS

  • Anthropic models: Claude 3.7 Sonnet

  • OpenAI models: GPT-4o, GPT-4o mini

Instant helpers

Feature

Application area

Used model(s)

Apply a suggestion to the current file

AI Chat

  • Google models: Gemini 2.0 Flash, Gemini 2.5 Flash

  • OpenAI models: GPT-4o, GPT-4o mini

File name generation

AI Chat

  • Google models: Gemini 2.5 Flash

  • OpenAI models: GPT-4o mini

Chat context collection

AI Chat

  • Google models: Gemini 2.0 Flash, Gemini 2.5 Flash

  • OpenAI models: GPT-4o mini

Chat title generation

AI Chat

  • Google models: Gemini 2.5 Flash

  • OpenAI models: GPT-4o mini

Name suggestions

Editor

  • Google models: Gemini 2.5 Flash

  • OpenAI models: GPT-4o mini

Completion model

Feature

Where the feature is invoked

Used model(s)

Code completion

Editor, AI Chat, Commit message

  • JetBrains models: Mellum

Code completion (for AI Enterprise, if opted to use a different AI provider)

Editor, AI Chat, Commit message

  • Anthropic models: Claude 4.5 Haiku, Claude 3.5 Haiku, Claude 4.5 Sonnet, Claude 3.5 Sonnet

  • Google models: Gemini 2.5 Flash, Gemini 2.0 Flash

  • OpenAI models: GPT-5 mini, GPT-4o, GPT-4o mini

Fallback models

For features that support fallback, this list is compared with the models available to you. If no matching model is found, the feature is unavailable.

The following models are defined as fallback models:

  • Anthropic models: Claude 4.5 Sonnet, Claude 4 Sonnet, Claude 3.7 Sonnet, Claude 3.5 Sonnet, Claude 4.5 Haiku, Claude 3.5 Haiku

  • Google models: Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.0 Flash

  • OpenAI models: GPT-4o, GPT-4o mini

Use a custom model for AI completion

AI completion features, such as inline code completion and next edit suggestions, use JetBrains models by default. You can replace them with a model served through an OpenAI-compatible endpoint.

You configure this provider separately. It does not reuse or change the third-party AI provider that you use for AI Chat and other features.

The model needs to be built for code completion. General-purpose chat models are usually not suitable. The available features depend on the type of model:

Model type

Available features

Code completion model

Inline code completion

Next edit prediction model

Inline code completion, next edit suggestions

A code completion model supports Fill-in-the-Middle (FIM), so it can take into account the code after the caret. A next edit prediction model supports FIM and also predicts edits to existing code, not only insertions.

To configure a model for AI completion:

  1. Navigate to Settings | Tools | AI Assistant | Providers & API keys.

  2. In the AI Completion section, select OpenAI Compatible as the Provider. To return to the default models, select JetBrains.

  3. Specify the provider parameters:

    Configure the third-party provider for AI completion features
    • API key – the API key for the endpoint.

    • Base URL – the URL of the endpoint. Click Test Connection to check that AI Assistant can reach the endpoint with this API key.

    • Model – the model to use for AI completion. The endpoint specified in Base URL needs to serve this model. Test Connection does not check this. AI Assistant shows whether it recognizes the model and supports it for AI completion.

    • Model context – the size of the model context window, in tokens.

    • Max output tokens – the maximum number of tokens the model can return in a single completion.

    • Prompt schema – the template that formats completion requests in the structure that the model expects. If AI Assistant recognizes the model, it selects the matching schema automatically.

  4. Click Apply to save changes.

Enable JetBrains AI alongside custom models

Some features may be unavailable with models from third-party AI providers. To ensure that all features are available and work as expected, you can activate a JetBrains AI service subscription.

To enable your JetBrains AI subscription:

  1. Navigate to Settings | Tools | AI Assistant | Providers & API keys.

  2. In the JetBrains AI section, click Activate JetBrains AI.

    Click Activate JetBrains AI
  3. Click Log in to JetBrains Account, enter your credentials, and wait for the login process to complete.

After you log in to a JetBrains Account that has an active JetBrains AI subscription, you can start using AI Assistant with full functionality.

13 October 2026