Skip to content

[Feat] LiteLLM Allow setting Uvicorn Keep Alive Timeout #11594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 10, 2025

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Jun 10, 2025

[Feat] LiteLLM Allow setting Uvicorn Keep Alive Timeout

This PR adds support for configuring the Uvicorn keepalive timeout in LiteLLM

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature
✅ Test

Changes

Copy link

vercel bot commented Jun 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 8:06pm

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ishaan-jaff
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for configuring the Uvicorn keepalive timeout in LiteLLM, enhancing the server configuration flexibility. Key changes include adding a new CLI option and associated parameter in the Uvicorn initialization helper, updating tests for the new parameter, and documenting the feature in deployment instructions.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_litellm/proxy/test_proxy_cli.py Added tests to verify the keepalive_timeout flag and parameter usage.
litellm/proxy/proxy_cli.py Introduced the keepalive_timeout parameter in CLI and helper methods.
docs/my-website/docs/proxy/deploy.md Updated documentation with usage examples for keepalive_timeout.
Comments suppressed due to low confidence (1)

docs/my-website/docs/proxy/deploy.md:688

  • The documentation specifies a default keepalive timeout of 5 seconds, but the CLI option default is None and no default value is set in the helper function. Please update the code to set a default of 5 seconds or modify the docs to reflect the current behavior.
Defaults to 5 seconds. Between requests, connections must receive new data within this period or be disconnected.

@ishaan-jaff ishaan-jaff merged commit 55cd5f0 into main Jun 10, 2025
38 of 46 checks passed
stefan-- pushed a commit to stefan--/litellm that referenced this pull request Jun 12, 2025
* Add keepalive timeout option for uvicorn server configuration

* docs Keepalive Timeout

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
X4tar pushed a commit to X4tar/litellm that referenced this pull request Jun 17, 2025
* Add keepalive timeout option for uvicorn server configuration

* docs Keepalive Timeout

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants