Creates a runtime backend targeting a strictly local loopback Ollama server
(/api/chat). Rejects any non-loopback host URL at construction time and
disables all outbound HTTP proxies (noproxy = "*") on every request.
Usage
runtime_ollama(
model,
host = "http://127.0.0.1:11434",
temperature = 0,
seed = 42L,
top_p = 1,
num_ctx = 4096L,
num_predict = 1024L,
timeout = 120,
container_spec = NULL,
model_digest = NULL,
transport = NULL
)Arguments
- model
Character scalar Ollama model name/tag (e.g.,
"llama3.1:8b-instruct-q4_K_M").- host
Character scalar loopback URL (default
"http://127.0.0.1:11434"). Non-loopback hosts trigger an immediateairgap_isolation_error.- temperature
Numeric decoding temperature (default
0for determinism).- seed
Integer random seed passed to Ollama (default
42L).- top_p
Numeric nucleus sampling parameter (default
1).- num_ctx
Integer context window size (default
4096L).- num_predict
Integer maximum generated tokens (default
1024L).- timeout
Numeric per-request timeout in seconds (default
120).- container_spec
Optional
airgap_container_spec()associated with this runtime.- model_digest
Optional pinned SHA-256 digest of the model weights.
- transport
Optional custom
httr2mock transport functionfunction(req) httr2::response(...)for offline HTTP testing.
Examples
rt <- runtime_ollama("llama3.1:8b-instruct-q4_K_M")
print(rt)
#> <airgap_runtime:ollama>
#> Model: llama3.1:8b-instruct-q4_K_M
#> Endpoint: http://127.0.0.1:11434 (loopback)
#> Temperature: 0 | Seed: 42
