LLMRegistryModel

The providers of an LLMRegistry and their models, as a tree for a QTreeView (llm-openai-compatible §OCP-G4).

Inherits QAbstractItemModel
Group libllm

Declared in src/libs/libllm/llm/ui/LLMRegistryModel.hpp.

Detailed description

The top rows are the providers, in the registry's order, and the children of each are its models. Column 0 is the name, column 1 the status. The model keeps no copy of a record: it keeps the ids, and data() reads the registry, so the memory of a row is one id.

The model follows the registry's signals. A change of one provider or model updates its rows with dataChanged(), or inserts or removes rows. A full reset happens only on reload(): when the registry is set, when it loads its file, and at a factory reset.

See also LLMRegistryDelegate, LLMListActivity, LLMModelListModel.

Member function documentation

idOf

QString LLMRegistryModel::idOf(const QModelIndex &index) const

Returns the id of the provider or the model of index, or empty.

isProvider

bool LLMRegistryModel::isProvider(const QModelIndex &index) const

Returns whether index is a provider row.

modelIndex

QModelIndex LLMRegistryModel::modelIndex(const QString &modelId) const

Returns the index of the model row of modelId, or an invalid index.

providerIndex

QModelIndex LLMRegistryModel::providerIndex(const QString &providerId) const

Returns the index of the provider row of providerId, or an invalid index.

reload

void LLMRegistryModel::reload()

Read every id of the registry again: the one full reset of the model. One pass over the models puts each one under its provider.

setRegistry

void LLMRegistryModel::setRegistry(QSharedPointer<LLMRegistry> registry)

Show registry, and follow its signals.

In this section