From 534ef43526b66ee3e8498be684e834f059bb682e Mon Sep 17 00:00:00 2001 From: kenneth-berri Date: Fri, 13 Nov 2026 12:20:18 -0800 Subject: [PATCH] fix(mistral): declare low, medium and high reasoning effort for mistral-large-4 (#51693) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/model_prices_and_context_window_backup.json | 6 ++++-- model_prices_and_context_window.json | 6 ++++-- tests/unit/test_mistral_large_4_model_metadata.py | 8 +++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 47deec28924..96b9cd4ddaf 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -44324,7 +44324,8 @@ "mode": "chat", "output_cost_per_token": 2.1e-06, "reasoning_effort_levels": [ - "none", + "low", + "medium", "high" ], "source": "https://docs.mistral.ai/models/mistral-large-4-0", @@ -44345,7 +44346,8 @@ "mode": "chat", "output_cost_per_token": 2.1e-06, "reasoning_effort_levels": [ - "none", + "low", + "medium", "high" ], "source": "https://docs.mistral.ai/models/mistral-large-4-0", diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 47deec28924..96b9cd4ddaf 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -44324,7 +44324,8 @@ "mode": "chat", "output_cost_per_token": 2.1e-06, "reasoning_effort_levels": [ - "none", + "low", + "medium", "high" ], "source": "https://docs.mistral.ai/models/mistral-large-4-0", @@ -44345,7 +44346,8 @@ "mode": "chat", "output_cost_per_token": 2.1e-06, "reasoning_effort_levels": [ - "none", + "low", + "medium", "high" ], "source": "https://docs.mistral.ai/models/mistral-large-4-0", diff --git a/tests/unit/test_mistral_large_4_model_metadata.py b/tests/unit/test_mistral_large_4_model_metadata.py index bfcd6690890..08415473310 100644 --- a/tests/unit/test_mistral_large_4_model_metadata.py +++ b/tests/unit/test_mistral_large_4_model_metadata.py @@ -11,6 +11,8 @@ from litellm.llms.mistral.chat.transformation import MistralConfig REPO_ROOT = Path(__file__).parents[2] MODELS = ("mistral/mistral-large-4", "mistral/mistral-large-4-0") +# Probed against api.mistral.ai on 2026-11-13: both ids take these three levels and answer 400 to none. +ACCEPTED_EFFORTS: Final = ("low", "medium", "high") @pytest.fixture(autouse=True) @@ -34,7 +36,7 @@ def test_metadata_and_backup(model): assert info["mode"] == "chat" assert info["max_input_tokens"] == 1048576 assert 0 < info["cache_read_input_token_cost"] < info["input_cost_per_token"] < info["output_cost_per_token"] - assert info["reasoning_effort_levels"] == ["none", "high"] + assert info["reasoning_effort_levels"] == list(ACCEPTED_EFFORTS) for capability in ( "supports_vision", "supports_reasoning", @@ -49,7 +51,7 @@ def test_metadata_and_backup(model): @pytest.mark.parametrize("model", MODELS) -@pytest.mark.parametrize("effort", ["none", "high"]) +@pytest.mark.parametrize("effort", ACCEPTED_EFFORTS) def test_reasoning_effort(model, effort): config = MistralConfig() assert "reasoning_effort" in config.get_supported_openai_params(model) @@ -92,7 +94,7 @@ def test_large_3_alias_is_not_retargeted(): @pytest.mark.parametrize("model", MODELS) @pytest.mark.parametrize("sync_mode", [True, False]) -@pytest.mark.parametrize("effort", ["none", "high"]) +@pytest.mark.parametrize("effort", ACCEPTED_EFFORTS) @pytest.mark.asyncio async def test_completion_contract(model, sync_mode, effort, respx_mock): """Exercise the real adapter against explicitly mocked Mistral HTTP responses."""