You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add configurable timeout for passthrough endpoints
- Fix hardcoded 600-second timeout on pass-through endpoints that caused TimeoutError for long-running streaming requests (e.g. Anthropic API calls with extended thinking/tool use)
- Add timeout field to PassThroughGenericEndpoint config, allowing per-endpoint timeout configuration
- Fix aiohttp compatibility issue with ConnectionTimeoutError/SocketTimeoutError on older versions (not necessary for this PRs purpose, but good to have)
- Added tests
Copy file name to clipboardExpand all lines: litellm/proxy/_types.py
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1931,6 +1931,10 @@ class PassThroughGenericEndpoint(LiteLLMPydanticObjectBase):
1931
1931
default=False,
1932
1932
description="If True, requests to subpaths of the path will be forwarded to the target endpoint. For example, if the path is /bria and include_subpath is True, requests to /bria/v1/text-to-image/base/2.3 will be forwarded to the target endpoint.",
1933
1933
)
1934
+
timeout: Optional[float] =Field(
1935
+
default=None,
1936
+
description="Timeout in seconds for requests to the target endpoint. Defaults to 600 seconds if not specified.",
1937
+
)
1934
1938
cost_per_request: float=Field(
1935
1939
default=0.0,
1936
1940
description="The USD cost per request to the target endpoint. This is used to calculate the cost of the request to the target endpoint.",
0 commit comments