Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Will 265ffe6dae
docs: Improves `contextTransform` documentation (#4854)
1 month ago
..
e19b816373
feat(providers): Add support for Amazon nova-sonic (#3713)
3 months ago
64ff16b7ec
feat: add contextTransform support for RAG evaluation (#4467)
1 month ago
be8378f864
feat: base64 loader for images (#3262)
5 months ago
be8378f864
feat: base64 loader for images (#3262)
5 months ago
e19b816373
feat(providers): Add support for Amazon nova-sonic (#3713)
3 months ago
c336f62f94
fix: handle malformed response in a21 (#3465)
5 months ago
7857266c65
chore(providers): add Claude 4 support to anthropic, bedrock, and vertex providers (#4129)
3 months ago
753224f8ee
docs(examples): update Amazon Bedrock provider documentation (#3401)
5 months ago
265ffe6dae
docs: Improves `contextTransform` documentation (#4854)
1 month ago
f9339c84fd
chore(providers): add llama4 support for bedrock (#3850)
3 months ago
28a8e6a04e
fix(providers): support token counting for every major type of bedrock model (#3506)
5 months ago
e19b816373
feat(providers): Add support for Amazon nova-sonic (#3713)
3 months ago
be8378f864
feat: base64 loader for images (#3262)
5 months ago
f14f76e927
fix(providers): add regional model support to bedrock (#2354)
8 months ago
59b3d1cbc8
chore: add support for Amazon Nova Premier model (#3951)
3 months ago
f14f76e927
fix(providers): add regional model support to bedrock (#2354)
8 months ago
7857266c65
chore(providers): add Claude 4 support to anthropic, bedrock, and vertex providers (#4129)
3 months ago
e13d106ec3
feat: claude-based models on amazon bedrock (#298)
1 year ago

README.md

You have to be logged in to leave a comment. Sign In

amazon-bedrock (Amazon Bedrock Examples)

You can run this example with:

npx promptfoo@latest init --example amazon-bedrock

Prerequisites

  1. Set up your AWS credentials:

    export AWS_ACCESS_KEY_ID="your_access_key"
    export AWS_SECRET_ACCESS_KEY="your_secret_key"
    

    See authentication docs for other auth methods, including SSO profiles.

  2. Request model access in your AWS region:

    • Visit the AWS Bedrock Model Access page
    • Switch to your desired region. We recommend us-west-2 and us-east-1 which tend to have the most models available.
    • Enable the models you want to use.
  3. Install required dependencies:

    # For basic Bedrock models
    npm install @aws-sdk/client-bedrock-runtime
    
    # For Knowledge Base examples
    npm install @aws-sdk/client-bedrock-agent-runtime
    

Available Examples

This directory contains several example configurations for different Bedrock models:

Knowledge Base Example

The Knowledge Base example (promptfooconfig.kb.yaml) demonstrates how to use AWS Bedrock Knowledge Base for Retrieval Augmented Generation (RAG).

Knowledge Base Setup

For this example, you'll need to:

  1. Create a Knowledge Base in AWS Bedrock
  2. Configure it to crawl or ingest content (the example assumes promptfoo documentation content)
  3. Use the Amazon Titan Embeddings model for vector embeddings
  4. Update the config with your Knowledge Base ID:
providers:
  - id: bedrock:kb:us.anthropic.claude-sonnet-4-20250514-v1:0
    config:
      region: 'us-east-2' # Change to your region
      knowledgeBaseId: 'YOUR_KNOWLEDGE_BASE_ID' # Replace with your KB ID

When running the Knowledge Base example, you'll see:

  • Responses from a Knowledge Base-enhanced model with citations
  • Responses from a standard model for comparison
  • Citations from source documents that show where information was retrieved from
  • Example of contextTransform feature extracting context from citations for evaluation

The example includes questions about promptfoo configuration, providers, and evaluation techniques that work well with the embedded promptfoo documentation.

Note: You'll need to update the knowledgeBaseId with your actual Knowledge Base ID and ensure the Knowledge Base is configured to work with the selected Claude model.

For detailed Knowledge Base setup instructions, see the AWS Bedrock Knowledge Base Documentation.

Getting Started

  1. Run the evaluation:

    promptfoo eval -c [path/to/config.yaml]
    
  2. View the results:

    promptfoo view
    
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...