pipeworks_mud_mapper.callbacks.ollama_models_callbacks

Callbacks for Ollama model discovery and connectivity.

This module focuses on operations that query the Ollama server for model availability and connection status. Keeping these callbacks isolated reduces the size of the main Ollama callback surface.

Functions

refresh_ollama_models(n_clicks, server_url)

Fetch available models from the Ollama server.

Module Contents

pipeworks_mud_mapper.callbacks.ollama_models_callbacks.refresh_ollama_models(n_clicks, server_url)[source]

Fetch available models from the Ollama server.

Calls the Ollama /api/tags endpoint to retrieve the list of installed models and returns dropdown options plus a connection status message.

Parameters:
Returns:

(model_options, connection_status, placeholder) - model_options: List of dicts with ‘label’ and ‘value’ keys - connection_status: HTML element showing connection state - placeholder: Dropdown placeholder text

Return type:

tuple