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

Added Streaming Capability to SageMaker LLMs #10535

Merged
merged 10 commits into from
Oct 5, 2023

Conversation

dazajuandaniel
Copy link
Contributor

This PR adds the ability to declare a Streaming response in the SageMaker LLM by leveraging the invoke_endpoint_with_response_stream capability in boto3. It is heavily based on the AWS Blog Post announcement linked here.

It does not add any additional dependencies since it uses the existing boto3 version.

@vercel
Copy link

vercel bot commented Sep 13, 2023

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

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 5, 2023 6:14pm

@dosubot dosubot bot added Ɑ: models Related to LLMs or chat model modules 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features labels Sep 13, 2023
@baskaryan
Copy link
Collaborator

cc @3coins

@baskaryan baskaryan added the 🔌: aws Primarily related to Amazon Web Services (AWS) integrations label Sep 13, 2023
Copy link
Contributor

@3coins 3coins left a comment

Choose a reason for hiding this comment

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

@dazajuandaniel
This is awesome! Thanks for adding this. I don't have a model setup to test, but code looks good. 🚀

One minor suggestion for a follow up PR, would be nice to move the streaming/non-streaming parts to separate private functions for better readability.

@dazajuandaniel
Copy link
Contributor Author

@dazajuandaniel This is awesome! Thanks for adding this. I don't have a model setup to test, but code looks good. 🚀

One minor suggestion for a follow up PR, would be nice to move the streaming/non-streaming parts to separate private functions for better readability.

Hey @3coins,
Thanks for approving this PR!

Yes, I agree. I am happy to work on the follow up PR, no issues. I tried to follow the pattern that replicate has.

@dazajuandaniel
Copy link
Contributor Author

@baskaryan - please let me know if anything is missing :)

@baskaryan
Copy link
Collaborator

lgtm aside from linting issues. would also be nice to factor out stream implementation into the _stream method defined on parent class, but can also do that in follow up pr

@pinak-p
Copy link

pinak-p commented Sep 26, 2023

@dazajuandaniel, @3coins - Is this good to be merged ?

@3coins
Copy link
Contributor

3coins commented Sep 26, 2023

@baskaryan
This has been open for a while, is there anything needed to merge this?

@dazajuandaniel
Copy link
Contributor Author

@pinak-p I was missing a mypy fix, I've done it now

@baskaryan baskaryan added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Oct 5, 2023
@baskaryan
Copy link
Collaborator

sorry for the delay, thank you @dazajuandaniel!

@baskaryan baskaryan merged commit 4236ae3 into langchain-ai:master Oct 5, 2023
30 checks passed
@jay2jp
Copy link

jay2jp commented Oct 25, 2023

Is there any documentation on this? I cant seem to find any. @dazajuandaniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: aws Primarily related to Amazon Web Services (AWS) integrations 🤖:enhancement A large net-new component, integration, or chain. Use sparingly. The largest features lgtm PR looks good. Use to confirm that a PR is ready for merging. Ɑ: models Related to LLMs or chat model modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants