offgrid-ai 0.15.5 → 0.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/models.mjs +9 -2
- package/src/ui.mjs +3 -8
package/package.json
CHANGED
package/src/commands/models.mjs
CHANGED
|
@@ -82,10 +82,17 @@ export async function modelCommandCenter(initialCatalog) {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const groups = [];
|
|
85
|
+
const backendColors = {
|
|
86
|
+
"mlx-vlm": pc.yellow,
|
|
87
|
+
"llama-cpp": pc.cyan,
|
|
88
|
+
"llama-cpp-mtp": pc.blue,
|
|
89
|
+
omlx: pc.magenta,
|
|
90
|
+
};
|
|
85
91
|
for (const { backendId, sourceId, items } of byBackend.values()) {
|
|
86
92
|
const backendLabel = backendFor(backendId)?.label ?? backendId;
|
|
87
93
|
const sourceLabel = formatSourceLabel(sourceId);
|
|
88
|
-
const
|
|
94
|
+
const color = backendColors[backendId] ?? pc.dim;
|
|
95
|
+
const sep = `Inference: ${pc.bold(color(backendLabel))} ${pc.dim("|")} Source: ${sourceLabel} (${items.length})`;
|
|
89
96
|
const groupItems = items.map((item) => {
|
|
90
97
|
const opt = modelSelectOption(item, { runningProfilesNow, modelMissingIds, nameWidth, compact: true });
|
|
91
98
|
return { value: opt.value, label: opt.label, description: opt.description };
|
|
@@ -98,7 +105,7 @@ export async function modelCommandCenter(initialCatalog) {
|
|
|
98
105
|
const opt = modelSelectOption(item, { runningProfilesNow, modelMissingIds, nameWidth, compact: true });
|
|
99
106
|
return { value: opt.value, label: opt.label, description: opt.description };
|
|
100
107
|
});
|
|
101
|
-
groups.push({ separator: ` Needs setup (${setupItems.length})`, items: groupItems });
|
|
108
|
+
groups.push({ separator: ` ${pc.bold(pc.yellow(`Needs setup (${setupItems.length})`))}`, items: groupItems });
|
|
102
109
|
}
|
|
103
110
|
|
|
104
111
|
const prompt = createPrompt();
|
package/src/ui.mjs
CHANGED
|
@@ -233,12 +233,8 @@ export function createPrompt() {
|
|
|
233
233
|
async choice(label, choices, defaultValue) {
|
|
234
234
|
const mapped = choices.map((c) => {
|
|
235
235
|
if (c instanceof Separator) return c;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
name: c.label ?? c.value,
|
|
239
|
-
description: c.hint,
|
|
240
|
-
disabled: c.disabled || undefined,
|
|
241
|
-
};
|
|
236
|
+
const name = c.hint ? `${c.label ?? c.value} ${pc.dim(`(${c.hint})`)}` : (c.label ?? c.value);
|
|
237
|
+
return { value: c.value, name, disabled: c.disabled || undefined };
|
|
242
238
|
});
|
|
243
239
|
return await runPrompt(inquirerSelect, {
|
|
244
240
|
message: label,
|
|
@@ -272,8 +268,7 @@ export async function modelSelect(label, groups, { defaultKey, pageSize = 20 } =
|
|
|
272
268
|
}
|
|
273
269
|
choices.push({
|
|
274
270
|
value: item.value,
|
|
275
|
-
name: item.label ?? item.value,
|
|
276
|
-
description: item.description,
|
|
271
|
+
name: item.description ? `${item.label ?? item.value} ${item.description}` : (item.label ?? item.value),
|
|
277
272
|
disabled: item.disabled || undefined,
|
|
278
273
|
});
|
|
279
274
|
}
|