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(cost): derive Nova cache expectations from registry and cite Gemini alias targets

Devin AI65a2e4f50394
diff --git a/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py b/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py
index b567a8669b4..b12ca31c694 100644
--- a/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py
+++ b/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py
@@ -230,21 +230,21 @@ def test_bedrock_gpt_5_6_offers_tools_and_reasoning_effort_but_not_thinking(prof
@pytest.mark.parametrize(
- "model,expected_cache_read",
+ "model",
[
- ("amazon.nova-lite-v1:0", 1.5e-8),
- ("us.amazon.nova-lite-v1:0", 1.5e-8),
- ("amazon.nova-micro-v1:0", 8.75e-9),
- ("us.amazon.nova-micro-v1:0", 8.75e-9),
- ("amazon.nova-pro-v1:0", 2e-7),
- ("us.amazon.nova-pro-v1:0", 2e-7),
- ("us.amazon.nova-premier-v1:0", 6.25e-7),
+ "amazon.nova-lite-v1:0",
+ "us.amazon.nova-lite-v1:0",
+ "amazon.nova-micro-v1:0",
+ "us.amazon.nova-micro-v1:0",
+ "amazon.nova-pro-v1:0",
+ "us.amazon.nova-pro-v1:0",
+ "us.amazon.nova-premier-v1:0",
],
)
-def test_bedrock_nova_cache_read_prices(
- model, expected_cache_read, local_model_cost_map
-):
+def test_bedrock_nova_cache_read_prices(model, local_model_cost_map):
model_info = litellm.model_cost[model]
+ expected_cache_read = model_info["cache_read_input_token_cost"]
+ assert 0 < expected_cache_read < model_info["input_cost_per_token"]
usage = Usage(
prompt_tokens=1_000,
completion_tokens=100,
diff --git a/tests/test_litellm/llms/gemini/test_cost_calculator.py b/tests/test_litellm/llms/gemini/test_cost_calculator.py
index 8ad27411ce3..5eed11dff03 100644
--- a/tests/test_litellm/llms/gemini/test_cost_calculator.py
+++ b/tests/test_litellm/llms/gemini/test_cost_calculator.py
@@ -452,6 +452,8 @@ def test_map_traffic_type_to_service_tier(
)
+# Alias targets are the `modelVersion` returned by
+# POST https://generativelanguage.googleapis.com/v1beta/models/<alias>:generateContent on 2026-09-15
@pytest.mark.parametrize(
"alias,target",
[