Skip to content
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

[Fix] LiteLLM Proxy - Streaming Sagemaker Support on /chat/completions #1569

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

ishaan-jaff
Copy link
Contributor

@ishaan-jaff ishaan-jaff commented Jan 23, 2024

Problem - LiteLLM Proxy - Sagemaker Streaming Calls Hang on Client Side

This is caused because we use boto3 and it is not async, we pass the response to async_data_generator on the litellm proxy. The proxy expects a non blocking stream but since sagemaker responses are not truly async it blocks yielding any chunks

Fix

  • If the response is from sagemaker use a sync data_generator
  • We were skipping some streaming chunks for sagemaker, this PR fixes that too

Long Term Fix

  • Move sagemaker, boto3 calls to be truly async

Copy link

railway-app bot commented Jan 23, 2024

This PR is being deployed to Railway 🚅

litellm: ◻️ REMOVED

Copy link

vercel bot commented Jan 23, 2024

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 Jan 23, 2024 8:33pm

@ishaan-jaff
Copy link
Contributor Author

passes testing - merging

@ishaan-jaff ishaan-jaff merged commit 861587e into main Jan 23, 2024
3 of 7 checks passed
@ishaan-jaff ishaan-jaff deleted the litellm_proxy_sagemaker_streaming branch January 23, 2024 20:35
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.

None yet

1 participant