Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(pass-through): move Gemini pass-through tests to gemini-3.1-flash-lite (#29595)

Mateo Wangf3e2167730a9
diff --git a/tests/pass_through_tests/test_gemini_with_spend.test.js b/tests/pass_through_tests/test_gemini_with_spend.test.js
index 989bbc4b8e3..b9a25d3a3ed 100644
--- a/tests/pass_through_tests/test_gemini_with_spend.test.js
+++ b/tests/pass_through_tests/test_gemini_with_spend.test.js
@@ -32,7 +32,7 @@ describe('Gemini AI Tests', () => {
};
const model = genAI.getGenerativeModel({
- model: 'gemini-2.5-flash-lite'
+ model: 'gemini-3.1-flash-lite'
}, requestOptions);
const prompt = 'Say "hello test" and nothing else';
@@ -83,7 +83,7 @@ describe('Gemini AI Tests', () => {
};
const model = genAI.getGenerativeModel({
- model: 'gemini-2.5-flash-lite'
+ model: 'gemini-3.1-flash-lite'
}, requestOptions);
const prompt = 'Say "hello test" and nothing else';
diff --git a/tests/pass_through_tests/test_local_gemini.js b/tests/pass_through_tests/test_local_gemini.js
index 0a72ca5cd7b..dc033a51f18 100644
--- a/tests/pass_through_tests/test_local_gemini.js
+++ b/tests/pass_through_tests/test_local_gemini.js
@@ -1,13 +1,13 @@
const { GoogleGenerativeAI, ModelParams, RequestOptions } = require("@google/generative-ai");
const modelParams = {
- model: 'gemini-2.5-flash-lite',
+ model: 'gemini-3.1-flash-lite',
};
const requestOptions = {
baseUrl: 'http://127.0.0.1:4000/gemini',
customHeaders: {
- "tags": "gemini-js-sdk,gemini-2.5-flash-lite"
+ "tags": "gemini-js-sdk,gemini-3.1-flash-lite"
}
};
diff --git a/tests/pass_through_tests/test_local_vertex.js b/tests/pass_through_tests/test_local_vertex.js
index 149635e2d6f..7cfe31db95b 100644
--- a/tests/pass_through_tests/test_local_vertex.js
+++ b/tests/pass_through_tests/test_local_vertex.js
@@ -4,7 +4,7 @@ const { VertexAI, RequestOptions } = require('@google-cloud/vertexai');
const vertexAI = new VertexAI({
project: 'litellm-ci-cd',
- location: 'us-central1',
+ location: 'global',
apiEndpoint: "127.0.0.1:4000/vertex-ai"
});
@@ -20,7 +20,7 @@ const requestOptions = {
};
const generativeModel = vertexAI.getGenerativeModel(
- { model: 'gemini-2.5-flash-lite' },
+ { model: 'gemini-3.1-flash-lite' },
requestOptions
);
diff --git a/tests/pass_through_tests/test_vertex.test.js b/tests/pass_through_tests/test_vertex.test.js
index 7b5edf6acd7..e0e879c2897 100644
--- a/tests/pass_through_tests/test_vertex.test.js
+++ b/tests/pass_through_tests/test_vertex.test.js
@@ -56,6 +56,9 @@ beforeAll(() => {
loadVertexAiCredentials();
});
+// Configure Jest to retry flaky tests up to 3 times (useful for 429 rate limiting)
+jest.retryTimes(3);
+
// Non-streaming Vertex generateContent can exceed 5s in CI / under load
const VERTEX_TEST_TIMEOUT_MS = 30000;
@@ -65,7 +68,7 @@ describe('Vertex AI Tests', () => {
async () => {
const vertexAI = new VertexAI({
project: 'litellm-ci-cd',
- location: 'us-central1',
+ location: 'global',
apiEndpoint: "localhost:4000/vertex-ai"
});
@@ -78,7 +81,7 @@ describe('Vertex AI Tests', () => {
};
const generativeModel = vertexAI.getGenerativeModel(
- { model: 'gemini-2.5-flash-lite' },
+ { model: 'gemini-3.1-flash-lite' },
requestOptions
);
@@ -108,13 +111,13 @@ describe('Vertex AI Tests', () => {
async () => {
const vertexAI = new VertexAI({
project: 'litellm-ci-cd',
- location: 'us-central1',
+ location: 'global',
apiEndpoint: "localhost:4000/vertex-ai"
});
const customHeaders = new Headers({"x-litellm-api-key": "sk-1234"});
const requestOptions = {customHeaders: customHeaders};
const generativeModel = vertexAI.getGenerativeModel(
- {model: 'gemini-2.5-flash-lite'},
+ {model: 'gemini-3.1-flash-lite'},
requestOptions
);
const request = {contents: [{role: 'user', parts: [{text: 'What is 2+2?'}]}]};
diff --git a/tests/pass_through_tests/test_vertex_ai.py b/tests/pass_through_tests/test_vertex_ai.py
index 73bf03c5000..bf1200489aa 100644
--- a/tests/pass_through_tests/test_vertex_ai.py
+++ b/tests/pass_through_tests/test_vertex_ai.py
@@ -103,12 +103,12 @@ async def test_basic_vertex_ai_pass_through_with_spendlog():
vertexai.init(
project="litellm-ci-cd",
- location="us-central1",
+ location="global",
api_endpoint=f"{LITE_LLM_ENDPOINT}/vertex_ai",
api_transport="rest",
)
- model = GenerativeModel(model_name="gemini-2.5-flash-lite")
+ model = GenerativeModel(model_name="gemini-3.1-flash-lite")
response = model.generate_content("hi")
print("response", response)
@@ -143,12 +143,12 @@ async def test_basic_vertex_ai_pass_through_streaming_with_spendlog():
vertexai.init(
project="litellm-ci-cd",
- location="us-central1",
+ location="global",
api_endpoint=f"{LITE_LLM_ENDPOINT}/vertex_ai",
api_transport="rest",
)
- model = GenerativeModel(model_name="gemini-2.5-flash-lite")
+ model = GenerativeModel(model_name="gemini-3.1-flash-lite")
response = model.generate_content("hi", stream=True)
for chunk in response:
@@ -182,7 +182,7 @@ async def test_vertex_ai_pass_through_endpoint_context_caching():
vertexai.init(
project="litellm-ci-cd",
- location="us-central1",
+ location="global",
api_endpoint=f"{LITE_LLM_ENDPOINT}/vertex_ai",
api_transport="rest",
)
@@ -204,7 +204,7 @@ async def test_vertex_ai_pass_through_endpoint_context_caching():
]
cached_content = caching.CachedContent.create(
- model_name="gemini-2.5-flash-lite-001",
+ model_name="gemini-3.1-flash-lite",
system_instruction=system_instruction,
contents=contents,
ttl=datetime.timedelta(minutes=60),
diff --git a/tests/pass_through_tests/test_vertex_with_spend.test.js b/tests/pass_through_tests/test_vertex_with_spend.test.js
index 142a1cec8ff..4dee890dc78 100644
--- a/tests/pass_through_tests/test_vertex_with_spend.test.js
+++ b/tests/pass_through_tests/test_vertex_with_spend.test.js
@@ -71,7 +71,7 @@ describe('Vertex AI Tests', () => {
test('should successfully generate non-streaming content with tags', async () => {
const vertexAI = new VertexAI({
project: 'litellm-ci-cd',
- location: 'us-central1',
+ location: 'global',
apiEndpoint: "127.0.0.1:4000/vertex_ai"
});
@@ -85,7 +85,7 @@ describe('Vertex AI Tests', () => {
};
const generativeModel = vertexAI.getGenerativeModel(
- { model: 'gemini-2.5-flash-lite' },
+ { model: 'gemini-3.1-flash-lite' },
requestOptions
);
@@ -130,7 +130,7 @@ describe('Vertex AI Tests', () => {
test('should successfully generate streaming content with tags', async () => {
const vertexAI = new VertexAI({
project: 'litellm-ci-cd',
- location: 'us-central1',
+ location: 'global',
apiEndpoint: "127.0.0.1:4000/vertex_ai"
});
@@ -144,7 +144,7 @@ describe('Vertex AI Tests', () => {
};
const generativeModel = vertexAI.getGenerativeModel(
- { model: 'gemini-2.5-flash-lite' },
+ { model: 'gemini-3.1-flash-lite' },
requestOptions
);