mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(model-prices): mark azure us/eu responses-only models as mode responses (#44323)
* fix(model-prices): mark azure us/eu responses-only models as mode responses Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(model-prices): keep azure us/eu o3-deep-research on chat, which Azure lists as chat capable Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: kerry <kerry@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
caee45fed4
commit
0fce5bccbc
3 changed files with 63 additions and 32 deletions
|
|
@ -70741,7 +70741,7 @@
|
|||
"cache_read_input_token_cost": 4.13e-07,
|
||||
"input_cost_per_token": 1.65e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 6.6e-06,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70824,7 +70824,7 @@
|
|||
"cache_read_input_token_cost": 1.38e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70860,7 +70860,7 @@
|
|||
"input_cost_per_token": 1.65e-05,
|
||||
"input_cost_per_token_batches": 8.25e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000132,
|
||||
"output_cost_per_token_batches": 6.6e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70870,7 +70870,7 @@
|
|||
"cache_read_input_token_cost": 1.375e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70894,7 +70894,7 @@
|
|||
"cache_read_input_token_cost": 1.925e-07,
|
||||
"input_cost_per_token": 1.925e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70902,7 +70902,7 @@
|
|||
"input_cost_per_token": 2.31e-05,
|
||||
"input_cost_per_token_batches": 1.155e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.0001848,
|
||||
"output_cost_per_token_batches": 9.24e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70914,7 +70914,7 @@
|
|||
"input_cost_per_token": 1.925e-06,
|
||||
"input_cost_per_token_priority": 3.85e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"output_cost_per_token_priority": 3.08e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70953,7 +70953,7 @@
|
|||
"input_cost_per_token_above_272k_tokens_batches": 3.3e-05,
|
||||
"input_cost_per_token_batches": 1.65e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000198,
|
||||
"output_cost_per_token_above_272k_tokens": 0.000297,
|
||||
"output_cost_per_token_above_272k_tokens_batches": 0.0001485,
|
||||
|
|
@ -71190,7 +71190,7 @@
|
|||
"cache_read_input_token_cost": 4.13e-07,
|
||||
"input_cost_per_token": 1.65e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 6.6e-06,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71273,7 +71273,7 @@
|
|||
"cache_read_input_token_cost": 1.38e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71309,7 +71309,7 @@
|
|||
"input_cost_per_token": 1.65e-05,
|
||||
"input_cost_per_token_batches": 8.25e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000132,
|
||||
"output_cost_per_token_batches": 6.6e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71319,7 +71319,7 @@
|
|||
"cache_read_input_token_cost": 1.375e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71343,7 +71343,7 @@
|
|||
"cache_read_input_token_cost": 1.925e-07,
|
||||
"input_cost_per_token": 1.925e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71351,7 +71351,7 @@
|
|||
"input_cost_per_token": 2.31e-05,
|
||||
"input_cost_per_token_batches": 1.155e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.0001848,
|
||||
"output_cost_per_token_batches": 9.24e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71363,7 +71363,7 @@
|
|||
"input_cost_per_token": 1.925e-06,
|
||||
"input_cost_per_token_priority": 3.85e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"output_cost_per_token_priority": 3.08e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71402,7 +71402,7 @@
|
|||
"input_cost_per_token_above_272k_tokens_batches": 3.3e-05,
|
||||
"input_cost_per_token_batches": 1.65e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000198,
|
||||
"output_cost_per_token_above_272k_tokens": 0.000297,
|
||||
"output_cost_per_token_above_272k_tokens_batches": 0.0001485,
|
||||
|
|
|
|||
|
|
@ -70741,7 +70741,7 @@
|
|||
"cache_read_input_token_cost": 4.13e-07,
|
||||
"input_cost_per_token": 1.65e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 6.6e-06,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70824,7 +70824,7 @@
|
|||
"cache_read_input_token_cost": 1.38e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70860,7 +70860,7 @@
|
|||
"input_cost_per_token": 1.65e-05,
|
||||
"input_cost_per_token_batches": 8.25e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000132,
|
||||
"output_cost_per_token_batches": 6.6e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70870,7 +70870,7 @@
|
|||
"cache_read_input_token_cost": 1.375e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70894,7 +70894,7 @@
|
|||
"cache_read_input_token_cost": 1.925e-07,
|
||||
"input_cost_per_token": 1.925e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -70902,7 +70902,7 @@
|
|||
"input_cost_per_token": 2.31e-05,
|
||||
"input_cost_per_token_batches": 1.155e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.0001848,
|
||||
"output_cost_per_token_batches": 9.24e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70914,7 +70914,7 @@
|
|||
"input_cost_per_token": 1.925e-06,
|
||||
"input_cost_per_token_priority": 3.85e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"output_cost_per_token_priority": 3.08e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -70953,7 +70953,7 @@
|
|||
"input_cost_per_token_above_272k_tokens_batches": 3.3e-05,
|
||||
"input_cost_per_token_batches": 1.65e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000198,
|
||||
"output_cost_per_token_above_272k_tokens": 0.000297,
|
||||
"output_cost_per_token_above_272k_tokens_batches": 0.0001485,
|
||||
|
|
@ -71190,7 +71190,7 @@
|
|||
"cache_read_input_token_cost": 4.13e-07,
|
||||
"input_cost_per_token": 1.65e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 6.6e-06,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71273,7 +71273,7 @@
|
|||
"cache_read_input_token_cost": 1.38e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71309,7 +71309,7 @@
|
|||
"input_cost_per_token": 1.65e-05,
|
||||
"input_cost_per_token_batches": 8.25e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000132,
|
||||
"output_cost_per_token_batches": 6.6e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71319,7 +71319,7 @@
|
|||
"cache_read_input_token_cost": 1.375e-07,
|
||||
"input_cost_per_token": 1.375e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.1e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71343,7 +71343,7 @@
|
|||
"cache_read_input_token_cost": 1.925e-07,
|
||||
"input_cost_per_token": 1.925e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
},
|
||||
|
|
@ -71351,7 +71351,7 @@
|
|||
"input_cost_per_token": 2.31e-05,
|
||||
"input_cost_per_token_batches": 1.155e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.0001848,
|
||||
"output_cost_per_token_batches": 9.24e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71363,7 +71363,7 @@
|
|||
"input_cost_per_token": 1.925e-06,
|
||||
"input_cost_per_token_priority": 3.85e-06,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 1.54e-05,
|
||||
"output_cost_per_token_priority": 3.08e-05,
|
||||
"source": "https://prices.azure.com/api/retail/prices?$filter=serviceName%20eq%20'Foundry%20Models'%20and%20armRegionName%20eq%20'eastus'%20and%20priceType%20eq%20'Consumption'"
|
||||
|
|
@ -71402,7 +71402,7 @@
|
|||
"input_cost_per_token_above_272k_tokens_batches": 3.3e-05,
|
||||
"input_cost_per_token_batches": 1.65e-05,
|
||||
"litellm_provider": "azure",
|
||||
"mode": "chat",
|
||||
"mode": "responses",
|
||||
"output_cost_per_token": 0.000198,
|
||||
"output_cost_per_token_above_272k_tokens": 0.000297,
|
||||
"output_cost_per_token_above_272k_tokens_batches": 0.0001485,
|
||||
|
|
|
|||
|
|
@ -1007,6 +1007,37 @@ def test_responses_api_bridge_check_gpt_5_4_and_5_5_tools_without_effort_stay_ch
|
|||
assert model_info.get("mode") != "responses"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("region", ("us", "eu"))
|
||||
@pytest.mark.parametrize(
|
||||
"model_name",
|
||||
(
|
||||
"codex-mini",
|
||||
"gpt-5-codex",
|
||||
"gpt-5-pro",
|
||||
"gpt-5.1-codex-max",
|
||||
"gpt-5.2-codex",
|
||||
"gpt-5.2-pro",
|
||||
"gpt-5.3-codex",
|
||||
"gpt-5.4-pro",
|
||||
),
|
||||
)
|
||||
def test_responses_api_bridge_check_azure_regional_responses_only_models_route_to_responses(
|
||||
monkeypatch: pytest.MonkeyPatch, region: str, model_name: str
|
||||
) -> None:
|
||||
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
|
||||
monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
|
||||
|
||||
model_info, model = litellm_main.responses_api_bridge_check(
|
||||
model=f"{region}/{model_name}",
|
||||
custom_llm_provider="azure",
|
||||
tools=[{"type": "function", "function": {"name": "get_capital"}}],
|
||||
reasoning_effort=None,
|
||||
)
|
||||
|
||||
assert model == f"{region}/{model_name}"
|
||||
assert model_info.get("mode") == "responses"
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name, expected_mode",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue