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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test: derive vertex batch cost expectation from the cost map
mateo-berri3a2728a42fe7
diff --git a/tests/test_litellm/batches/test_batch_utils.py b/tests/test_litellm/batches/test_batch_utils.pyindex 573882ebfca..49ff8de1ab9 100644--- a/tests/test_litellm/batches/test_batch_utils.py+++ b/tests/test_litellm/batches/test_batch_utils.py@@ -890,8 +890,13 @@ async def test_handle_completed_vertex_batch_computes_cost_usage_and_models(monklitellm_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 cost > 0- assert cost == pytest.approx(30 * 7.5e-07 + 15 * 3.75e-06)+ 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"]