ProtectedbaseProtectedcachedThe last successful discovery, while younger than modelCacheTtlMs (default 5 min; 0 disables).
ProtectedclassifyProvider-specific reading of an error body. Return the fields you can
tell from it (code, providerCode, hint, retryAfterMs); the status
code default fills the rest.
Create a model from a Modelfile using ollama create -f <path> or ollama create <name> -f <path>.
ProtectederrorA fresh AIError for a failure this provider detects itself (no key, no model, blocked answer).
ProtectederrorOptionalmodel: stringProtectedfailOptionalmodelUsed: stringProtectedhttpJSON request. Non-2xx throws [HttpError]; the JSON body (if any) is on .json.
ProtectedhttpJSON request with the reply's status and headers (request ids live there).
ProtectedhttpStreaming request: the body as an async iterable of bytes, idle-guarded. Non-2xx throws [HttpError].
Check if the Ollama CLI is available on the system (needs cli in the config).
List models (API: GET /api/tags, fallback: ollama ls).
ProtectedokOllama's /api/chat with stream: true, which answers in NDJSON: one
JSON object per line, the last carrying done and the token counts.
List running models (API: GET /api/ps, fallback: ollama ps).
Pull a model (API: POST /api/pull, fallback: ollama pull <model>).
ProtectedrequestThe per-request knobs (signal, timeouts) as http options.
Remove a model (API: DELETE /api/delete, fallback: ollama rm <model>).
Run a model with an optional prompt (API: POST /api/generate when prompt given, fallback: ollama run).
Optionalprompt: stringRun any native ollama CLI command.
Start the Ollama server using ollama serve.
ProtectedsetRecords what discovery found, keeping any seeded models first so the caller's chosen default stays the default.
Show model info (API: POST /api/show, fallback: ollama show <model>).
Stop a running model using ollama stop <model>.
Cheap by default: "up" means at least one model can be listed. No generation is sent.
ProtectedtoAny thrown value → AIError carrying this provider's classification.
Optionalmodel: string
Origin this provider talks to; shown in
PROVIDER_UNREACHABLEhints.