The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: BadRequestError cohere (#14691)
Ishaan Jaffc6e37bb0bb28
diff --git a/litellm/litellm_core_utils/exception_mapping_utils.py b/litellm/litellm_core_utils/exception_mapping_utils.pyindex 25ae0269ab3..6936924fe17 100644--- a/litellm/litellm_core_utils/exception_mapping_utils.py+++ b/litellm/litellm_core_utils/exception_mapping_utils.py@@ -1449,6 +1449,14 @@ def exception_type( # type: ignore # noqa: PLR0915model=model,response=getattr(original_exception, "response", None),)+ elif "invalid type: parameter" in error_str:+ exception_mapping_worked = True+ raise BadRequestError(+ message=f"CohereException - {original_exception.message}",+ llm_provider="cohere",+ model=model,+ response=getattr(original_exception, "response", None),+ )elif "too many tokens" in error_str:exception_mapping_worked = Trueraise ContextWindowExceededError(diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.jsonindex 5e5bccb81e8..da2700f7c2f 100644--- a/litellm/model_prices_and_context_window_backup.json+++ b/litellm/model_prices_and_context_window_backup.json@@ -296,6 +296,18 @@"output_cost_per_token": 0.0,"output_vector_size": 1024},+ "twelvelabs.marengo-embed-2-7-v1:0": {+ "input_cost_per_token": 7e-05,+ "litellm_provider": "bedrock",+ "max_input_tokens": 77,+ "max_tokens": 77,+ "mode": "embedding",+ "output_cost_per_token": 0.0,+ "output_vector_size": 1024,+ "supports_embedding_image_input": true,+ "supports_image_input": true,+ "supports_multimodal_embedding": true+ },"amazon.titan-text-express-v1": {"input_cost_per_token": 1.3e-06,"litellm_provider": "bedrock",