From db2e5f54a2a6a40fa28211ad109050d2aebd13aa Mon Sep 17 00:00:00 2001 From: Emerson Gomes Date: Thu, 7 May 2026 16:13:06 -0500 Subject: [PATCH] Add Azure gpt-chat-latest model metadata --- ...odel_prices_and_context_window_backup.json | 33 ++++++++ model_prices_and_context_window.json | 33 ++++++++ ...st_azure_gpt_chat_latest_model_metadata.py | 78 +++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 tests/test_litellm/test_azure_gpt_chat_latest_model_metadata.py diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 1a83df726ed..ca7ef32f76c 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -3888,6 +3888,39 @@ "supports_tool_choice": true, "supports_vision": true }, + "azure/gpt-chat-latest": { + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "azure", + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 3e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/introducing-openais-newest-chat-model-in-microsoft-foundry/4516848", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true + }, "azure/gpt-5-codex": { "cache_read_input_token_cost": 1.25e-07, "input_cost_per_token": 1.25e-06, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 61e7c1de843..e598d596a81 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -3888,6 +3888,39 @@ "supports_tool_choice": true, "supports_vision": true }, + "azure/gpt-chat-latest": { + "cache_read_input_token_cost": 5e-07, + "input_cost_per_token": 5e-06, + "litellm_provider": "azure", + "max_input_tokens": 128000, + "max_output_tokens": 16384, + "max_tokens": 16384, + "mode": "chat", + "output_cost_per_token": 3e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/introducing-openais-newest-chat-model-in-microsoft-foundry/4516848", + "supported_endpoints": [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses" + ], + "supported_modalities": [ + "text", + "image" + ], + "supported_output_modalities": [ + "text" + ], + "supports_function_calling": true, + "supports_native_streaming": true, + "supports_parallel_function_calling": true, + "supports_pdf_input": true, + "supports_prompt_caching": true, + "supports_reasoning": true, + "supports_response_schema": true, + "supports_system_messages": true, + "supports_tool_choice": true, + "supports_vision": true + }, "azure/gpt-5-codex": { "cache_read_input_token_cost": 1.25e-07, "input_cost_per_token": 1.25e-06, diff --git a/tests/test_litellm/test_azure_gpt_chat_latest_model_metadata.py b/tests/test_litellm/test_azure_gpt_chat_latest_model_metadata.py new file mode 100644 index 00000000000..59c220f9c0c --- /dev/null +++ b/tests/test_litellm/test_azure_gpt_chat_latest_model_metadata.py @@ -0,0 +1,78 @@ +import json +from pathlib import Path + +import litellm +from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider + + +MODEL = "azure/gpt-chat-latest" +SOURCE = "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/introducing-openais-newest-chat-model-in-microsoft-foundry/4516848" + + +def _load_model_cost(path: Path) -> dict: + with open(path, encoding="utf-8") as f: + return json.load(f) + + +def _assert_gpt_chat_latest_metadata(info: dict) -> None: + assert info["litellm_provider"] == "azure" + assert info["mode"] == "chat" + + assert info["input_cost_per_token"] == 5e-06 + assert info["cache_read_input_token_cost"] == 5e-07 + assert info["output_cost_per_token"] == 3e-05 + + assert info["max_input_tokens"] == 128000 + assert info["max_output_tokens"] == 16384 + assert info["max_tokens"] == 16384 + + assert info["supports_function_calling"] is True + assert info["supports_native_streaming"] is True + assert info["supports_pdf_input"] is True + assert info["supports_prompt_caching"] is True + assert info["supports_reasoning"] is True + assert info["supports_response_schema"] is True + assert info["supports_system_messages"] is True + assert info["supports_tool_choice"] is True + assert info["supports_vision"] is True + + +def test_azure_gpt_chat_latest_model_info() -> None: + repo_root = Path(__file__).parents[2] + model_cost = _load_model_cost(repo_root / "model_prices_and_context_window.json") + + info = model_cost.get(MODEL) + assert info is not None + assert info["source"] == SOURCE + assert info["supported_endpoints"] == [ + "/v1/chat/completions", + "/v1/batch", + "/v1/responses", + ] + assert info["supported_modalities"] == ["text", "image"] + assert info["supported_output_modalities"] == ["text"] + assert info["supports_parallel_function_calling"] is True + _assert_gpt_chat_latest_metadata(info) + + routed_model, provider, _, _ = get_llm_provider(model=MODEL) + assert routed_model == "gpt-chat-latest" + assert provider == "azure" + + +def test_azure_gpt_chat_latest_get_model_info(monkeypatch) -> None: + monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True") + monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url="")) + + info = litellm.get_model_info(model="gpt-chat-latest", custom_llm_provider="azure") + _assert_gpt_chat_latest_metadata(info) + assert info["key"] == MODEL + + +def test_azure_gpt_chat_latest_backup_matches_main() -> None: + repo_root = Path(__file__).parents[2] + main_cost = _load_model_cost(repo_root / "model_prices_and_context_window.json") + backup_cost = _load_model_cost( + repo_root / "litellm" / "model_prices_and_context_window_backup.json" + ) + + assert backup_cost.get(MODEL) == main_cost.get(MODEL)