Skip to content

Commit 0553786

Browse files
authored
ci: switch to another model for aws bedrock real provider tests in ci (#2389)
**Description** The AWS Bedrock e2e and data-plane tests were failing `because us.meta.llama3-2-1b-instruct-v1:0` reached end-of-life on Bedrock (404 ResourceNotFoundException). Switched the AWS Bedrock test model to the cheapest active option, Amazon Nova Micro (us.amazon.nova-micro-v1:0). Also centralized all real-provider model IDs so future model churn is a one-line fix. More details are on #2388 Signed-off-by: yxia216 <yxia216@bloomberg.net>
1 parent ea1c886 commit 0553786

9 files changed

Lines changed: 92 additions & 29 deletions

File tree

examples/basic/aws-irsa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ spec:
105105
- headers:
106106
- type: Exact
107107
name: x-ai-eg-model
108-
value: us.meta.llama3-2-1b-instruct-v1:0
108+
value: us.amazon.nova-micro-v1:0
109109
backendRefs:
110110
- name: envoy-ai-gateway-basic-aws
111111
---

examples/basic/aws-pod-identity.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ spec:
100100
- headers:
101101
- type: Exact
102102
name: x-ai-eg-model
103-
value: us.meta.llama3-2-1b-instruct-v1:0
103+
value: us.amazon.nova-micro-v1:0
104104
backendRefs:
105105
- name: envoy-ai-gateway-basic-aws
106106
---

examples/basic/aws.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
- headers:
1919
- type: Exact
2020
name: x-ai-eg-model
21-
value: us.meta.llama3-2-1b-instruct-v1:0
21+
value: us.amazon.nova-micro-v1:0
2222
backendRefs:
2323
- name: envoy-ai-gateway-basic-aws
2424
---

examples/provider_fallback/base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
- headers:
4343
- type: Exact
4444
name: x-ai-eg-model
45-
value: us.meta.llama3-2-1b-instruct-v1:0
45+
value: us.amazon.nova-micro-v1:0
4646
backendRefs:
4747
- name: provider-fallback-always-failing-upstream # This is the primary backend and trying to speak TLS, which always fails.
4848
priority: 0
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Copyright Envoy AI Gateway Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
// The full text of the Apache license is available in the LICENSE file at
4+
// the root of the repo.
5+
6+
package internaltesting
7+
8+
// Model IDs used by tests that exercise real provider backends.
9+
//
10+
// These are centralized here so that when a provider retires a model (which
11+
// surfaces as a 4xx/deprecation error from the real API), the swap is a
12+
// single-line change instead of hunting down duplicated string literals across
13+
// the test suite.
14+
//
15+
// Note: AWS Bedrock example manifests (e.g. examples/basic/aws.yaml,
16+
// examples/provider_fallback/base.yaml, tests/data-plane/envoy.yaml) route by
17+
// the exact model name and must be kept in sync manually, as they cannot
18+
// reference these Go constants.
19+
const (
20+
// Chat completion models (one per real provider).
21+
22+
// OpenAIModelName is the OpenAI chat completion model.
23+
OpenAIModelName = "gpt-4o-mini"
24+
// AWSBedrockModelName is the AWS Bedrock chat completion model.
25+
AWSBedrockModelName = "us.amazon.nova-micro-v1:0"
26+
// AzureOpenAIModelName is the Azure OpenAI chat completion model.
27+
AzureOpenAIModelName = "o1"
28+
// GeminiModelName is the Gemini chat completion model.
29+
GeminiModelName = "gemini-3.1-flash-lite"
30+
// GroqModelName is the Groq chat completion model.
31+
GroqModelName = "llama-3.1-8b-instant"
32+
// GrokModelName is the Grok (xAI) chat completion model.
33+
GrokModelName = "grok-3"
34+
// SambaNovaModelName is the SambaNova chat completion model.
35+
SambaNovaModelName = "Meta-Llama-3.1-8B-Instruct"
36+
// DeepInfraModelName is the DeepInfra chat completion model.
37+
DeepInfraModelName = "meta-llama/Meta-Llama-3-8B-Instruct"
38+
39+
// Embeddings models (one per real provider that supports embeddings).
40+
41+
// OpenAIEmbeddingsModelName is the OpenAI embeddings model.
42+
OpenAIEmbeddingsModelName = "text-embedding-3-small"
43+
// AWSBedrockEmbeddingsModelName is the AWS Bedrock embeddings model.
44+
AWSBedrockEmbeddingsModelName = "amazon.titan-embed-text-v2:0"
45+
// GeminiEmbeddingsModelName is the Gemini embeddings model.
46+
GeminiEmbeddingsModelName = "gemini-embedding-001"
47+
// SambaNovaEmbeddingsModelName is the SambaNova embeddings model.
48+
SambaNovaEmbeddingsModelName = "E5-Mistral-7B-Instruct"
49+
// DeepInfraEmbeddingsModelName is the DeepInfra embeddings model.
50+
DeepInfraEmbeddingsModelName = "BAAI/bge-base-en-v1.5"
51+
52+
// Anthropic Messages API models.
53+
54+
// AnthropicModelName is the direct Anthropic API model.
55+
AnthropicModelName = "claude-sonnet-4-5"
56+
// AWSBedrockAnthropicGlobalModelName is the Claude model served by AWS
57+
// Bedrock via the global cross-region inference profile.
58+
AWSBedrockAnthropicGlobalModelName = "global.anthropic.claude-sonnet-4-5-20250929-v1:0"
59+
// AWSBedrockAnthropicUSModelName is the Claude model served by AWS Bedrock
60+
// via the US cross-region inference profile.
61+
AWSBedrockAnthropicUSModelName = "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
62+
)

tests/data-plane/envoy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static_resources:
5858
headers:
5959
- name: x-ai-eg-model
6060
string_match:
61-
exact: us.meta.llama3-2-1b-instruct-v1:0
61+
exact: us.amazon.nova-micro-v1:0
6262
route:
6363
auto_host_rewrite: true
6464
cluster: aws_bedrock

tests/data-plane/real_providers_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ func TestWithRealProviders(t *testing.T) {
103103
t.Run("health-checking", func(t *testing.T) {
104104
t.Run("chat/completions", func(t *testing.T) {
105105
for _, tc := range []realProvidersTestCase{
106-
{name: "openai", modelName: "gpt-4o-mini", required: internaltesting.RequiredCredentialOpenAI},
107-
{name: "aws-bedrock", modelName: "us.meta.llama3-2-1b-instruct-v1:0", required: internaltesting.RequiredCredentialAWS},
108-
{name: "azure-openai", modelName: "o1", required: internaltesting.RequiredCredentialAzure},
109-
{name: "gemini", modelName: "gemini-3.1-flash-lite", required: internaltesting.RequiredCredentialGemini},
110-
{name: "groq", modelName: "llama-3.1-8b-instant", required: internaltesting.RequiredCredentialGroq},
111-
{name: "grok", modelName: "grok-3", required: internaltesting.RequiredCredentialGrok},
112-
{name: "sambanova", modelName: "Meta-Llama-3.1-8B-Instruct", required: internaltesting.RequiredCredentialSambaNova},
113-
{name: "deepinfra", modelName: "meta-llama/Meta-Llama-3-8B-Instruct", required: internaltesting.RequiredCredentialDeepInfra},
106+
{name: "openai", modelName: internaltesting.OpenAIModelName, required: internaltesting.RequiredCredentialOpenAI},
107+
{name: "aws-bedrock", modelName: internaltesting.AWSBedrockModelName, required: internaltesting.RequiredCredentialAWS},
108+
{name: "azure-openai", modelName: internaltesting.AzureOpenAIModelName, required: internaltesting.RequiredCredentialAzure},
109+
{name: "gemini", modelName: internaltesting.GeminiModelName, required: internaltesting.RequiredCredentialGemini},
110+
{name: "groq", modelName: internaltesting.GroqModelName, required: internaltesting.RequiredCredentialGroq},
111+
{name: "grok", modelName: internaltesting.GrokModelName, required: internaltesting.RequiredCredentialGrok},
112+
{name: "sambanova", modelName: internaltesting.SambaNovaModelName, required: internaltesting.RequiredCredentialSambaNova},
113+
{name: "deepinfra", modelName: internaltesting.DeepInfraModelName, required: internaltesting.RequiredCredentialDeepInfra},
114114
} {
115115
t.Run(tc.name, func(t *testing.T) {
116116
cc.MaybeSkip(t, tc.required)
@@ -120,11 +120,11 @@ func TestWithRealProviders(t *testing.T) {
120120
})
121121
t.Run("embeddings", func(t *testing.T) {
122122
for _, tc := range []realProvidersTestCase{
123-
{name: "openai", modelName: "text-embedding-3-small", required: internaltesting.RequiredCredentialOpenAI},
124-
{name: "aws-bedrock", modelName: "amazon.titan-embed-text-v2:0", required: internaltesting.RequiredCredentialAWS},
125-
{name: "gemini", modelName: "gemini-embedding-001", required: internaltesting.RequiredCredentialGemini},
126-
{name: "sambanova", modelName: "E5-Mistral-7B-Instruct", required: internaltesting.RequiredCredentialSambaNova},
127-
{name: "deepinfra", modelName: "BAAI/bge-base-en-v1.5", required: internaltesting.RequiredCredentialDeepInfra},
123+
{name: "openai", modelName: internaltesting.OpenAIEmbeddingsModelName, required: internaltesting.RequiredCredentialOpenAI},
124+
{name: "aws-bedrock", modelName: internaltesting.AWSBedrockEmbeddingsModelName, required: internaltesting.RequiredCredentialAWS},
125+
{name: "gemini", modelName: internaltesting.GeminiEmbeddingsModelName, required: internaltesting.RequiredCredentialGemini},
126+
{name: "sambanova", modelName: internaltesting.SambaNovaEmbeddingsModelName, required: internaltesting.RequiredCredentialSambaNova},
127+
{name: "deepinfra", modelName: internaltesting.DeepInfraEmbeddingsModelName, required: internaltesting.RequiredCredentialDeepInfra},
128128
} {
129129
t.Run(tc.name, func(t *testing.T) {
130130
cc.MaybeSkip(t, tc.required)
@@ -134,8 +134,8 @@ func TestWithRealProviders(t *testing.T) {
134134
})
135135
t.Run("messages", func(t *testing.T) {
136136
for _, tc := range []realProvidersTestCase{
137-
{name: "anthropic", modelName: "claude-sonnet-4-5", required: internaltesting.RequiredCredentialAnthropic},
138-
{name: "anthropic-aws-bedrock", modelName: "global.anthropic.claude-sonnet-4-5-20250929-v1:0", required: internaltesting.RequiredCredentialAWS},
137+
{name: "anthropic", modelName: internaltesting.AnthropicModelName, required: internaltesting.RequiredCredentialAnthropic},
138+
{name: "anthropic-aws-bedrock", modelName: internaltesting.AWSBedrockAnthropicGlobalModelName, required: internaltesting.RequiredCredentialAWS},
139139
} {
140140
t.Run(tc.name, func(t *testing.T) {
141141
cc.MaybeSkip(t, tc.required)
@@ -189,8 +189,8 @@ func TestWithRealProviders(t *testing.T) {
189189
t.Run("streaming", func(t *testing.T) {
190190
client := openai.NewClient(option.WithBaseURL(listenerAddress + "/v1/"))
191191
for _, tc := range []realProvidersTestCase{
192-
{name: "openai", modelName: "gpt-4o-mini", required: internaltesting.RequiredCredentialOpenAI},
193-
{name: "aws-bedrock", modelName: "us.meta.llama3-2-1b-instruct-v1:0", required: internaltesting.RequiredCredentialAWS},
192+
{name: "openai", modelName: internaltesting.OpenAIModelName, required: internaltesting.RequiredCredentialOpenAI},
193+
{name: "aws-bedrock", modelName: internaltesting.AWSBedrockModelName, required: internaltesting.RequiredCredentialAWS},
194194
} {
195195
t.Run(tc.name, func(t *testing.T) {
196196
cc.MaybeSkip(t, tc.required)
@@ -240,9 +240,9 @@ func TestWithRealProviders(t *testing.T) {
240240
t.Run("uses tool in response", func(t *testing.T) {
241241
client := openai.NewClient(option.WithBaseURL(listenerAddress+"/v1/"), option.WithMaxRetries(0))
242242
for _, tc := range []realProvidersTestCase{
243-
{name: "openai", modelName: "gpt-4o-mini", required: internaltesting.RequiredCredentialOpenAI},
244-
{name: "aws-bedrock", modelName: "us.anthropic.claude-sonnet-4-5-20250929-v1:0", required: internaltesting.RequiredCredentialAWS},
245-
{name: "gemini", modelName: "gemini-3.1-flash-lite", required: internaltesting.RequiredCredentialGemini},
243+
{name: "openai", modelName: internaltesting.OpenAIModelName, required: internaltesting.RequiredCredentialOpenAI},
244+
{name: "aws-bedrock", modelName: internaltesting.AWSBedrockAnthropicUSModelName, required: internaltesting.RequiredCredentialAWS},
245+
{name: "gemini", modelName: internaltesting.GeminiModelName, required: internaltesting.RequiredCredentialGemini},
246246
} {
247247
t.Run(tc.modelName, func(t *testing.T) {
248248
cc.MaybeSkip(t, tc.required)

tests/e2e/basic_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func Test_Examples_Basic(t *testing.T) {
7575

7676
for _, tc := range []examplesBasicChatCompletionsTestCase{
7777
{name: "openai", modelName: "gpt-4o-mini", skip: !cc.OpenAIValid},
78-
{name: "aws", modelName: "us.meta.llama3-2-1b-instruct-v1:0", skip: !cc.AWSValid},
78+
{name: "aws", modelName: internaltesting.AWSBedrockModelName, skip: !cc.AWSValid},
7979
} {
8080
tc.run(t, egSelector)
8181
}
@@ -166,7 +166,7 @@ func Test_Examples_Basic(t *testing.T) {
166166
})
167167

168168
// Test Anthropic Messages API (/v1/messages) translated to AWS Bedrock Converse API.
169-
// This reuses the existing AWSBedrock route for us.meta.llama3-2-1b-instruct-v1:0 from aws.yaml.
169+
// This reuses the existing AWSBedrock route for us.amazon.nova-micro-v1:0 from aws.yaml.
170170
t.Run("aws_bedrock_anthropic_messages", func(t *testing.T) {
171171
cc.MaybeSkip(t, internaltesting.RequiredCredentialAWS)
172172
internaltesting.RequireEventuallyNoError(t, func() error {
@@ -182,7 +182,7 @@ func Test_Examples_Basic(t *testing.T) {
182182
)
183183

184184
msg, err := client.Messages.New(ctx, anthropic.MessageNewParams{
185-
Model: "us.meta.llama3-2-1b-instruct-v1:0",
185+
Model: internaltesting.AWSBedrockModelName,
186186
MaxTokens: 256,
187187
Messages: []anthropic.MessageParam{
188188
anthropic.NewUserMessage(anthropic.NewTextBlock("Say this is a test.")),

tests/e2e/provider_fallback_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818

1919
"github.com/stretchr/testify/require"
2020

21+
internaltesting "github.com/envoyproxy/ai-gateway/internal/testing"
2122
"github.com/envoyproxy/ai-gateway/tests/internal/e2elib"
2223
)
2324

@@ -50,7 +51,7 @@ func Test_Examples_ProviderFallback(t *testing.T) {
5051
_ = e2elib.KubectlDeleteManifest(context.Background(), fallbackManifest)
5152
})
5253

53-
const body = `{"model": "us.meta.llama3-2-1b-instruct-v1:0","messages": [{"role": "user", "content": "Say this is a test!"}],"temperature": 0.7}`
54+
body := `{"model": "` + internaltesting.AWSBedrockModelName + `","messages": [{"role": "user", "content": "Say this is a test!"}],"temperature": 0.7}`
5455

5556
// At this point, we haven't configured the fallback for the HTTPRoute generated by the AI Gateway.
5657
// So, no matter how many times we try, we should always get a 503 error.

0 commit comments

Comments
 (0)