ui/server/src/ollama
Thin wrapper around Ollama's local HTTP API (default http://localhost:11434, overridable via OLLAMA_HOST for anyone running it on a non-default port/host).
Cockpit server, v0.9. Source: ui/server/src/ollama.mjs.
Functions#
getOllamaStatus()#
getOllamaStatus():
Promise<{host?:undefined;running:boolean;version?:undefined; } | {host:any;running:boolean;version:any; } | {host:any;running:boolean;version?:undefined; }>
Defined in: ui/server/src/ollama.mjs:21
Is the local Ollama daemon up? Never throws — a non-running daemon (the expected case when Ollama isn't installed, or isn't started) is a normal, reportable state, not an error.
Returns#
Promise<{ host?: undefined; running: boolean; version?: undefined; } | { host: any; running: boolean; version: any; } | { host: any; running: boolean; version?: undefined; }>
listOllamaModels()#
listOllamaModels():
Promise<any>
Defined in: ui/server/src/ollama.mjs:35
Installed models, as Ollama's own /api/tags reports them (name, size,
modified date, etc.) — passed through as-is rather than reshaped, so the
UI has access to whatever Ollama itself considers a model's identity.
Returns#
Promise<any>
removeOllamaModel()#
removeOllamaModel(
name):Promise<{removed:any; }>
Defined in: ui/server/src/ollama.mjs:59
Parameters#
name
any
Returns#
Promise<{ removed: any; }>
startOllamaPull()#
startOllamaPull(
name):Promise<any>
Defined in: ui/server/src/ollama.mjs:47
Starts a model pull and returns the raw fetch Response so the caller (the /api/ollama/pull route) can stream Ollama's own newline-delimited JSON progress events straight through to the browser as they arrive, instead of buffering a multi-GB download in memory. No timeout here — a real pull can legitimately run for many minutes.
Parameters#
name
any
Returns#
Promise<any>