netheriteai-code 1.1.4 → 1.1.5
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/cli.js +1 -1
- package/src/ollama.js +8 -5
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import { printTable, resolveWorkspaceRoot } from "./utils.js";
|
|
|
11
11
|
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
13
|
|
|
14
|
-
const VERSION = "1.1.
|
|
14
|
+
const VERSION = "1.1.5";
|
|
15
15
|
|
|
16
16
|
function isNewer(latest, current) {
|
|
17
17
|
const l = String(latest || "0.0.0").split(".").map(Number);
|
package/src/ollama.js
CHANGED
|
@@ -59,12 +59,15 @@ export async function listModels() {
|
|
|
59
59
|
|
|
60
60
|
export async function pickDefaultModel() {
|
|
61
61
|
try {
|
|
62
|
-
const models = await listModels();
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
const models = await listModels().catch(() => []);
|
|
63
|
+
if (models.length > 0) {
|
|
64
|
+
const match = models.find(m => PREFERRED_DEFAULT_MODELS.some(p => p.toLowerCase() === m.name.toLowerCase()));
|
|
65
|
+
if (match) return match.name;
|
|
66
|
+
}
|
|
67
|
+
// If list fails or no match, fallback to the first preferred model directly
|
|
68
|
+
return PREFERRED_DEFAULT_MODELS[0];
|
|
66
69
|
} catch {
|
|
67
|
-
|
|
70
|
+
return PREFERRED_DEFAULT_MODELS[0];
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
|