Creates a hardened backend targeting a local or remote Ollama server
(/api/chat) via httr2 with strict URL validation, bounded response
sizes, structured JSON/schema constraints, and jittered backoff retries.
Arguments
- model
Default Ollama model tag (e.g.,
"llama3.2","qwen2.5:7b").- base_url
Ollama HTTP/HTTPS base URL without trailing slash.
- system_prompt
Optional system instruction prepended to messages.
- format
Structured output constraint:
"schema"(sends full JSON Schema),"json"(sends"json"), or"none".- timeout
Request timeout in seconds. Default
120.- max_retries
Maximum HTTP retry attempts on transient errors.
- backoff_base
Base backoff seconds for jittered exponential retry.
- max_response_bytes
Maximum allowed response payload size in bytes. Default
1048576L(1 MiB).- options
Named list of additional Ollama model options (e.g.,
seed,num_ctx).- transport
Optional custom transport function
function(req_spec)for offline testing.
