Add extra headers support for custom LLM providers#739
Open
Duyi-Wang wants to merge 1 commit into
Open
Conversation
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
User description
背景
部分 OpenAI-compatible 的 custom LLM provider 需要通过自定义 HTTP headers 完成接入。现有配置只支持 Base URL、API Key 和 Model,无法覆盖这类 custom 接入需求,也会影响模型拉取、provider 校验和实际调用链路的一致性。
变更
验证
git diff --checknpm run build -- --mode developmentPR Type
Enhancement
Description
Add extra headers field for custom LLM providers
Validate header names and values (no CR/LF, valid tokens)
Allow API key empty when custom headers used
Persist extra headers in credentials vault
Diagram Walkthrough
File Walkthrough
6 files
Add extra headers credential handlingIntegrate extra headers into provider configPass extra headers to LLM provider buildAdd extra headers persistence and validationAdd with_extra_headers builder methodShow extra headers field for custom provider1 files
Add test for extra headers sending5 files
Add extra headers i18n stringsAdd extra headers i18n stringsAdd extra headers i18n stringsAdd extra headers i18n stringsAdd extra headers i18n strings