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 AWS Bedrock support #750

Merged
merged 19 commits into from
Nov 20, 2023
Merged

Add AWS Bedrock support #750

merged 19 commits into from
Nov 20, 2023

Conversation

lgrammel
Copy link
Collaborator

@lgrammel lgrammel commented Nov 17, 2023

Summary

  • Add AWSBedrockAnthropicStream for AWS Bedrock Anthropic models.
  • Extract experimental_buildAnthropicPrompt helper for building prompts in the Anthropic format
  • Add AWSBedrockCohereStream for AWS Bedrock Cohere models.

Unsupported models

  • AI21 Labs: does not support streaming
  • Amazon Titan: unavailable

Tasks

  • Add Bedrock/Anthropic support
  • Add tests for Bedrock/Anthropic
  • Add Bedrock/Anthropic example
  • Add Bedrock/Cohere support
  • Add tests for Bedrock/Cohere
  • Add Bedrock/Cohere example
  • Add Bedrock/Llama2 support
  • Add tests for Bedrock/Llama2
  • Add Bedrock/Llama2 example
  • Document example
  • Add documentation
  • Add changeset

@lgrammel lgrammel self-assigned this Nov 17, 2023
// Extract the `prompt` from the body of the request
const { messages } = await req.json();

const bedrockClient = new BedrockRuntimeClient({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Defining the bedrock client outside the POST leads to errors in the edge build.

@lgrammel lgrammel changed the title [WIP] AWS Bedrock support Add AWS Bedrock support Nov 20, 2023
@lgrammel lgrammel marked this pull request as ready for review November 20, 2023 11:26
@MaxLeiter MaxLeiter merged commit c2369df into vercel:main Nov 20, 2023
8 checks passed
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

2 participants