garak.generators.ollama

Ollama interface

class OllamaGenerator(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 Ollama endpoints

Model names can be passed in short form like “llama2” or specific versions or sizes like “gemma:7b” or “llama2:latest”

Configurable parameters:

DEFAULT_PARAMS contents:

  • max_tokens = 150

  • temperature = None

  • top_k = None

  • context_len = None

  • skip_seq_start = None

  • skip_seq_end = None

  • timeout = 30

  • host = '127.0.0.1:11434'

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

active = True
extra_dependency_names = ['ollama']
generator_family_name = 'Ollama'
parallel_capable = False
class OllamaGeneratorChat(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/garak/_config.py'>)Source

Bases: OllamaGenerator

Interface for Ollama endpoints, using the chat functionality

Model names can be passed in short form like “llama2” or specific versions or sizes like “gemma:7b” or “llama2:latest”