metrillm-mcp 0.2.2 → 0.2.4
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/dist/index.js +20 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1478,14 +1478,17 @@ async function listModels2() {
|
|
|
1478
1478
|
throw new Error(`LM Studio list models failed (${resp.status} ${resp.statusText})`);
|
|
1479
1479
|
}
|
|
1480
1480
|
const data = await resp.json();
|
|
1481
|
-
const
|
|
1481
|
+
const primaryIds = (data.data ?? []).map((m) => m.id?.trim()).filter((id) => Boolean(id));
|
|
1482
1482
|
const apiModels = await fetchApiModels();
|
|
1483
1483
|
const apiById = /* @__PURE__ */ new Map();
|
|
1484
|
+
const secondaryIds = [];
|
|
1484
1485
|
for (const model of apiModels ?? []) {
|
|
1485
1486
|
const id = asNonEmptyString(model.id);
|
|
1486
1487
|
if (!id) continue;
|
|
1487
1488
|
apiById.set(id, model);
|
|
1489
|
+
secondaryIds.push(id);
|
|
1488
1490
|
}
|
|
1491
|
+
const ids = Array.from(/* @__PURE__ */ new Set([...primaryIds, ...secondaryIds]));
|
|
1489
1492
|
const modelsRootDir = await resolveModelsRootDir();
|
|
1490
1493
|
const localMetadataEntries = await Promise.all(
|
|
1491
1494
|
ids.map(async (id) => {
|
|
@@ -9574,6 +9577,20 @@ async function promptThinkingMode() {
|
|
|
9574
9577
|
});
|
|
9575
9578
|
}
|
|
9576
9579
|
|
|
9580
|
+
// ../src/core/runtime-unavailable.ts
|
|
9581
|
+
function getRuntimeUnavailableHelp(runtimeName, setupHints) {
|
|
9582
|
+
const runtimeDisplayName = getRuntimeDisplayName(runtimeName);
|
|
9583
|
+
const lines = [
|
|
9584
|
+
`MetriLLM is currently set to use ${runtimeDisplayName}.`,
|
|
9585
|
+
`Either start ${runtimeDisplayName}, or switch to another backend in Settings.`
|
|
9586
|
+
];
|
|
9587
|
+
for (const hint of setupHints) {
|
|
9588
|
+
lines.push(` \u2022 ${hint}`);
|
|
9589
|
+
}
|
|
9590
|
+
lines.push(" \u2022 To change backend: Main Menu -> Settings -> Runtime backend");
|
|
9591
|
+
return lines;
|
|
9592
|
+
}
|
|
9593
|
+
|
|
9577
9594
|
// ../src/commands/bench.ts
|
|
9578
9595
|
var BENCHMARK_SPEC_VERSION = "0.2.1";
|
|
9579
9596
|
var PROMPT_PACK_VERSION = "0.1.0";
|
|
@@ -9640,9 +9657,8 @@ async function benchCommand(options) {
|
|
|
9640
9657
|
} catch (err) {
|
|
9641
9658
|
if (!silent) {
|
|
9642
9659
|
spinnerModels.fail(`Cannot connect to ${runtimeDisplayName}`);
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
errorMsg(` \u2022 ${hint}`);
|
|
9660
|
+
for (const line of getRuntimeUnavailableHelp(runtimeName, runtimeSetupHints)) {
|
|
9661
|
+
errorMsg(line);
|
|
9646
9662
|
}
|
|
9647
9663
|
if (err instanceof Error) errorMsg(err.message);
|
|
9648
9664
|
}
|