test: retarget cost-map tests to the cost map synced from main

Takes main's schema for test_aaamodel_prices_and_context_window_json_is_valid and points the per-query rerank test at an uncataloged model, as main does, since main's map now prices semantic-ranker-default-004.
This commit is contained in:
Mrinal Chanshetty 2026-10-20 18:40:18 -07:00
parent f0fa18d8dd
commit e19652cb0d
3 changed files with 35 additions and 8 deletions

View file

@ -369,9 +369,9 @@ def test_web_search_provider_prefix_fallback_does_not_misprice_non_gemini_model(
"""
from litellm.types.utils import PromptTokensDetailsWrapper, Usage
model = "openrouter/google/gemini-3.1-flash-lite"
model = "azure/gpt-4o"
model_info = litellm.get_model_info(model)
assert model_info["litellm_provider"] == "openrouter"
assert model_info["litellm_provider"] == "azure"
assert not model_info.get("search_context_cost_per_query")
usage = Usage(

View file

@ -1032,9 +1032,9 @@ def test_per_query_priced_rerank_deployment_completion_cost_is_nonzero():
router: Final = Router(
model_list=[
{
"model_name": "semantic-ranker-default-004",
"model_name": "semantic-ranker-custom-test",
"litellm_params": {
"model": "vertex_ai/semantic-ranker-default-004",
"model": "vertex_ai/semantic-ranker-custom-test",
"vertex_project": "test-project",
"vertex_location": "us-east5",
},
@ -1043,7 +1043,7 @@ def test_per_query_priced_rerank_deployment_completion_cost_is_nonzero():
]
)
router_model_id: Final = router.model_list[0]["model_info"]["id"]
assert litellm.model_cost["vertex_ai/semantic-ranker-default-004"].get("input_cost_per_query") is None
assert litellm.model_cost.get("vertex_ai/semantic-ranker-custom-test", {}).get("input_cost_per_query") is None
response: Final = RerankResponse(
id="vertex_ai_rerank_test",
@ -1053,7 +1053,7 @@ def test_per_query_priced_rerank_deployment_completion_cost_is_nonzero():
cost: Final = completion_cost(
completion_response=response,
model="vertex_ai/semantic-ranker-default-004",
model="vertex_ai/semantic-ranker-custom-test",
custom_llm_provider="vertex_ai",
call_type="arerank",
custom_pricing=True,

View file

@ -775,10 +775,19 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"cache_creation_input_token_cost_above_200k_tokens_batches": {"type": "number"},
"cache_creation_input_token_cost_above_272k_tokens_batches": {"type": "number"},
"cache_creation_input_token_cost_batches": {"type": "number"},
"cache_creation_input_token_cost_decisions": {"type": "number"},
"cache_creation_input_token_cost_above_272k_tokens_decisions": {"type": "number"},
"cache_read_input_token_cost_decisions": {"type": "number"},
"cache_read_input_token_cost_above_272k_tokens_decisions": {"type": "number"},
"input_cost_per_token_decisions": {"type": "number"},
"input_cost_per_token_above_272k_tokens_decisions": {"type": "number"},
"output_cost_per_token_decisions": {"type": "number"},
"output_cost_per_token_above_272k_tokens_decisions": {"type": "number"},
"cache_creation_input_token_cost_flex": {"type": "number"},
"cache_creation_input_token_cost_priority": {"type": "number"},
"cache_creation_input_token_cost_ultrafast": {"type": "number"},
"cache_read_input_token_cost": {"type": "number"},
"explicit_cache_read_input_token_cost": {"type": "number"},
"cache_read_input_token_cost_above_32k_tokens": {"type": "number"},
"cache_read_input_token_cost_above_100k_tokens": {"type": "number"},
"cache_read_input_token_cost_above_100k_tokens_batches": {"type": "number"},
@ -849,6 +858,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"input_cost_per_request": {"type": "number"},
"cost_per_second": {"type": "number"},
"input_cost_per_second": {"type": "number"},
"input_cost_per_text_message": {"type": "number"},
"input_cost_per_token": {"type": "number"},
"input_cost_per_token_above_128k_tokens": {"type": "number"},
"input_cost_per_audio_token_batches": {"type": "number"},
@ -885,6 +895,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"image_edit",
"embedding",
"evaluation",
"extraction",
"guardrail",
"image_generation",
"video_generation",
@ -909,6 +920,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"output_cost_per_image_2K": {"type": "number"},
"output_cost_per_image_4K": {"type": "number"},
"output_cost_per_image_token": {"type": "number"},
"output_cost_per_image_token_batches": {"type": "number"},
"output_cost_per_video_token": {"type": "number"},
"output_cost_per_pixel": {"type": "number"},
"output_cost_per_second": {"type": "number"},
@ -961,10 +973,9 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"supports_tool_choice": {"type": "boolean"},
"supports_tool_search": {"type": "boolean"},
"supports_video_input": {"type": "boolean"},
"supports_box_questions": {"type": "boolean"},
"supports_vision": {"type": "boolean"},
"supports_web_search": {"type": "boolean"},
"supports_bedrock_runtime_chat_completions_tools_with_reasoning": {"type": "boolean"},
"supports_bedrock_runtime_chat_completions_response_format": {"type": "boolean"},
"token_count_framing": {"type": "integer"},
"token_count_model": {
"type": "object",
@ -972,6 +983,10 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"required": ["model"],
},
"token_count_tokenizer": {"type": "string", "enum": ["kimi_k3"]},
"supports_bedrock_runtime_chat_completions_tools_with_reasoning": {"type": "boolean"},
"supports_bedrock_runtime_chat_completions_response_format": {"type": "boolean"},
"supports_bedrock_runtime_chat_completions_inline_reasoning": {"type": "boolean"},
"supports_bedrock_converse_tool_result_images": {"type": "boolean"},
"supports_url_context": {"type": "boolean"},
"supports_multimodal": {"type": "boolean"},
"uses_embed_content": {"type": "boolean"},
@ -1014,6 +1029,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"enum": ["low", "medium", "high", "max", "xhigh"],
},
"bedrock_converse_supports_strict_tools": {"type": "boolean"},
"supports_regex_lookaround": {"type": "boolean"},
"tpm": {"type": "number"},
"supported_endpoints": {
"type": "array",
@ -1067,6 +1083,16 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"type": "string",
"enum": ["per_prompt", "per_query"],
},
"search_free_requests": {
"type": "object",
"properties": {
"count": {"type": "integer", "minimum": 1},
"period": {"type": "string", "enum": ["day", "month"]},
"shared_group": {"type": "string"},
},
"required": ["count", "period", "shared_group"],
"additionalProperties": False,
},
"citation_cost_per_token": {"type": "number"},
"supported_modalities": {
"type": "array",
@ -1085,6 +1111,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
"supports_native_streaming": {"type": "boolean"},
"supports_image_size": {"type": "boolean"},
"supports_native_structured_output": {"type": "boolean"},
"supports_bedrock_native_structured_output": {"type": "boolean"},
"use_openai_responses_path": {"type": "boolean"},
"off_peak_pricing": {
"type": "object",