garak.generators.anthropic

Support Anthropic hosted Claude models

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

Bases: Generator

Interface for Claude models served via the Anthropic API (api.anthropic.com).

Expects an API key in the ANTHROPIC_API_KEY environment variable. Keys are issued at https://console.anthropic.com/.

Configurable parameters:

DEFAULT_PARAMS contents:

  • max_tokens = 150

  • temperature = None

  • top_k = None

  • context_len = None

  • skip_seq_start = None

  • skip_seq_end = None

  • uri = None

  • suppressed_params = set()

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

ENV_VAR = 'ANTHROPIC_API_KEY'
extra_dependency_names = ['anthropic']
fullname = 'Anthropic'
generator_family_name = 'anthropic'
supports_multiple_generations = False