A specialized AgentDriver for local execution of Open source models
via the ollama CLI. Ideal for air-gapped or privacy-sensitive workflows.
Details
Setup: Ensure the ollama server is running locally. You can
specify the binary path via options(HydraR.ollama_path = "...").
Super class
HydraR::AgentDriver -> OllamaDriver
Methods
Method new()
Initialize OllamaDriver
Usage
OllamaDriver$new(
id = "ollama",
model = "llama3.2",
validation_mode = "warning",
working_dir = NULL
)Method format_cli_opts()
Usage
OllamaDriver$format_cli_opts(cli_opts = list())Method call()
Usage
OllamaDriver$call(
prompt,
model = NULL,
system_prompt = NULL,
cli_opts = list(),
...
)Examples
if (FALSE) { # \dontrun{
# 1. Use llama3.2 locally via Ollama
driver <- OllamaDriver$new(model = "llama3.2")
# 2. Call with high-precision sampling and large context window
# Ideal for summarizing long bioinformatics documents.
response <- driver$call(
prompt = "Summarize the technical specifications for the 'samtools' format.",
cli_opts = list(
num_ctx = 32768,
temperature = 0.1,
repeat_penalty = 1.2,
seed = 42
)
)
} # }