[AI GATEWAY] Rename openai-header-router policy to llm-header-router in multi provider routing#2633
Open
Aakashwije wants to merge 1 commit into
Open
Conversation
Aakashwije
requested review from
AnuGayan,
Arshardh,
CrowleyRajapakse,
HeshanSudarshana,
HiranyaKavishani,
Krishanx92,
PasanT9,
RakhithaRR,
Tharsanan1,
Thushani-Jayasekera,
VirajSalaka,
ashera96,
chamilaadhi,
dushaniw,
hisanhunais,
lasanthaS,
malinthaprasan,
pubudu538,
renuka-fernando,
senthuran16,
tgtshanika,
tharikaGitHub,
tharindu1st and
thivindu
as code owners
July 13, 2026 12:34
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Purpose
The header-based provider-selection policy added for LLM multi-provider routing in #2586 was named
openai-header-router. That name is misleading: the policy is not OpenAI-specific — it selects among any configured LLM provider (Anthropic, Azure OpenAI, Mistral, Gemini, AWS Bedrock, …) based on a request header, writing the choice intometadata["selected_provider"]. Theopenai-prefix implies an OpenAI-only scope and confuses users wiring up non-OpenAI backends.This PR renames the policy references to the provider-agnostic
llm-header-router, as a follow-up cleanup to the multi-provider routing introduced in #2586.Relates to #2586.
Goals
openai-header-router→llm-header-routerso they match the renamed policy.Approach
Pure string rename across the only two files in this repo that reference the policy by name (confirmed with a full-clone grep):
gateway/examples/openai-multi-provider-proxy.yamlpolicies[].name→llm-header-routergateway/gateway-controller/pkg/utils/llm_transformer_multiprovider_test.goName→llm-header-routerNo transformer/controller logic is touched. The router policy name is a free-form string in the proxy config, and
LLMProviderTransformer.Transformpasses user policy names through as-is (it does not validate them against a catalog), so this is a safe reference update. The actual policy rename — directory, Go package,PolicyNameconstant,policy-definition.yaml, andgo.modmodule path — lands in thewso2/gateway-controllerspolicy repository (companion change). Both must merge together, otherwise the example/test reference a policy name the gateway build does not yet contain.User stories
llm-header-router) reflects that it routes among any provider — not just OpenAI — removing confusion when setting up Anthropic / Gemini / Bedrock / Mistral / Azure OpenAI backends.Documentation
N/A — no committed product documentation references the policy name; the multi-provider proxy example (
gateway/examples/openai-multi-provider-proxy.yaml) doubles as the sample and is updated in this PR.Automation tests
TestLLMProviderTransformer_TransformProxy_AdditionalProviderAuthIsConditionaluses the policy name in its fixture; updated tollm-header-routerand passing. Sibling...TransformerIsConditionalalso green.gofmtclean.Security checks
Samples
gateway/examples/openai-multi-provider-proxy.yaml— the multi-provider proxy sample now attaches the router asllm-header-router. Applied viaap gateway apply -f gateway/examples/openai-multi-provider-proxy.yaml(orPOST /llm-proxieson the gateway-controller) once the renamed policy is present in the gateway build.Related PRs
openai-header-routerpolicy this renames).wso2/gateway-controllers(the actualllm-header-routerpolicy source) — add link — must merge in lockstep with this PR.Test environment
go test ./pkg/utils/ -run TestLLMProviderTransformer_TransformProxy_AdditionalProvider→ PASS