From f453f20290cee51132fad9a824fb0609e0633e02 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 16:07:58 +0000 Subject: [PATCH] feat(azure_ai): add Cohere Command A (03-2025) model pricing and metadata --- ...odel_prices_and_context_window_backup.json | 12 ++++ model_prices_and_context_window.json | 12 ++++ .../test_azure_ai_command_a_metadata.py | 63 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 tests/test_litellm/llms/azure_ai/test_azure_ai_command_a_metadata.py diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index db534b52df9..f2f6ef7ca0b 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -8125,6 +8125,18 @@ "supports_reasoning": true, "supports_tool_choice": true }, + "azure_ai/cohere-command-a-03-2025": { + "input_cost_per_token": 2.5e-06, + "litellm_provider": "azure_ai", + "max_input_tokens": 256000, + "max_output_tokens": 8000, + "max_tokens": 8000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/introducing-cohere-command-a-in-foundry/4530376", + "supports_function_calling": true, + "supports_tool_choice": true + }, "azure_ai/cohere-rerank-v3-english": { "input_cost_per_query": 0.002, "input_cost_per_token": 0.0, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 363ba9842b0..26aa391b6b6 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -8125,6 +8125,18 @@ "supports_reasoning": true, "supports_tool_choice": true }, + "azure_ai/cohere-command-a-03-2025": { + "input_cost_per_token": 2.5e-06, + "litellm_provider": "azure_ai", + "max_input_tokens": 256000, + "max_output_tokens": 8000, + "max_tokens": 8000, + "mode": "chat", + "output_cost_per_token": 1e-05, + "source": "https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/introducing-cohere-command-a-in-foundry/4530376", + "supports_function_calling": true, + "supports_tool_choice": true + }, "azure_ai/cohere-rerank-v3-english": { "input_cost_per_query": 0.002, "input_cost_per_token": 0.0, diff --git a/tests/test_litellm/llms/azure_ai/test_azure_ai_command_a_metadata.py b/tests/test_litellm/llms/azure_ai/test_azure_ai_command_a_metadata.py new file mode 100644 index 00000000000..ab0d563f55a --- /dev/null +++ b/tests/test_litellm/llms/azure_ai/test_azure_ai_command_a_metadata.py @@ -0,0 +1,63 @@ +""" +Test Azure AI Cohere Command A model metadata. +""" + +import json +from importlib.resources import files + +import pytest + + +@pytest.fixture(scope="module") +def use_local_model_cost_map(): + monkeypatch = pytest.MonkeyPatch() + monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True") + + import litellm + from litellm.utils import _invalidate_model_cost_lowercase_map + + original_model_cost = litellm.model_cost + litellm.model_cost = json.loads( + files("litellm") + .joinpath("model_prices_and_context_window_backup.json") + .read_text(encoding="utf-8") + ) + litellm.get_model_info.cache_clear() + _invalidate_model_cost_lowercase_map() + try: + yield litellm + finally: + litellm.model_cost = original_model_cost + litellm.get_model_info.cache_clear() + _invalidate_model_cost_lowercase_map() + monkeypatch.undo() + + +def test_azure_ai_command_a_model_info(use_local_model_cost_map): + model_info = use_local_model_cost_map.get_model_info(model="azure_ai/cohere-command-a-03-2025") + + assert model_info["litellm_provider"] == "azure_ai" + assert model_info["mode"] == "chat" + assert model_info["max_input_tokens"] == 256000 + assert model_info["max_output_tokens"] == 8000 + assert model_info["max_tokens"] == 8000 + assert model_info["input_cost_per_token"] == pytest.approx(2.5e-06) + assert model_info["output_cost_per_token"] == pytest.approx(1e-05) + assert model_info["supports_function_calling"] is True + assert model_info["supports_tool_choice"] is True + + +def test_azure_ai_command_a_cost_per_token(use_local_model_cost_map): + from litellm.llms.azure_ai.cost_calculator import cost_per_token + from litellm.types.utils import Usage + + usage = Usage( + prompt_tokens=1_000_000, + completion_tokens=1_000_000, + total_tokens=2_000_000, + ) + + prompt_cost, completion_cost = cost_per_token(model="cohere-command-a-03-2025", usage=usage) + + assert prompt_cost == pytest.approx(2.5) + assert completion_cost == pytest.approx(10.0)