Skip to contents

Connects to an Ollama server over its REST API (GET /api/tags) and returns the models it has available. Use it to confirm rmorie can reach your Ollama instance and to see the exact model names you can pass as the model argument or via the OLLAMA_MODEL environment variable – rmorie bundles no model and assumes none, so you bring your own.

Usage

morie_llm_ollama_models(base = .morie_llm_ollama_base(), timeout = 5)

Arguments

base

Ollama base URL. Defaults to OLLAMA_HOST / OLLAMA_BASE_URL, else http://localhost:11434.

timeout

Request timeout in seconds. Default 5.

Value

A data.frame, one row per model, with columns name, size_gb, family, parameter_size and quantization. Zero rows when the server is unreachable or serves no models (never errors), so it doubles as a connectivity test.

Details

Point OLLAMA_HOST (or OLLAMA_BASE_URL) at ANY reachable Ollama-compatible server: a local daemon (http://localhost:11434, the default), a machine on your network, or a remote / Cloudflare-tunnelled gateway. A local daemon needs no key; set OLLAMA_API_KEY for gateways that require a bearer token.

Examples

# \donttest{
# Point at your own Ollama server, then see what it serves:
Sys.setenv(OLLAMA_HOST = "http://localhost:11434")
models <- morie_llm_ollama_models()
models$name
#> character(0)
# }