garak.generators.bedrock

AWS Bedrock generator

Supports foundation models available through AWS Bedrock using standard AWS authentication.

To get started with this generator:

  1. Visit https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html to see available models

  2. Set up AWS credentials: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html or a Bedrock API Key

  3. Run garak with –target_type bedrock and –target_name <model-id>

class BedrockGenerator(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source

Bases: Generator

Interface for AWS Bedrock foundation models using Converse API

Configurable parameters:

DEFAULT_PARAMS contents:

  • max_tokens = 150

  • temperature = 0.7

  • top_k = None

  • context_len = None

  • skip_seq_start = None

  • skip_seq_end = None

  • top_p = 1.0

  • stop = []

  • region = 'us-east-1'

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

active = True
extra_dependency_names = ['boto3', 'botocore']
generator_family_name = 'Bedrock'
supports_multiple_generations = False