@openclaw/llama-cpp-provider 2026.10.1 → 2026.10.2

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.
Files changed (2) hide show
  1. package/dist/index.js +32 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -434,13 +434,30 @@ function compareVersion(left, right) {
434
434
  }
435
435
  return 0;
436
436
  }
437
+ /** The verified build cannot run on this host; rerunning setup cannot change that. */
438
+ var UnsupportedLlamaServerHostError = class extends Error {
439
+ constructor(..._args) {
440
+ super(..._args);
441
+ this.name = "UnsupportedLlamaServerHostError";
442
+ }
443
+ };
437
444
  function assertSupportedLinuxRuntime(asset) {
438
445
  if (asset.platform !== "linux") return;
439
446
  const header = asOptionalRecord(asOptionalRecord(process.report?.getReport())?.header);
440
447
  const glibc = typeof header?.glibcVersionRuntime === "string" ? header.glibcVersionRuntime : "";
441
- if (!glibc) throw new Error("The verified Ubuntu llama-server build requires glibc and cannot run on musl/Alpine. Install llama-server manually for this host and configure its absolute path.");
448
+ if (!glibc) throw new UnsupportedLlamaServerHostError("The verified Ubuntu llama-server build requires glibc and cannot run on musl/Alpine. Install llama-server manually for this host and configure its absolute path.");
442
449
  const minimum = asset.arch === "arm64" ? "2.38" : "2.34";
443
- if (compareVersion(glibc, minimum) < 0) throw new Error(`The verified llama-server build requires glibc ${minimum}+ on Linux ${asset.arch}; this host has ${glibc}. Install a compatible llama-server manually and configure its absolute path.`);
450
+ if (compareVersion(glibc, minimum) < 0) throw new UnsupportedLlamaServerHostError(`The verified llama-server build requires glibc ${minimum}+ on Linux ${asset.arch}; this host has ${glibc}. Install a compatible llama-server manually and configure its absolute path.`);
451
+ }
452
+ const MACOS_MINIMUM = "13.3";
453
+ async function assertSupportedMacosRuntime(asset, signal, cause) {
454
+ if (asset.platform !== "darwin") return;
455
+ const version = await runServerCommand("/usr/bin/sw_vers", ["-productVersion"], signal).catch(() => {
456
+ signal?.throwIfAborted();
457
+ return "";
458
+ });
459
+ if (!/^\d+\.\d+(?:\.\d+)?$/u.test(version) || compareVersion(version, MACOS_MINIMUM) >= 0) return;
460
+ throw new UnsupportedLlamaServerHostError(`The verified llama-server ${LLAMA_SERVER_RELEASE} build requires macOS ${MACOS_MINIMUM}+; this Mac runs macOS ${version}. Build llama-server for this Mac and set models.providers.llama-cpp.localService.command to its absolute path, or use a remote model or embedding provider.`, cause === void 0 ? void 0 : { cause });
444
461
  }
445
462
  function assetUrl(asset) {
446
463
  return asset.url ?? `https://github.com/ggml-org/llama.cpp/releases/download/b10809/${asset.name}`;
@@ -632,9 +649,15 @@ async function installLlamaServer(asset, options) {
632
649
  assertSupportedLinuxRuntime(asset);
633
650
  const { installDir, command } = resolveManagedLlamaServerPaths(asset);
634
651
  if (await fs.stat(command).then((stat) => stat.isFile()).catch(() => false)) {
635
- await validateInstalledServer(command, asset, options.signal);
652
+ try {
653
+ await validateInstalledServer(command, asset, options.signal);
654
+ } catch (error) {
655
+ await assertSupportedMacosRuntime(asset, options.signal, error);
656
+ throw error;
657
+ }
636
658
  return command;
637
659
  }
660
+ await assertSupportedMacosRuntime(asset, options.signal);
638
661
  const dataDir = resolveLlamaCppDataDir();
639
662
  const archivePath = path.join(dataDir, `.download-${randomUUID()}-${asset.name}`);
640
663
  const extractDir = path.join(dataDir, `.extract-${randomUUID()}`);
@@ -2512,6 +2535,11 @@ async function runLlamaCppSetup(ctx) {
2512
2535
  if (!plan) return { profiles: [] };
2513
2536
  const progress = ctx.prompter.progress("Preparing managed llama.cpp server…");
2514
2537
  try {
2538
+ await ensureLlamaServerInstalled({
2539
+ asset,
2540
+ signal: ctx.signal,
2541
+ onProgress: (status) => progress.update(formatDownloadProgress("llama.cpp runtime", status))
2542
+ });
2515
2543
  let chatModel;
2516
2544
  if (plan.kind === "chat") {
2517
2545
  const chatModelPath = plan.cachedPath ?? await ensureLlamaCppModel({
@@ -2561,7 +2589,7 @@ async function runLlamaCppSetup(ctx) {
2561
2589
  } catch (error) {
2562
2590
  progress.stop("llama.cpp setup failed");
2563
2591
  const detail = error instanceof Error ? error.message : String(error);
2564
- throw new Error(`Managed llama.cpp setup failed. Run openclaw doctor, fix the reported runtime or model issue, then retry. ${detail}`, { cause: error });
2592
+ throw new Error(error instanceof UnsupportedLlamaServerHostError ? `Managed llama.cpp setup is unavailable on this host. ${detail}` : `Managed llama.cpp setup failed. Run openclaw doctor, fix the reported runtime or model issue, then retry. ${detail}`, { cause: error });
2565
2593
  }
2566
2594
  }
2567
2595
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/llama-cpp-provider",
3
- "version": "2026.10.1",
3
+ "version": "2026.10.2",
4
4
  "description": "OpenClaw provider for managed and external llama.cpp servers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -21,10 +21,10 @@
21
21
  "minHostVersion": ">=2026.6.2"
22
22
  },
23
23
  "compat": {
24
- "pluginApi": ">=2026.10.1"
24
+ "pluginApi": ">=2026.10.2"
25
25
  },
26
26
  "build": {
27
- "openclawVersion": "2026.10.1"
27
+ "openclawVersion": "2026.10.2"
28
28
  },
29
29
  "release": {
30
30
  "bundleRuntimeDependencies": false,
@@ -46,7 +46,7 @@
46
46
  "assets/activity.svg"
47
47
  ],
48
48
  "peerDependencies": {
49
- "openclaw": ">=2026.10.1"
49
+ "openclaw": ">=2026.10.2"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "openclaw": {