yera.cli.model_discovery.ollama
Ollama model discovery handler.
Symbols
OllamaModelDiscovery
BaseModelDiscoveryHandler 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
OllamaModelDiscovery.discover
discover() → DiscoveredModelsFetches 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
A DiscoveredModels object containing lists of discovered LLMs and embedding configurations.
Raises
If the provided connection object is not an OllamaConnection.