Skip to content

[AI GATEWAY] Rename openai-header-router policy to llm-header-router in multi provider routing#2633

Open
Aakashwije wants to merge 1 commit into
wso2:multi-provider-routingfrom
Aakashwije:rename-llm-header-router
Open

[AI GATEWAY] Rename openai-header-router policy to llm-header-router in multi provider routing#2633
Aakashwije wants to merge 1 commit into
wso2:multi-provider-routingfrom
Aakashwije:rename-llm-header-router

Conversation

@Aakashwije

Copy link
Copy Markdown
Contributor

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 into metadata["selected_provider"]. The openai- 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

  • Rename the api-platform references openai-header-routerllm-header-router so they match the renamed policy.
  • Keep the change surgical and reference-only — no behavioural change.

Approach

Pure string rename across the only two files in this repo that reference the policy by name (confirmed with a full-clone grep):

File Change
gateway/examples/openai-multi-provider-proxy.yaml doc comment + policies[].namellm-header-router
gateway/gateway-controller/pkg/utils/llm_transformer_multiprovider_test.go test fixture Namellm-header-router

No transformer/controller logic is touched. The router policy name is a free-form string in the proxy config, and LLMProviderTransformer.Transform passes 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, PolicyName constant, policy-definition.yaml, and go.mod module path — lands in the wso2/gateway-controllers policy repository (companion change). Both must merge together, otherwise the example/test reference a policy name the gateway build does not yet contain.

User stories

  • As an operator configuring an LLM proxy that fans out to multiple providers, the routing policy name (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

  • Unit tests
    • TestLLMProviderTransformer_TransformProxy_AdditionalProviderAuthIsConditional uses the policy name in its fixture; updated to llm-header-router and passing. Sibling ...TransformerIsConditional also green.
    • No coverage delta — the change is reference-only, not new logic. gofmt clean.
  • Integration tests
    • N/A — no integration/BDD test references this policy name; runtime behaviour is unchanged.

Security checks

  • Followed secure coding standards (WSO2 secure engineering guidelines)? yes — reference-only rename; no logic or security surface changed.
  • Ran FindSecurityBugs plugin and verified report? N/A — no Java / security-relevant code changed (Go + YAML string rename only).
  • Confirmed this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes — verified; the diff is a 3-line string rename across 2 files.

Samples

gateway/examples/openai-multi-provider-proxy.yaml — the multi-provider proxy sample now attaches the router as llm-header-router. Applied via ap gateway apply -f gateway/examples/openai-multi-provider-proxy.yaml (or POST /llm-proxies on the gateway-controller) once the renamed policy is present in the gateway build.

Related PRs

Test environment

  • Go 1.26.x
  • macOS (darwin) / Linux
  • JDK / Database / Browser: N/A (no Java, DB, or UI changes)
  • Verified: go test ./pkg/utils/ -run TestLLMProviderTransformer_TransformProxy_AdditionalProvider → PASS

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 15a1216b-d5f8-46a2-a920-7fc0c9a061ef

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant