-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Enable System Proxy Support for aiohttp Transport #11616
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a test in tests/test_litellm/llms/custom_httpx/test_http_handler.py
@ishaan-jaff done ![]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @idootop our testing pipeline found that with trust_env a blocking call gets added. It looks like the following happens
I want to help here and I think this PR allows you to use HTTPS env variables too: #11217 I will merge 11217 into main, can you help confirm it works. If not please can you help with approaches that add this support but don't add blocking sync calls. Blocking sync calls are costly for us Full trace of blocking. You can use https://github.com/cbornet/blockbuster to see the same.
|
This reverts commit 33c134c.
Hi @ishaan-jaff. Thanks for the feedback. Unfortunately, #11217 won't work as expected due to several issues:
Regarding aiohttp's While these issues could potentially be resolved by properly configuring mounts with SSL settings, I won't be working on this further as I'm not a maintainer of this library. Good luck with the implementation! |
* feat: enable proxy for aiohttp, fixes 11389 * chore: add test for aiohttp trust env * style: format litellm/__init__.py
)" This reverts commit 33c134c.
* feat: enable proxy for aiohttp, fixes 11389 * chore: add test for aiohttp trust env * style: format litellm/__init__.py
Enable System Proxy Support for aiohttp Transport
After switching to
aiohttp
as the default HTTP transport, system proxy configurations (HTTP_PROXY) are no longer automatically detected, which differs from the previoushttpx
behavior.This PR enables trust_env by default in
aiohttp
transport to maintain consistent proxy behavior when reading from environment variables.Relevant issues
Fixes #11389
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🐛 Bug Fix
Changes
trust_env=True
by default foraiohttp
clientDISABLE_AIOHTTP_TRUST_ENV
litellm.disable_aiohttp_trust_env
This change ensures backward compatibility with previous proxy behavior while maintaining flexibility for users who need to disable this feature.