garak.generators.ollama

Ollama interface

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

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”

DEFAULT_PARAMS = {'context_len': None, 'host': '127.0.0.1:11434', 'max_tokens': 150, 'temperature': None, 'timeout': 30, 'top_k': None}
active = True
generator_family_name = 'Ollama'
parallel_capable = False
class garak.generators.ollama.OllamaGeneratorChat(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

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”