garak.generators.groq

GroqChat API support

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

Bases: OpenAICompatible

Wrapper for Groq-hosted LLM models.

Expects GROQ_API_KEY environment variable. See https://console.groq.com/docs/quickstart for more info on how to set up a Groq API key Uses the OpenAI-compatible 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

  • uri = 'https://api.groq.com/openai/v1'

  • frequency_penalty = 0.0

  • presence_penalty = 0.0

  • seed = None

  • stop = ['#', ';']

  • suppressed_params = {'logit_bias', 'n', 'presence_penalty', 'frequency_penalty', 'top_logprobs', 'logprobs'}

  • retry_json = True

  • extra_params = {}

  • vary_seed_each_call = True

  • vary_temp_each_call = True

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

ENV_VAR = 'GROQ_API_KEY'
active = True
generator_family_name = 'Groq'
supports_multiple_generations = False