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/main' into litellm_transcribe_passthrough

yassin4f8a5b5e12f7
diff --cc litellm/proxy/_lazy_features.py
index d6b81b7908a,2a28ea3763f..8fc99fc81a4
--- a/litellm/proxy/_lazy_features.py
+++ b/litellm/proxy/_lazy_features.py
@@@ -208,7 -208,7 +208,8 @@@ LAZY_FEATURES: Final[tuple[LazyFeature
"/nvidia_nim/",
"/openai/",
"/openai_passthrough/",
+ "/transcribe",
+ "/typesafe/",
"/vertex-ai/",
"/vertex_ai/",
"/vllm/",
diff --cc litellm/proxy/_lazy_openapi_snapshot.json
index 5412426dfdd,8a880b5832f..100816cd89c
--- a/litellm/proxy/_lazy_openapi_snapshot.json
+++ b/litellm/proxy/_lazy_openapi_snapshot.json
@@@ -20373,77 -20373,96 +20373,167 @@@
]
}
},
+ "/transcribe": {
+ "post": {
+ "description": "AWS-SDK-shaped pass-through for Amazon Transcribe: point the SDK's `endpoint_url`\nat `/transcribe` and the operation is read from the `X-Amz-Target` header, per the\nAWS JSON 1.1 protocol.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/transcribe)",
+ "operationId": "transcribe_sdk_proxy_route_transcribe_post",
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ }
+ },
+ "security": [
+ {
+ "APIKeyHeader": []
+ }
+ ],
+ "summary": "Transcribe Sdk Proxy Route",
+ "tags": [
+ "llm_passthrough"
+ ]
+ }
+ },
+ "/transcribe/{operation}": {
+ "post": {
+ "description": "Pass-through for the Amazon Transcribe API, e.g. `POST /transcribe/StartTranscriptionJob`.\n\nThe request body is forwarded to the AWS JSON 1.1 API and signed with SigV4 using the\nproxy's AWS credentials. Standard jobs are tagged with the calling key's owner so that\nonly that owner (or a proxy admin) can read or delete them; account-wide operations\nsuch as ListTranscriptionJobs are limited to proxy admins. Streaming transcription\n(`transcribestreaming`) uses a separate HTTP/2 event-stream protocol and is not served\nby this route.\n\n[Docs](https://docs.litellm.ai/docs/pass_through/transcribe)",
+ "operationId": "transcribe_proxy_route_transcribe__operation__post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "operation",
+ "required": true,
+ "schema": {
+ "title": "Operation",
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "security": [
+ {
+ "APIKeyHeader": []
+ }
+ ],
+ "summary": "Transcribe Proxy Route",
+ "tags": [
+ "llm_passthrough"
+ ]
+ }
+ },
+ "/typesafe/{endpoint}": {
+ "get": {
+ "description": "[Docs](https://docs.litellm.ai/docs/pass_through/typesafe)",
+ "operationId": "typesafe_proxy_route_typesafe__endpoint__get",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "endpoint",
+ "required": true,
+ "schema": {
+ "title": "Endpoint",
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "security": [
+ {
+ "APIKeyHeader": []
+ }
+ ],
+ "summary": "Typesafe Proxy Route",
+ "tags": [
+ "llm_passthrough"
+ ]
+ },
+ "post": {
+ "description": "[Docs](https://docs.litellm.ai/docs/pass_through/typesafe)",
+ "operationId": "typesafe_proxy_route_typesafe__endpoint__post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "endpoint",
+ "required": true,
+ "schema": {
+ "title": "Endpoint",
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "security": [
+ {
+ "APIKeyHeader": []
+ }
+ ],
+ "summary": "Typesafe Proxy Route",
+ "tags": [
+ "llm_passthrough"
+ ]
+ }
+ },
"/vertex_ai/discovery/{endpoint}": {
"delete": {
"description": "Call any vertex discovery endpoint using the proxy.\n\nJust use `{PROXY_BASE_URL}/vertex_ai/discovery/{endpoint:path}`\n\nTarget url: `https://discoveryengine.googleapis.com`",
diff --cc litellm/proxy/pass_through_endpoints/success_handler.py
index 7141bf1d156,699caae819d..df539d687d7
--- a/litellm/proxy/pass_through_endpoints/success_handler.py
+++ b/litellm/proxy/pass_through_endpoints/success_handler.py
@@@ -273,20 -257,25 +274,39 @@@ class PassThroughEndpointLogging
)
standard_logging_response_object = comprehend_medical_handler_result["result"] # rebind-ok: elif-chain
kwargs = comprehend_medical_handler_result["kwargs"] # rebind-ok: elif-chain contract
+ elif self.is_transcribe_route(custom_llm_provider):
+ transcribe_handler_result: Final = TranscribePassthroughLoggingHandler.transcribe_passthrough_handler(
+ httpx_response=httpx_response,
+ logging_obj=logging_obj,
+ url_route=url_route,
+ result=result,
+ start_time=start_time,
+ end_time=end_time,
+ cache_hit=cache_hit,
+ request_body=request_body,
+ **kwargs,
+ )
+ standard_logging_response_object = transcribe_handler_result["result"] # rebind-ok: elif-chain
+ kwargs = transcribe_handler_result["kwargs"] # rebind-ok: elif-chain contract
+ elif self.is_typesafe_route(custom_llm_provider):
+ from .llm_provider_handlers.typesafe_passthrough_logging_handler import (
+ TypeSafePassthroughLoggingHandler,
+ )
+
+ typesafe_handler_result: Final = TypeSafePassthroughLoggingHandler.typesafe_passthrough_handler(
+ httpx_response=httpx_response,
+ response_body=response_body if isinstance(response_body, dict) else MappingProxyType({}),
+ logging_obj=logging_obj,
+ url_route=url_route,
+ result=result,
+ start_time=start_time,
+ end_time=end_time,
+ cache_hit=cache_hit,
+ request_body=request_body,
+ **kwargs,
+ )
+ standard_logging_response_object = typesafe_handler_result["result"]
+ kwargs = typesafe_handler_result["kwargs"]
elif self.is_vertex_ai_live_route(url_route):
from .llm_provider_handlers.vertex_ai_live_passthrough_logging_handler import (
VertexAILivePassthroughLoggingHandler,
@@@ -437,9 -409,9 +457,12 @@@
def is_comprehend_medical_route(self, custom_llm_provider: str | None) -> bool:
return custom_llm_provider == "comprehendmedical"
+ def is_transcribe_route(self, custom_llm_provider: str | None) -> bool:
+ return custom_llm_provider == TRANSCRIBE_CUSTOM_LLM_PROVIDER
+
+ def is_typesafe_route(self, custom_llm_provider: str | None) -> bool:
+ return custom_llm_provider == "typesafe"
+
def is_langfuse_route(self, url_route: str):
parsed_url: Final = urlparse(url_route)
for route in self.TRACKED_LANGFUSE_ROUTES:
diff --cc ui/litellm-dashboard/src/lib/http/schema.d.ts
index 69f62f2ce96,ba2d36c0d02..485a45fcd8d
--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts
+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts
@@@ -16476,59 -16476,30 +16476,83 @@@ export interface paths
patch: operations["toolset_mcp_route_toolset__toolset_name__mcp_patch"];
trace?: never;
};
+ "/transcribe": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Transcribe Sdk Proxy Route
+ * @description AWS-SDK-shaped pass-through for Amazon Transcribe: point the SDK's `endpoint_url`
+ * at `/transcribe` and the operation is read from the `X-Amz-Target` header, per the
+ * AWS JSON 1.1 protocol.
+ *
+ * [Docs](https://docs.litellm.ai/docs/pass_through/transcribe)
+ */
+ post: operations["transcribe_sdk_proxy_route_transcribe_post"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/transcribe/{operation}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ get?: never;
+ put?: never;
+ /**
+ * Transcribe Proxy Route
+ * @description Pass-through for the Amazon Transcribe API, e.g. `POST /transcribe/StartTranscriptionJob`.
+ *
+ * The request body is forwarded to the AWS JSON 1.1 API and signed with SigV4 using the
+ * proxy's AWS credentials. Standard jobs are tagged with the calling key's owner so that
+ * only that owner (or a proxy admin) can read or delete them; account-wide operations
+ * such as ListTranscriptionJobs are limited to proxy admins. Streaming transcription
+ * (`transcribestreaming`) uses a separate HTTP/2 event-stream protocol and is not served
+ * by this route.
+ *
+ * [Docs](https://docs.litellm.ai/docs/pass_through/transcribe)
+ */
+ post: operations["transcribe_proxy_route_transcribe__operation__post"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
+ "/typesafe/{endpoint}": {
+ parameters: {
+ query?: never;
+ header?: never;
+ path?: never;
+ cookie?: never;
+ };
+ /**
+ * Typesafe Proxy Route
+ * @description [Docs](https://docs.litellm.ai/docs/pass_through/typesafe)
+ */
+ get: operations["typesafe_proxy_route_typesafe__endpoint__get"];
+ put?: never;
+ /**
+ * Typesafe Proxy Route
+ * @description [Docs](https://docs.litellm.ai/docs/pass_through/typesafe)
+ */
+ post: operations["typesafe_proxy_route_typesafe__endpoint__post"];
+ delete?: never;
+ options?: never;
+ head?: never;
+ patch?: never;
+ trace?: never;
+ };
"/update/default_team_settings": {
parameters: {
query?: never;