Skip to content

model_repository

Model

Bases: BaseModel

LLM Model

Attributes:

Name Type Description
provider Providers

Provider of the model (e.g. "OpenAI")

name str

Name of the model (e.g. "gpt-4o-mini")

architecture Architecture

Architecture type (dense or mixture-of-experts)

warnings list[WarningMessage]

Warnings linked to the model (e.g. "model-arch-not-released" or "model-arch-multimodal")

sources list[str]

Source of the model information (website link)

ModelRepository(models=None, aliases=None)

Repository of models

Source code in ecologits/model_repository.py
def __init__(self, models: Optional[list[Model]] = None, aliases: Optional[list[Alias]] = None) -> None:
    self.__models: dict[tuple[str, str], Model] = {}
    if models is not None:
        for m in models:
            key = m.provider.value, m.name
            if key in self.__models:
                raise ValueError(f"duplicated models with: {key}")
            self.__models[key] = m

    if aliases is not None:
        for a in aliases:
            model_key = a.provider.value, a.alias
            if model_key not in self.__models:
                raise ValueError(f"model alias not found: {model_key}")
            alias_key = a.provider.value, a.name
            model = self.__models[model_key].model_copy()
            model.name = a.name
            self.__models[alias_key] = model