Skip to content

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]

Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_openai_error_payload_non_llm_routes

mateo-berri57fd8f6f491f
diff --cc litellm/proxy/anthropic_endpoints/endpoints.py
index f26cb4d41f7,b243b737b0a..d4cb3b84ee4
--- a/litellm/proxy/anthropic_endpoints/endpoints.py
+++ b/litellm/proxy/anthropic_endpoints/endpoints.py
@@@ -221,15 -237,18 +242,18 @@@ async def anthropic_response
)
if isinstance(e, HTTPException):
- raise proxy_exception_from_http_exception(e, headers)
+ return _anthropic_error_json_response(proxy_exception_from_http_exception(e, headers), request)
error_msg: Final = f"{e}"
- raise ProxyException(
- message=getattr(e, "message", error_msg),
- type=openai_error_type(e, error_status_code(e, 500)),
- param=openai_error_param(e),
- code=error_status_code(e, 500),
- headers=headers,
+ return _anthropic_error_json_response(
+ ProxyException(
+ message=getattr(e, "message", error_msg),
- type=getattr(e, "type", "None"),
- param=getattr(e, "param", "None"),
- code=getattr(e, "status_code", 500),
++ type=openai_error_type(e, error_status_code(e, 500)),
++ param=openai_error_param(e),
++ code=error_status_code(e, 500),
+ headers=headers,
+ ),
+ request,
)
diff --cc litellm/proxy/image_endpoints/endpoints.py
index b83f7e5cd60,06f99e4ae9c..3f044855ce8
--- a/litellm/proxy/image_endpoints/endpoints.py
+++ b/litellm/proxy/image_endpoints/endpoints.py
@@@ -16,12 -16,12 +16,17 @@@ from litellm.litellm_core_utils.prompt_
from litellm.proxy._types import *
from litellm.proxy.auth.user_api_key_auth import UserAPIKeyAuth, user_api_key_auth
from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing
+ from litellm.proxy.common_utils.http_parsing_utils import (
+ coerce_numeric_form_fields,
+ numeric_form_fields,
+ )
+from litellm.proxy.common_utils.openai_error_payload import (
+ error_status_code,
+ openai_error_param,
+ openai_error_type,
+)
from litellm.proxy.route_llm_request import route_request
+ from litellm.types.images.main import ImageEditRequestParams
from litellm.types.llms.openai import ChatCompletionUserMessage
router: Final = APIRouter()