Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gateway/examples/openai-multi-provider-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
#
# * Multi-provider mode — put openai-header-router first. It writes
# the chosen provider into metadata["selected_provider"]. Each
# translator then runs only when that selection equals its own "id".
# The "id" doubles as the upstream cluster name, so it must match an
# entry in additionalProviders (id or as).
# translator then runs only when that selection equals its own
# "providerId". The "providerId" doubles as the upstream cluster
# name, so it must match an entry in additionalProviders (id or as).
#
# --------------------------------------------------------------------

Expand Down
8 changes: 4 additions & 4 deletions gateway/gateway-controller/pkg/utils/llm_transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,9 @@ func (t *LLMProviderTransformer) proxyUpstreamAuthPolicy(auth *api.LLMUpstreamAu
}

// proxyTransformerPolicy builds a translator policy for an additional provider's
// inline transformer. The provider's upstream name is passed to the translator as
// its "id" param so it targets the correct upstream, and gates execution so the
// translator runs only when this provider is the selected upstream.
// inline transformer. The provider's upstream name is passed to the translator
// as its "providerId" param so it targets the correct upstream, and gates
// execution so the translator runs only when this provider is selected.
func (t *LLMProviderTransformer) proxyTransformerPolicy(transformer *api.LLMProxyTransformer, name, field string) (*api.Policy, error) {
if transformer == nil {
return nil, nil
Expand All @@ -818,7 +818,7 @@ func (t *LLMProviderTransformer) proxyTransformerPolicy(transformer *api.LLMProx
params[k] = v
}
}
params["id"] = name
params["providerId"] = name

condition := selectedProviderExecutionCondition(name, false)
return &api.Policy{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func TestLLMProviderTransformer_TransformProxy_AdditionalProviderTransformerIsCo
require.NotNil(t, transformerPolicy.ExecutionCondition)
assert.Contains(t, *transformerPolicy.ExecutionCondition, "anthropic-provider")
require.NotNil(t, transformerPolicy.Params)
assert.Equal(t, "anthropic-provider", (*transformerPolicy.Params)["id"])
assert.Equal(t, "anthropic-provider", (*transformerPolicy.Params)["providerId"])
assert.Equal(t, "claude-sonnet-4-5-20250929", (*transformerPolicy.Params)["model"])
}

Expand Down
Loading