github / github/copilot-cli

Support model discovery and in-session switching for BYOM providers

未关闭
#4,376 0 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:configuration area:models
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the feature or problem you'd like to solve

Copilot CLI's BYOM configuration currently requires a single COPILOT_MODEL value. When using Google Vertex AI through its OpenAI-compatible endpoint and gcloud authentication, users must restart Copilot CLI to change models.

This is a gap in the model-selection experience: a Copilot subscription exposes multiple GitHub-hosted models through the model picker, but BYOM is effectively one provider/model per process. A subscription-based model experience should support many available models behind one provider configuration (many-to-one), rather than requiring a separate CLI process for each model (one-to-one).

Think BYOMS (Bring your own model subscription) instead of a single BYOM.

Proposed solution

Support model discovery and model selection for BYOM providers, including Vertex AI:

  • Discover models exposed by the configured provider, or allow a provider-specific model catalog/configuration.
  • Show available BYOM models in the same model picker used for GitHub-hosted models.
  • Allow switching models during a Copilot CLI session without restarting the CLI.
  • Preserve provider-level authentication and endpoint settings while changing only the selected model.
  • Support short-lived Google OAuth access tokens from gcloud/ADC without requiring users to manually restart the CLI when a token refresh is needed.

For Vertex AI, this should work with the OpenAI-compatible endpoint and Google Cloud authentication, while respecting the models enabled and authorized for the user's project and region.

Example prompts or workflows
copilot
# Model picker shows GitHub models plus authorized Vertex AI models.
# Selecting a different model changes the active BYOM model in the current session.
Additional context

Current workaround:

$env:COPILOT_PROVIDER_BASE_URL = "https://LOCATION-aiplatform.googleapis.com/v1/projects/PROJECT/locations/LOCATION/endpoints/openapi"
$env:COPILOT_PROVIDER_API_KEY = gcloud auth print-access-token
$env:COPILOT_MODEL = "google/gemini-2.5-flash"
copilot

Changing COPILOT_MODEL requires restarting Copilot CLI. Related issue: #3399 (custom headers for BYOK).

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

该 issue 列出了配置入口 COPILOT_MODEL、COPILOT_PROVIDER_BASE_URL 和 COPILOT_PROVIDER_API_KEY,以及 copilot 命令;首先追踪这些值如何传入当前的模型选择器和会话。完成标准是:选择器可以显示已授权的 Vertex AI/BYOM 模型,在不重启的情况下切换模型,保留 endpoint 和身份验证设置,并刷新短生命周期的 gcloud/ADC token。

由索引模型根据 Issue 内容生成。

评估

技术栈
google-cloud, powershell
领域
api, cli, cloud
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。