OllamaModelController - applebiter/gnatwriter GitHub Wiki

The OllamaModelController class encapsulates the logic for managing Ollama models in the database. This class is not meant to be used directly. It's used to keep Noveler's list of language models synchronized to the models on the specified ollama server.

create_model()

create_model(
    title: str, model: str, description: str = None,
    template: str = None, example: str = None, priming: str = None,
    params: str = None
) -> OllamaModel

Takes a title, at minimum, and optionally other elements found in the output to the ollama server method show. Returns the new OllamaModel

get_model()

get_model(model: str) -> Type[OllamaModel] | None

Takes a model name and returns the matching OllamaModel, if found, None otherwise.

get_models()

get_models() -> List[Type[OllamaModel]]

Returns a list containing all OllamaModels, if any.