yera.cli.model_discovery.ollama

Ollama model discovery handler.

Symbols

class OllamaModelDiscovery — Handler for discovering models from an Ollama instance.

OllamaModelDiscovery

Handler for discovering models from an Ollama instance.

This class connects to an Ollama server, retrieves the list of available model tags, and queries each model's capabilities to categorise them as either LLMs or embedding models.

Methods

discover — Fetches and classifies all models available on the Ollama server.

OllamaModelDiscovery.discover

discover() → DiscoveredModels

Fetches and classifies all models available on the Ollama server.

The discovery process follows these steps: 1. Validates that the connection is an OllamaConnection. 2. Queries the /api/tags endpoint to get the list of available models. 3. For each model, queries the /api/show endpoint to determine capabilities. 4. Classifies the model as an LLM or Embedding model. 5. Maps the discovered models to Yera configuration objects.

Returns

type: DiscoveredModels

A DiscoveredModels object containing lists of discovered LLMs and embedding configurations.

Raises

TypeError

If the provided connection object is not an OllamaConnection.