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]

Merge remote-tracking branch 'berri/litellm_internal_staging' into litellm_managed_batches_observability

mubashir1osmani852827c6bbb6
diff --cc tests/test_litellm/batches/test_batch_utils.py
index 64b3df4180b,50f1380a4f8..f7067053acb
--- a/tests/test_litellm/batches/test_batch_utils.py
+++ b/tests/test_litellm/batches/test_batch_utils.py
@@@ -959,12 -890,16 +959,18 @@@ async def test_handle_completed_vertex_
litellm_params={"vertex_project": "proj-1", "vertex_location": "us-central1"},
)
+ pricing = litellm.model_cost["vertex_ai/gemini-3.6-flash"]
+ batch_input = pricing["input_cost_per_token_batches"]
+ batch_output = pricing["output_cost_per_token_batches"]
+
+ assert batch_input < pricing["input_cost_per_token"]
+ assert batch_output < pricing["output_cost_per_token"]
- assert cost > 0
- assert cost == pytest.approx(30 * batch_input + 15 * batch_output)
- assert (usage.prompt_tokens, usage.completion_tokens, usage.total_tokens) == (30, 15, 45)
- assert models == ["gemini-3.6-flash", "gemini-3.6-flash"]
+ assert result.cost > 0
- assert result.cost == pytest.approx(30 * 7.5e-07 + 15 * 3.75e-06)
++ assert result.cost == pytest.approx(30 * batch_input + 15 * batch_output)
+ assert (result.usage.prompt_tokens, result.usage.completion_tokens, result.usage.total_tokens) == (30, 15, 45)
+ assert result.models == ["gemini-3.6-flash", "gemini-3.6-flash"]
+ assert result.successful_requests == 2
+ assert result.failed_requests == 0
@pytest.mark.asyncio