Skip to main content

Configuring Bedrock for the Verodat API

Set up Bedrock on AWS and enable access to multiple LLM models within Verodat

Requirements:

  • Login access to an AWS account with sufficient permissions to create and use resources

  • Login access to a Verodat account

Why set up Bedrock?

Amazon Bedrock provides easy access to various foundational LLM models from different AI providers, including Amazon and Anthropic.

Bedrock's unified interface that makes it easy to access multiple LLM models from within Verodat, so you can quickly and easily change your prompt and the model you'd like to send it to from within the Verodat interface.

By using Bedrock, you can choose the best model suited to your needs without worrying about infrastructure management, allowing seamless scaling, model updates, and cost optimisation.

Step 1: Enable Bedrock within AWS

Steps to follow:

  1. In the services searchbar, search for and select ‘Bedrock’.


  2. Click the button that says ‘Get Started’

  3. At the sidebar on the left scroll down to ‘Bedrock Configurations’ and then select ‘Model Access’

  4. Request access for all of the Amazon and all of the Anthropic models.

  5. This should only take a few mins, wait and then refresh the page to confirm that you have been granted access to the models.

Step 2: Create a lambda (serverless function)

Why is this needed?

AWS Lambda provides a serverless environment to handle requests dynamically without managing server infrastructure. Lambda allows the code to scale automatically in response to incoming events, making it ideal for processing prompt-based AI model invocations from Bedrock.

By deploying the lambda_handler, the solution can trigger different model generation functions based on the incoming request, dynamically routing the event to the appropriate model (Amazon, Anthropic, or Cohere) based on the provided model ID. Lambda also facilitates the integration of Boto3 for invoking Bedrock models.

Steps to follow:

  1. In the AWS console search bar you should now search for and select ‘Lambda’

  2. Select ‘Create function’

  3. Select ‘Author from scratch’

  4. In Basic Information, add the following details:

    1. Name the function

    2. Select the Python 3.12 Runtime

    3. Select x86_64 Architecture

    4. Create a role with sufficient permissions that meets your internal security requirements

  5. In Advance Settings:

    1. Leave everything else as default

  6. Select ‘Create Function’

  7. Scroll down to ‘Code’ select ‘Upload from’ and then ‘.zip file’

Step 3: Set up the API Gateway

Why is this needed?

By setting up API Gateway, you create a secure, scalable entry point for HTTP requests that trigger the Lambda function handling Bedrock model requests. It enables external applications like Verodat to send prompts and model IDs in a standardised way, while API Gateway manages the request routing, authorisation, and scaling.

Steps to follow:

  1. In the AWS console search bar you should now search for and select ‘API Gateway’

  2. Under REST API select ‘Build’

  3. Name the API, everything else can stay as default

  4. Select ‘Create API’

  5. Select ‘Create Resource’

  6. Name the resource ‘Bedrock’

  7. Under the resource create a ‘Method’

    1. For “Method Type’ select Put

    2. For ‘Integration Type’ select Lambda Function


  8. Create the below settings in the next screen. The Lambda function should be the one that you created earlier:

    1. Integration type: Lambda

    2. Lambda proxy integration: False

    3. Region: eu-central-1

    4. Lambda function: verodat

    5. Timeout: default

9. Still within the API Gateway, navigate to Integration Request settings as shown in the following screenshot:

and then enter the following details:


Did this answer your question?