AvailableModels
Object Hierarchy:
Description:
public class AvailableModels : Object, ListModel
Manages available models cache with ArrayList backing.
NOTE: This class is technically Ollama-specific, but is kept generic for potential future use with other model providers.
Manages downloading and caching the list of available models from a remote endpoint, with automatic cache refresh when the cache is
missing or older than 3 days. Implements ListModel interface using Gee.ArrayList as backing store.
Content:
Properties:
Creation methods:
Methods:
- public void append (AvailableModel item)
Append an item to the list. If a model with the same name is already
present, the new one is ignored.
- public Object? get_item (uint position)
ListModel interface implementation: Get item at position.
- public Type get_item_type ()
ListModel interface implementation: Get the item type.
- public uint get_n_items ()
ListModel interface implementation: Get the number of items.
- public async void load () throws Error
Loads models: resource first, then from file (ollama-models.json in
data_dir) if it exists. Duplicates by name are skipped on append.
- public async void refresh () throws Error
Fetches models from remote URL and saves to cache.
- public void remove_all ()
Remove all items from the list.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref
All known members inherited from interface GLib.ListModel