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

Add Amazon Bedrock support #97

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kmotohas
Copy link

Overview

This pull request adds support for Amazon Bedrock, AWS's generative AI service, as a backend for LLM and embedding models in nano-graphrag.

Changes

  • Integration of Asynchronous AWS SDK for Python (aioboto3)
  • Implementation of LLM interface for Amazon Bedrock
    • Added support for Claude 3.5 Haiku, Claude 3 Haiku, and Claude 3 Sonnet models
    • Implemented amazon_bedrock_complete_if_cache function for model inference
  • Implementation of embedding interface for Amazon Bedrock
    • Added amazon_bedrock_embedding function using Titan Embed Text v2 model
  • Updated configuration options to include Amazon Bedrock support
  • Modified existing functions to accommodate Amazon Bedrock integration

How to Test

  1. Set up AWS credentials:
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_REGION=us-east-1  # or your preferred region
  1. Update your code to use Amazon Bedrock models and embeddings
graph_func = GraphRAG(working_dir="./working_dir", using_amazon_bedrock=True)

Note

  • Ensure proper IAM permissions are set up for accessing Amazon Bedrock

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.

1 participant