Ollama client state management with simplified API.
Model data is stored in app.models, not here.
Status Display Pattern
For unified status display (available/unavailable/checking), components should use:
- app.capabilities.ollama.status - unified status (prioritizes provider status)
- app.capabilities.ollama.error_message - unified error message
This ensures consistency with other providers (Claude, ChatGPT, Gemini) and maintains a single source of truth. The Capabilities layer prioritizes backend provider status (authoritative - checks if Ollama is installed) over action-level status (checks if API responds).
The lower-level properties here (list_status, list_error, provider_error, etc.) are
operational state that capabilities.ollama derives from. Use these for:
- Operational state (models, pulling, creating, etc.)
- Action-specific error handling
- Internal state management
inheritance
Cell<typeof OllamaJson>
list_response
type OllamaListResponse | null
list_status
type AsyncStatus
list_error
type string | null
list_last_updated
type number | null
list_round_trip_time
type number | null
last_refreshed
type string | null
ever_responded
type boolean
ps_response
type OllamaPsResponse | null
ps_status
type AsyncStatus
ps_error
type string | null
ps_polling_enabled
type boolean
pull_model_name
type string
pull_insecure
type boolean
pulling_models
type SvelteSet<string>
copy_source_model
type string
copy_destination_model
type string
copy_is_copying
type boolean
create_model_name
type string
create_from_model
type string
create_system_prompt
type string
create_template
type string
create_is_creating
type boolean
manager_selected_view
type 'configure' | 'model' | 'pull' | 'copy' | 'create'
manager_selected_model
type Model | null
manager_last_active_view
type {view: string; model: Model | null} | null
show_read_actions
type boolean
available
type boolean
actions
pending_actions
completed_actions
filtered_actions
models
type Array<Model>
models_downloaded
models_not_downloaded
model_by_name
type Map<ModelName, Model>
model_names
type Array<ModelName>
running_models
type Array<OllamaPsResponseItem>
running_model_names
type Set<ModelName>
pull_parsed_model_name
type ModelName
pull_already_downloaded
type boolean
pull_can_pull
type boolean
pull_is_pulling
type (model_name: string): boolean
model_name
stringbooleancopy_parsed_source_model
type ModelName
copy_parsed_destination_model
type ModelName
copy_is_duplicate_name
type boolean
copy_destination_model_changed
type boolean
create_parsed_model_name
type ModelName
create_is_duplicate_name
type boolean
create_can_create
type boolean
constructor
type new (options: OllamaOptions): Ollama
options
dispose
type (): void
voidrefresh
Refresh the list of models and ps info and update the refresh timestamp. Error handlers update state automatically.
If Ollama provider status indicates unavailability, skip API calls to avoid overwriting the provider status with action error messages.
type (): Promise<{ list_response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null; ps_response: { ...; } | null; }>
Promise<{ list_response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: stri...start_ps_polling
Start polling for running models status. Default interval is 10 seconds.
type (options?: { immediate?: boolean | undefined; interval?: number | undefined; } | undefined): void
options?
{ immediate?: boolean | undefined; interval?: number | undefined; } | undefinedvoidstop_ps_polling
Stop polling for running models status.
type (): void
voidhandle_ollama_list_start
Handle the start of a list operation.
type (): void
voidhandle_ollama_list_complete
List all models available on the Ollama server and sync with app.models.
type (response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null): void
response
{ [x: string]: unknown; models: { [x: string]: unknown; digest: string; model: string; modified_at: string; name: string; size: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; }...voidhandle_ollama_ps_start
Handle the start of a ps operation.
type (): void
voidhandle_ollama_ps_complete
Get the list of currently running models.
type (response: { [x: string]: unknown; models: { [x: string]: unknown; digest: string; expires_at: string; model: string; name: string; size: number; size_vram: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; }[]; } | null): void
response
{ [x: string]: unknown; models: { [x: string]: unknown; digest: string; expires_at: string; model: string; name: string; size: number; size_vram: number; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } |...voidhandle_ollama_show
Get detailed information about a specific model.
type (request: { [x: string]: unknown; model: string; system?: string | undefined; template?: string | undefined; options?: any; }, response: { [x: string]: unknown; capabilities?: string[] | undefined; details?: { [x: string]: unknown; ... 5 more ...; quantization_level: string; } | undefined; ... 5 more ...; tensors?: any[] | undefined; } | null): void
request
{ [x: string]: unknown; model: string; system?: string | undefined; template?: string | undefined; options?: any; }response
{ [x: string]: unknown; capabilities?: string[] | undefined; details?: { [x: string]: unknown; families: string[]; family: string; format: string; parameter_size: string; parent_model: string; quantization_level: string; } | undefined; ... 5 more ...; tensors?: any[] | undefined; } | nullvoidhandle_ollama_delete
Delete a model from the Ollama server.
type (request: { [x: string]: unknown; model: string; }): Promise<void>
request
{ [x: string]: unknown; model: string; }Promise<void>clear_model_details
Clear details for a specific model.
type (model: Model): void
model
voidclear_all_model_details
Clear all model details.
type (): void
voidpull
Submit pull model form.
type (): Promise<void>
Promise<void>copy
Submit copy model form.
type (): Promise<void>
Promise<void>create
Submit create model form.
type (): Promise<void>
Promise<void>delete
Submit delete model form.
type (model_name: string): Promise<void>
model_name
stringPromise<void>unload
Unload a model from memory.
type (model_name: string): Promise<void>
model_name
stringPromise<void>select
Select model in manager.
type (model: Model): Promise<void>
model
Promise<void>close_form
Handle close form in manager.
type (): void
voidset_manager_view
Set the manager view and optionally the selected model.
type (view: "model" | "configure" | "pull" | "copy" | "create", model?: Model | null | undefined): void
view
"model" | "configure" | "pull" | "copy" | "create"model?
Model | null | undefinedvoidmanager_back_to_last_view
Navigate back to the last active view.
type (): void
void