Add support for custom model providers for Copilot#48
Open
kaespi wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new configuration path to run this Azure DevOps pipeline task with GitHub Copilot CLI backed by a custom model provider (instead of GitHub-hosted models), by introducing new task inputs, validation, and environment variables.
Changes:
- Add
useCustomModelProviderand provider configuration inputs (base URL, provider type, API key) to both prod/dev task definitions. - Add TypeScript input validation and export
COPILOT_PROVIDER_*environment variables when custom provider mode is enabled. - Document the new inputs in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| README.md | Documents the new custom model provider inputs for the pipeline task. |
| CopilotCodeReviewV1/task.json | Adds new task inputs and updates visibility rules to support custom model providers. |
| CopilotCodeReviewV1/index.ts | Validates custom-provider inputs and sets env vars consumed by Copilot CLI execution. |
| CopilotCodeReviewDevV1/task.json | Mirrors the new inputs and visibility rules for the dev task. |
| "name": "copilotProviderApiKey", | ||
| "type": "string", | ||
| "label": "API Key for the model provider", | ||
| "required": false, |
Comment on lines
+201
to
+205
| "required": false, | ||
| "defaultValue": "", | ||
| "helpMarkDown": "Required when using custom model provider in Copilot. Specifies the base URL of the custom model provider's API endpoint.", | ||
| "visibleRule": "useCustomModelProvider == true" | ||
| }, |
| "name": "copilotProviderApiKey", | ||
| "type": "string", | ||
| "label": "API Key for the model provider", | ||
| "required": false, |
Comment on lines
+201
to
+205
| "required": false, | ||
| "defaultValue": "", | ||
| "helpMarkDown": "Required when using custom model provider in Copilot. Specifies the base URL of the custom model provider's API endpoint.", | ||
| "visibleRule": "useCustomModelProvider == true" | ||
| }, |
Comment on lines
90
to
+98
| @@ -90,7 +94,25 @@ async function run(): Promise<void> { | |||
| 'Anthropic API Key is required when using Claude Code CLI. Please provide the anthropicApiKey input.'); | |||
| return; | |||
| } | |||
| } else if (useCustomModelProvider) { | |||
| // copilot CLI with custom model provider | |||
Comment on lines
+199
to
+201
| | `copilotProviderBaseUrl` | No | - | Base URL of custom model provider's API endpoint. Required when using custom model provider in Copilot (see [details](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli#using-your-own-model-provider)) | | ||
| | `copilotProviderType` | No | - | Custom model provider type. Required when using custom model provider in Copilot (see [details](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli#using-your-own-model-provider)) | | ||
| | `copilotProviderApiKey` | No | - | Custom model provider API key. Required when using custom model provider in Copilot (see [details](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/about-copilot-cli#using-your-own-model-provider)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.