mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(mistral): source supports_web_search from the model cost map
MistralModelInfo.get_provider_info hardcoded supports_web_search=True for every mistral model, so embeddings and OCR models (mistral-embed, mistral-ocr-*) wrongly reported web search support, and the capability was invisible to anything reading model_prices_and_context_window.json. Move the flag onto the individual mistral chat entries in the cost map (and its backup), the way xai, gemini and anthropic declare it, and drop the provider-level override so non-chat models resolve to False through the normal cost-map lookup
This commit is contained in:
parent
036def4423
commit
d46bb892ed
4 changed files with 75 additions and 15 deletions
|
|
@ -7,7 +7,6 @@ import litellm
|
|||
from litellm.llms.base_llm.base_utils import BaseLLMModelInfo
|
||||
from litellm.secret_managers.main import get_secret_str
|
||||
from litellm.types.llms.openai import AllMessageValues
|
||||
from litellm.types.utils import ProviderSpecificModelInfo
|
||||
|
||||
WEB_SEARCH_TOOL_TYPES: tuple[str, ...] = ("web_search", "web_search_premium")
|
||||
|
||||
|
|
@ -30,16 +29,6 @@ def is_web_search_request(optional_params: dict) -> bool:
|
|||
|
||||
|
||||
class MistralModelInfo(BaseLLMModelInfo):
|
||||
def get_provider_info(self, model: str) -> Optional[ProviderSpecificModelInfo]:
|
||||
"""
|
||||
Capabilities shared by all Mistral models. Web search is available to
|
||||
every chat model through the Conversations API connector, so advertise
|
||||
it at the provider level rather than per model.
|
||||
"""
|
||||
return {
|
||||
"supports_web_search": True,
|
||||
}
|
||||
|
||||
def validate_environment(
|
||||
self,
|
||||
headers: dict,
|
||||
|
|
|
|||
|
|
@ -33565,6 +33565,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/codestral-2508": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33580,6 +33581,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/codestral-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33607,6 +33609,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-medium-2507": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-05-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33622,6 +33625,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-2505": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33637,6 +33641,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-2507": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-05-31",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33652,6 +33657,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33666,6 +33672,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/labs-devstral-small-2512": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-03-31",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33681,6 +33688,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33695,6 +33703,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33709,6 +33718,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-2512": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33904,6 +33914,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33920,6 +33931,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33936,6 +33948,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-1-2-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34003,6 +34016,7 @@
|
|||
"source": "https://mistral.ai/pricing#api-pricing"
|
||||
},
|
||||
"mistral/magistral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34020,6 +34034,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/magistral-small-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34036,6 +34051,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34053,6 +34069,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/magistral-small-1-2-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34134,6 +34151,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-large-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34150,6 +34168,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-large-3": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34166,6 +34185,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-large-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34212,6 +34232,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-medium-2505": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34226,6 +34247,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-medium-2508": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34242,6 +34264,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-2604": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34259,6 +34282,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34276,6 +34300,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-3-1-2508": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34292,6 +34317,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-3-5": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34322,6 +34348,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34339,6 +34366,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-small-3-2-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 6e-08,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34355,6 +34383,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-3b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34371,6 +34400,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-8b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34387,6 +34417,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-14b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 2e-08,
|
||||
"input_cost_per_token": 2e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34403,6 +34434,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-8b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
|
|||
|
|
@ -33565,6 +33565,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/codestral-2508": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33580,6 +33581,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/codestral-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 3e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33607,6 +33609,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-medium-2507": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-05-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33622,6 +33625,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-2505": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33637,6 +33641,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-2507": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-05-31",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33652,6 +33657,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33666,6 +33672,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/labs-devstral-small-2512": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-03-31",
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33681,6 +33688,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33695,6 +33703,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
"max_input_tokens": 256000,
|
||||
|
|
@ -33709,6 +33718,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/devstral-2512": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33904,6 +33914,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33920,6 +33931,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -33936,6 +33948,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-medium-1-2-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 2e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34003,6 +34016,7 @@
|
|||
"source": "https://mistral.ai/pricing#api-pricing"
|
||||
},
|
||||
"mistral/magistral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34020,6 +34034,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/magistral-small-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2025-11-30",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34036,6 +34051,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/magistral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34053,6 +34069,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/magistral-small-1-2-2509": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34134,6 +34151,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-large-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34150,6 +34168,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-large-3": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34166,6 +34185,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-large-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 5e-08,
|
||||
"input_cost_per_token": 5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34212,6 +34232,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-medium-2505": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34226,6 +34247,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-medium-2508": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34242,6 +34264,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-2604": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34259,6 +34282,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34276,6 +34300,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-3-1-2508": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-08-31",
|
||||
"input_cost_per_token": 4e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34292,6 +34317,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-medium-3-5": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-07,
|
||||
"input_cost_per_token": 1.5e-06,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34322,6 +34348,7 @@
|
|||
"supports_tool_choice": true
|
||||
},
|
||||
"mistral/mistral-small-latest": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34339,6 +34366,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/mistral-small-3-2-2506": {
|
||||
"supports_web_search": true,
|
||||
"deprecation_date": "2026-07-31",
|
||||
"input_cost_per_token": 6e-08,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34355,6 +34383,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-3b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1e-08,
|
||||
"input_cost_per_token": 1e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34371,6 +34400,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-8b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34387,6 +34417,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-3-14b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 2e-08,
|
||||
"input_cost_per_token": 2e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
@ -34403,6 +34434,7 @@
|
|||
"supports_vision": true
|
||||
},
|
||||
"mistral/ministral-8b-2512": {
|
||||
"supports_web_search": true,
|
||||
"cache_read_input_token_cost": 1.5e-08,
|
||||
"input_cost_per_token": 1.5e-07,
|
||||
"litellm_provider": "mistral",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,12 @@ def add_mistral_api_key_to_env(monkeypatch):
|
|||
monkeypatch.setenv("MISTRAL_API_KEY", "fake-mistral-api-key-12345")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def local_cost_map(monkeypatch):
|
||||
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
|
||||
monkeypatch.setattr(litellm, "model_cost", litellm.get_model_cost_map(url=""))
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"optional_params, expected",
|
||||
[
|
||||
|
|
@ -27,16 +33,17 @@ def test_is_web_search_request(optional_params, expected):
|
|||
class TestMistralModelInfo:
|
||||
"""Capability reporting and environment resolution for Mistral models."""
|
||||
|
||||
def test_get_provider_info_advertises_web_search(self):
|
||||
assert MistralModelInfo().get_provider_info("mistral-medium-latest") == {"supports_web_search": True}
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model",
|
||||
["mistral/mistral-medium-latest", "mistral/mistral-large-latest", "mistral/mistral-small-latest"],
|
||||
)
|
||||
def test_supports_web_search_true(self, model):
|
||||
def test_supports_web_search_true_for_chat_models(self, model, local_cost_map):
|
||||
assert litellm.supports_web_search(model) is True
|
||||
|
||||
@pytest.mark.parametrize("model", ["mistral/mistral-embed", "mistral/mistral-ocr-latest"])
|
||||
def test_no_web_search_for_non_chat_models(self, model, local_cost_map):
|
||||
assert litellm.supports_web_search(model) is False
|
||||
|
||||
def test_get_api_base_default_arg_and_env(self, monkeypatch):
|
||||
monkeypatch.delenv("MISTRAL_API_BASE", raising=False)
|
||||
assert MistralModelInfo.get_api_base() == "https://api.mistral.ai"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue