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

✨ Ability to use Amazon Bedrock models such as Claude 3.5 Sonnet #289

Merged
merged 2 commits into from
Aug 10, 2024

Conversation

jwmatthews
Copy link
Member

This allows us to use models deployed in Amazon Bedrock

The Claude3 models seem to be a little behind with langchain integration, I needed to use an older library to access them as they aren't yet available in langchain_aws.llms.bedrock.BedrockLLM

Signed-off-by: John Matthews <jwmatthews@gmail.com>
Signed-off-by: John Matthews <jwmatthews@gmail.com>
Copy link
Contributor

@JonahSussman JonahSussman left a comment

Choose a reason for hiding this comment

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

LGTM, just a small comment on the dependencies

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder why this is no longer necessary

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm unsure why greenlet was removed, I don't think its from this PR.

I ran pip-compile on current main (not this PR) and I see greenlit is being removed

$ pip-compile --allow-unsafe

$ git diff
diff --git a/requirements.txt b/requirements.txt
index 1cb26bc..683b395 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -20,6 +20,8 @@ anyio==4.4.0
     #   httpx
     #   jupyter-server
     #   openai
+appnope==0.1.4
+    # via ipykernel
 argon2-cffi==23.1.0
     # via jupyter-server
 argon2-cffi-bindings==21.2.0
@@ -64,6 +66,8 @@ click==8.1.7
     #   typer
 comm==0.2.2
     # via ipykernel
+coverage==7.6.0
+    # via -r requirements.in
 dataclasses-json==0.6.7
     # via langchain-community
 debugpy==1.8.2
@@ -97,8 +101,6 @@ gitdb==4.0.11
     # via gitpython
 gitpython==3.1.43
     # via -r requirements.in
-greenlet==3.0.3
-    # via sqlalchemy
 gunicorn==22.0.0
     # via -r requirements.in
 h11==0.14.0

Copy link
Member

Choose a reason for hiding this comment

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

Not answering your question directly, but it is supposed to be an optional dependency:
sqlalchemy/sqlalchemy#10197

I can't install it without greenlet even after removing langchain and langchain-community, which appear to be the only two things requiring it.

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as everything still works I'm good with it, just pointing it out

Copy link
Member

Choose a reason for hiding this comment

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

https://docs.sqlalchemy.org/en/20/faq/installation.html

The greenlet dependency does not install by default for CPU architectures for which greenlet does not supply a [pre-built binary wheel](https://pypi.org/project/greenlet/#files). Notably, this includes Apple M1. To install including greenlet, add the asyncio [setuptools extra](https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-setuptools-extras) to the pip install command:

Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure the above explains it.

Copy link
Member

@jmontleon jmontleon Aug 9, 2024

Choose a reason for hiding this comment

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

If I update sqlalchemy to 2.0.32 in the requirements.in it looks like it is recognized as optional and unnecessary on Fedora rawhide / python 3.13 as well; not having any effect on Fedora 40 / 3.12

Copy link
Member

Choose a reason for hiding this comment

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

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Member

Choose a reason for hiding this comment

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

Not answering your question directly, but it is supposed to be an optional dependency:
sqlalchemy/sqlalchemy#10197

I can't install it without greenlet even after removing langchain and langchain-community, which appear to be the only two things requiring it.

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Member

Choose a reason for hiding this comment

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

https://docs.sqlalchemy.org/en/20/faq/installation.html

The greenlet dependency does not install by default for CPU architectures for which greenlet does not supply a [pre-built binary wheel](https://pypi.org/project/greenlet/#files). Notably, this includes Apple M1. To install including greenlet, add the asyncio [setuptools extra](https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-setuptools-extras) to the pip install command:

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure the above explains it.

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Member

@jmontleon jmontleon Aug 9, 2024

Choose a reason for hiding this comment

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

If I update sqlalchemy to 2.0.32 in the requirements.in it looks like it is recognized as optional and unnecessary on Fedora rawhide / python 3.13 as well; not having any effect on Fedora 40 / 3.12

@@ -97,8 +107,6 @@ gitdb==4.0.11
# via gitpython
gitpython==3.1.43
# via -r requirements.in
greenlet==3.0.3
Copy link
Member

Choose a reason for hiding this comment

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

@jwmatthews jwmatthews merged commit 22a575c into konveyor:main Aug 10, 2024
5 checks passed
@jwmatthews jwmatthews deleted the bedrock branch August 10, 2024 14:15
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