copilot: support 'extra_body' for BYOK (top_k, chat_template_kwargs, … - #329215
Open
gpotter2 wants to merge 1 commit into
Open
copilot: support 'extra_body' for BYOK (top_k, chat_template_kwargs, …#329215gpotter2 wants to merge 1 commit into
gpotter2 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds BYOK extraBody support for forwarding provider-specific request parameters to OpenAI-compatible endpoints.
Changes:
- Propagates
extraBodythrough BYOK model configuration and metadata. - Merges extra properties into all supported request-body formats.
- Expands request logging and adds metadata propagation coverage.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
extensions/copilot/src/platform/endpoint/common/endpointProvider.ts |
Adds endpoint metadata for extra body properties. |
extensions/copilot/src/extension/prompt/vscode-node/requestLoggerImpl.ts |
Logs additional request-body options. |
extensions/copilot/src/extension/byok/vscode-node/customOAIProvider.ts |
Propagates custom OpenAI configuration. |
extensions/copilot/src/extension/byok/vscode-node/customEndpointProvider.ts |
Propagates custom endpoint configuration. |
extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts |
Propagates Azure BYOK configuration. |
extensions/copilot/src/extension/byok/node/openAIEndpoint.ts |
Applies extra properties to outgoing bodies. |
extensions/copilot/src/extension/byok/common/test/byokProvider.spec.ts |
Tests metadata propagation. |
extensions/copilot/src/extension/byok/common/byokProvider.ts |
Adds shared BYOK capability propagation. |
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.
Many inference engines have extra 'custom' attributes that are out of the classic responses / chat-completions format. This is commonly referred to as 'extra_body', because that's how it was called in the OpenAI API.
top_k,guided_choice, etc. https://docs.vllm.ai/en/v0.8.3/serving/openai_compatible_server.htmlchat_template_kwargs, for instance when using GLM 5.2 on a custom endpoint: https://docs.sglang.io/cookbook/autoregressive/GLM/GLM-5.2#3-1-reasoningextra_body: https://api-docs.deepseek.com/guides/thinking_mode/This PR:
modelOptions, which currently has a hardcoded list of two allowed values. Arguably this could replace 'modelOptions', but for now I chose to keep this backwards compatible.Some examples:
This comes with a side PR with the doc :D microsoft/vscode-docs#10101
fixes #321372