Skip to main content
Skip to content

Changing the AI model for GitHub Copilot Chat

Learn how to switch between models for Copilot Chat.

Choose from a selection of models, each with its own particular strengths. You may have a favorite model that you like to use, or you might prefer to use a particular model for inquiring about a specific subject.

To view the available models per client, see GitHub Copilot中支持的 AI 模型.

注意

The models available to you depend on your Copilot plan and where you're using Copilot, such as GitHub.com or an IDE. Different models consume AI credits at different rates based on their token pricing. For details, see GitHub Copilot 的模型和定价.

Copilot allows you to change the model during a chat and have the alternative model used to generate responses to your prompts.

如果你是通过Copilot ChatCopilot Business或Copilot Enterprise订阅访问,则你的组织或企业必须允许成员切换到其他模型。 请参阅 管理组织中GitHub Copilot的策略和功能 或 管理企业中 GitHub Copilot 的策略和功能。

Changing the model used by Copilot Chat does not affect the model used for Copilot inline suggestions. See Changing the AI model for GitHub Copilot inline suggestions.

Changing the AI model

These instructions are for Visual Studio Code. For instructions on different clients, click the appropriate tab at the top of this page.

注意

  • 如果使用 Copilot Extensions,它们可能会替代所选的模型。
  • 模型的实验性预发布版本可能无法与所有筛选器正确交互,包括用于阻止匹配公共代码建议的设置(请参阅“以个人订阅者身份管理 GitHub Copilot 策略”)。
  1. 单击标题栏中的Copilot Chat聊天图标打开Visual Studio Code。
  2. At the bottom of the chat view, select the CURRENT-MODEL dropdown menu, then click the AI model of your choice.

注意

如果选择“ 自动”, Copilot auto model selection 将基于可用性选择最佳模型,并帮助降低速率限制。 请参阅“关于 Copilotauto model selection”。

Adding more models

You can expand the model options that are available to power Copilot Chat. You can add models from:

  • A model provider—such as Anthropic, Gemini, OpenAI, and others.
  • The AI Toolkit for Visual Studio Code.

注意

Using the AI Toolkit for VS Code is in 公开预览 and subject to change.

Prerequisites

Adding models

  1. In the Copilot chat view, click the CURRENT-MODEL dropdown menu.

  2. Click Manage Models.

    Screenshot of the 'Manage Models' option, highlighted with a dark orange outline.

    A list of providers is displayed.

    If you have installed the AI Toolkit, then additional providers, added via the AI Toolkit, are also listed.

    Screenshot of the 'Manage Language Models' list.

  3. Click the provider whose model(s) you want to add.

  4. Depending on which provider you selected, you may be prompted to enter a GitHub PAT, an API key for the provider, or a model ID for a specific model.

    Enter the required information, then press Enter.

    A list of available models is displayed.

  5. Select the model(s) you want to add, then click OK.

The models you selected are now available in the model picker in the chat view.

If you added a model from a provider via the AI Toolkit then the first time you use the model, you will be prompted to download it. You may also be prompted to authenticate with the provider.

提示

If you're already using chat with auto model selection, you'll need to start a new chat session to switch models. To start a new session, in the top right of the chat view, click new chat.

Changing the AI model

These instructions are for Visual Studio. For instructions on different clients, click the appropriate tab at the top of this page.

To use multi-model Copilot Chat, you must use Visual Studio 2022 version 17.12 or later. See the Visual Studio downloads page.

注意

  • 如果使用 Copilot Extensions,它们可能会替代所选的模型。
  • 模型的实验性预发布版本可能无法与所有筛选器正确交互,包括用于阻止匹配公共代码建议的设置(请参阅“以个人订阅者身份管理 GitHub Copilot 策略”)。
  1. In the Visual Studio menu bar, click View, then click GitHub Copilot Chat.
  2. In the bottom right of the chat view, select the CURRENT-MODEL dropdown menu, then click the AI model of your choice.

注意

如果选择“ 自动”, Copilot auto model selection 将基于可用性选择最佳模型,并帮助降低速率限制。 请参阅“关于 Copilotauto model selection”。

Changing the AI model

These instructions are for the JetBrains IDEs. For instructions on different clients, click the appropriate tab at the top of this page.

注意

  • 如果使用 Copilot Extensions,它们可能会替代所选的模型。
  • 模型的实验性预发布版本可能无法与所有筛选器正确交互,包括用于阻止匹配公共代码建议的设置(请参阅“以个人订阅者身份管理 GitHub Copilot 策略”)。

For reasoning models that support configurable thinking effort, you can control how much reasoning the model applies to each request.

  1. Click the icon in the status bar.
  2. In the popup menu, click Open GitHub Copilot Chat.
  3. In the bottom right of the chat view, select an AI model of your choice from the CURRENT-MODEL dropdown menu.
  4. Optionally, hover over a reasoning model that supports configurable thinking effort.
    1. In the Thinking Effort submenu, select an effort level. Nonreasoning models do not display the Thinking Effort submenu.

注意

如果选择“ 自动”, Copilot auto model selection 将基于可用性选择最佳模型,并帮助降低速率限制。 请参阅“关于 Copilotauto model selection”。

提示

Model selection is also available when using Copilot through JetBrains AI Assistant. For more information, see 在 JetBrains IDE 中使用GitHub Copilot.

Changing the AI model

These instructions are for the Eclipse IDE. For instructions on different clients, click the appropriate tab at the top of this page.

注意

  • 如果使用 Copilot Extensions,它们可能会替代所选的模型。
  • 模型的实验性预发布版本可能无法与所有筛选器正确交互,包括用于阻止匹配公共代码建议的设置(请参阅“以个人订阅者身份管理 GitHub Copilot 策略”)。
  1. Click the icon in the status bar.
  2. In the popup menu, click Open Chat.
  3. In the bottom right of the chat panel, click the currently selected AI model, then select an alternative model from the popup menu.

注意

如果选择“ 自动”, Copilot auto model selection 将基于可用性选择最佳模型,并帮助降低速率限制。 请参阅“关于 Copilotauto model selection”。

Changing the AI model

These instructions are for Xcode. For instructions on different clients, click the appropriate tab at the top of this page.

To use multi-model Copilot Chat, you must install the GitHub Copilot for Xcode extension. See Installing the GitHub Copilot extension in your environment.

注意

  • 如果使用 Copilot Extensions,它们可能会替代所选的模型。
  • 模型的实验性预发布版本可能无法与所有筛选器正确交互,包括用于阻止匹配公共代码建议的设置(请参阅“以个人订阅者身份管理 GitHub Copilot 策略”)。
  1. To open the chat view, click Editor in the menu bar, then click Copilot then Open Chat. Copilot Chat opens in a new window.
  2. In the bottom right of the chat view, select the CURRENT-MODEL dropdown menu, then click the AI model of your choice.

注意

如果选择“ 自动”, Copilot auto model selection 将基于可用性选择最佳模型,并帮助降低速率限制。 请参阅“关于 Copilotauto model selection”。

Further reading