sync_ollama_models()

Detect Ollama models and register them in the profile registry.

Usage

Source

sync_ollama_models(
    url=None,
    *,
    timeout=5.0,
)

Combines list_ollama_models() with register_model(), and discovered models are added to the global registry so they appear in list_models(provider="ollama"), get_model_profile(), and model_profiles_table().

Parameters

url: str | None = None

Base URL for the Ollama API.

timeout: float = 5.0
Connection timeout in seconds.

Returns

list[ModelProfile]
The profiles that were registered. Empty if Ollama is unreachable.

Examples

import talk_box as tb

# Sync local models into the registry
new_models = tb.sync_ollama_models()
print(f"Registered {len(new_models)} Ollama models")

# Now they're queryable
tb.list_models(provider="ollama")