dsh-codebase-chat 0.25.5 → 0.25.6
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/cli.js +10 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2570,8 +2570,16 @@ function loadLocalModel() {
|
|
|
2570
2570
|
throw new Error(`Local model not found: ${spec}`);
|
|
2571
2571
|
}
|
|
2572
2572
|
const { getLlama } = await importLlama();
|
|
2573
|
-
const
|
|
2574
|
-
|
|
2573
|
+
const cpuOnly = /^(0|off|false|cpu)$/i.test(process.env.CODEBASE_LOCAL_GPU || "");
|
|
2574
|
+
const llama = await getLlama(cpuOnly ? { gpu: false } : {});
|
|
2575
|
+
try {
|
|
2576
|
+
return await llama.loadModel({ modelPath });
|
|
2577
|
+
} catch (err) {
|
|
2578
|
+
if (cpuOnly) throw err;
|
|
2579
|
+
console.error(`[local-llm] GPU load failed (${err instanceof Error ? err.message : err}) \u2014 falling back to CPU. Slower, but works. Set CODEBASE_LOCAL_GPU=off to skip GPU entirely.`);
|
|
2580
|
+
const cpuLlama = await getLlama({ gpu: false });
|
|
2581
|
+
return cpuLlama.loadModel({ modelPath });
|
|
2582
|
+
}
|
|
2575
2583
|
})();
|
|
2576
2584
|
modelPromise.catch(() => {
|
|
2577
2585
|
modelPromise = null;
|