Skip to content

Amazon Bedrock

Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models from leading AI companies like AI21 Labs, Anthropic, Cohere, Stability AI, and Amazon with a single API, along with a broad set of capabilities you need to build generative AI applications, simplifying development while maintaining privacy and security.

Before setting up

Before you can connect you need to make sure that:

  • You have an AWS root user account or IAM user created by root user for you.
  • You have an access key and secret generated for your IAM user.
  • You have access to models you want to use. You must request access to a model before you can use it. If you try to use the model before you have requested access to it, you receive an error.

Create IAM user

  • Go to Identity and Access Management.
  • Select Users from the left sidebar.
  • Click Create user.
  • Enter User name and click Next.
  • Select Attach policies directly option from Permissions options.
  • Add AdministratorAccess and AmazonEC2FullAccess policies, then click Next.
  • Review user details and permissions, then click Create user.

IAM user creation

Generate access key

  • Go to Identity and Access Management.
  • Select Users from the left sidebar.
  • Select the user for whom you want to generate an access key.
  • Go to the Security credentials tab.
  • Scroll down to the Access keys section and click Create access key.
  • Select Use case and click Next.
  • Enter Description tag value and click Create access key.
  • Save Access key and Secret access key values to be able to connect to Amazon Bedrock via Blackbird.

Add model access

Change region

  • Select Model access from the left sidebar and click Edit.
  • Select the models you want to have access to and click Save changes.
  • Models will show as Access granted under Access status, if access is granted.

Connecting

  1. Navigate to apps and search for Amazon Bedrock. If you cannot find Amazon Bedrock then click Add App in the top right corner, select Amazon Bedrock and add the app to your Blackbird environment.
  2. Click Add Connection.
  3. Name your connection for future reference e.g. ‘My organization’.
  4. Fill in the access key and secret obtained in the previous section.
  5. Click Connect.
  6. Confirm that the connection has appeared and the status is Connected.

Connecting

Actions

Text

  • Generate text with AI21 Labs Jurassic-2 generates text with AI21 Labs Jurassic-2 model or any custom model that is based on AI21 Labs Jurassic-2 model.
  • Generate text with Meta Llama 2 generates text with Meta Llama 2 model or any custom model that is based on Meta Llama 2 model.
  • Generate text with Anthropic Claude generates text with Anthropic Claude model or any custom model that is based on Anthropic Claude model.
  • Generate text with Cohere Command generates text with Cohere Command model or any custom model that is based on Cohere Command model.
  • Generate text with Amazon Titan generates text with Amazon Titan model or any custom model that is based on Amazon Titan model.

Image

  • Generate image with Stability.ai Diffusion generates text with Stability.ai Diffusion model or any custom model that is based on Stability.ai Diffusion model.
  • Generate or edit image with Amazon Titan Image generates or edits an image with Amazon Titan Image model or any custom model that is based on Amazon Titan Image model. If you plan to generate an image, leave the Image parameter unspecified. Otherwise, if you are editing an existing image, specify the Image parameter with the appropriate image file. Please note that the maximum input character limit is 1024, and for image generation tasks, the allowed maximum image size is 4,096 x 4,096 pixels. Learn more about the limitations of the Amazon Titan Image Generator G1 model here.

Embedding

  • Generate embedding generates embedding vector for a text provided. An embedding is a list of floating point numbers that captures semantic information about the text that it represents. Embeddings can be used to store data in vector databases (like Pinecone).

Within both the Text and Image sections, each action includes an optional input parameter named Is Blackbird prompt. Setting this parameter to True indicates that the provided prompt is a result of one of AI Utilities app’s actions, and it defaults to False.

Feedback

Do you want to use this app or do you have feedback on our implementation? Reach out to us using the established channels or create an issue.