ModelPanelFormatter
Category: UI
Source: model_panel_formatter.dart
Enums
ModelAvailability
Per-row availability hint — today only Ollama reports more than [unknown]. Lets the picker annotate catalog rows with "not pulled" and surface tag-only installs the user may want to pick.
| Value | Description |
|---|---|
String | |
String | |
ModelDef | |
ModelAvailability |
Classes
ModelPanelBuilder
Width-aware builder for the model picker.
Holds the row data and re-formats on demand, so the picker can reflow its columns as the user resizes the terminal.
Properties
| Property | Type | Description |
|---|---|---|
initialIndex | int | Index into [entries] for the currently active model, or 0 if none match. |
entries | List<CatalogRow> | Flat list of entries corresponding 1:1 with the builder's rows. |
rowCount | int get | |
flatInitial | var | |
headers | final | |
lastProvider | String? | |
indexed | final | |
table | final | |
rows | final | |
rows | return | |
providerName | String | |
installed | final | |
out | final | |
catalogued | final | |
out | return | |
notes | final | |
prefix | final | |
rowCount | int get |
Methods
List<String> renderHeader(int width)
String renderRow(int index, int width)
bool Function(ProviderDef)
Functions
`ModelPanelBuilder buildModelPanel(
List<CatalogRow> entries, { required ModelRef currentRef, })`
Builds a [ModelPanelBuilder] that reflows column widths with the terminal. Provider headers are shown only on the first row of each provider group; the current model is marked with a filled dot.
`List<CatalogRow> mergeOllamaDiscovery(
List<CatalogRow> rows, List<OllamaInstalledModel> installedTags, { String providerName = 'Ollama', })`
Merge Ollama's /api/tags output into a flat catalog row list.
- Rows whose provider is
ollamaget [ModelAvailability.installed] if the catalog id matches a pulled tag, else [ModelAvailability.notInstalled]. - Pulled tags that have no catalog entry are appended as synthesised rows with [ModelAvailability.installedOnly]; they use the tag as both id and display name, carry no capability claims, and render with the
[local]marker. - Non-Ollama rows are returned unchanged.
- [installedTags] being empty (daemon down, timeout) leaves catalog rows untouched — no false "not pulled" markers when we don't know.