github / github/copilot-cli

Support model discovery and in-session switching for BYOM providers

Đang mở
#4,376 0 bình luận 5 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:configuration area:models
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

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).

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Issue nêu các điểm đầu vào cấu hình COPILOT_MODEL, COPILOT_PROVIDER_BASE_URL và COPILOT_PROVIDER_API_KEY cùng lệnh copilot; hãy bắt đầu bằng việc lần theo cách các giá trị đó được đưa vào bộ chọn model và phiên hiện tại. Công việc được xem là hoàn tất khi bộ chọn có thể hiển thị các model Vertex AI/BYOM đã được cấp quyền, chuyển đổi giữa chúng mà không cần khởi động lại, giữ nguyên các thiết lập endpoint và xác thực, đồng thời làm mới các token gcloud/ADC có thời hạn ngắn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
google-cloud, powershell
Lĩnh vực
api, cli, cloud
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.