@openclaw/llama-cpp-provider 2026.8.1-beta.2 → 2026.9.1-beta.1

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.
@@ -1,5 +1,5 @@
1
- import os from "node:os";
2
1
  import path from "node:path";
2
+ import os from "node:os";
3
3
  import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
4
4
  //#region extensions/llama-cpp/src/defaults.ts
5
5
  const LLAMA_CPP_PROVIDER_ID = "llama-cpp";
@@ -104,78 +104,12 @@ function buildLlamaCppProviderConfig(existing, managed) {
104
104
  };
105
105
  }
106
106
  //#endregion
107
- //#region extensions/llama-cpp/src/llama-server-assets.ts
108
- const LLAMA_SERVER_RELEASE = "b10357";
109
- const LLAMA_SERVER_BUILD = 10357;
110
- const LLAMA_SERVER_COMMIT = "689e227db485c6b33d061555e74034c93a867649";
111
- const LLAMA_SERVER_ASSETS = [
112
- {
113
- platform: "darwin",
114
- arch: "arm64",
115
- backend: "metal",
116
- archive: "tar.gz",
117
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-macos-arm64.tar.gz`,
118
- sha256: "7f464a2d473d53ebb9c1d7d16db1258ec98c371569816491850686e6a4334c52",
119
- executable: "llama-server"
120
- },
121
- {
122
- platform: "darwin",
123
- arch: "x64",
124
- backend: "cpu",
125
- archive: "tar.gz",
126
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-macos-x64.tar.gz`,
127
- sha256: "8282cf6b30bfab87080044e98b7b78f2896bfc60414926fae6039a89c0fb6ec2",
128
- executable: "llama-server"
129
- },
130
- {
131
- platform: "linux",
132
- arch: "arm64",
133
- backend: "cpu",
134
- archive: "tar.gz",
135
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-ubuntu-arm64.tar.gz`,
136
- sha256: "0653b6aa14de35920824045bca7e48f98f629f41943d0fefab1e317bbe8e22a8",
137
- executable: "llama-server"
138
- },
139
- {
140
- platform: "linux",
141
- arch: "x64",
142
- backend: "cpu",
143
- archive: "tar.gz",
144
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-ubuntu-x64.tar.gz`,
145
- sha256: "6b0ba012036e6d727521100158bfcaa73b460fbb31acab2931c9485f347bd16b",
146
- executable: "llama-server"
147
- },
148
- {
149
- platform: "win32",
150
- arch: "arm64",
151
- backend: "cpu",
152
- archive: "zip",
153
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-win-cpu-arm64.zip`,
154
- sha256: "a0d73be8d3151d9401fa193f1b83c6d7401191b41786e75f0a60184058333e86",
155
- executable: "llama-server.exe"
156
- },
157
- {
158
- platform: "win32",
159
- arch: "x64",
160
- backend: "cpu",
161
- archive: "zip",
162
- name: `llama-${LLAMA_SERVER_RELEASE}-bin-win-cpu-x64.zip`,
163
- sha256: "6c64cc7db679980fcb34bbbe96b2b1df6127e90ccdad2bd6fbe39532fee2fc4e",
164
- executable: "llama-server.exe"
165
- }
166
- ];
167
- function selectLlamaServerAsset(platform = process.platform, arch = process.arch) {
168
- const asset = LLAMA_SERVER_ASSETS.find((candidate) => candidate.platform === platform && candidate.arch === arch);
169
- if (!asset) throw new Error(`No verified llama-server ${LLAMA_SERVER_RELEASE} build is available for ${platform}/${arch}. Install a compatible llama-server manually, then rerun llama.cpp setup with its absolute path.`);
170
- return asset;
171
- }
172
- function resolveManagedLlamaServerPaths(asset = selectLlamaServerAsset()) {
173
- const installDir = path.join(resolveLlamaCppDataDir(), LLAMA_SERVER_RELEASE, `${asset.platform}-${asset.arch}`);
174
- return {
175
- installDir,
176
- command: path.join(installDir, asset.executable),
177
- presetPath: path.join(resolveLlamaCppDataDir(), "models.ini")
178
- };
107
+ //#region extensions/llama-cpp/src/managed-provider-config.ts
108
+ const MANAGED_LLAMA_CPP_CONFIG_REQUIRED_MESSAGE = "Local embeddings need the managed llama.cpp server config. Run `openclaw configure`, choose llama.cpp once, then retry `openclaw memory status --deep`.";
109
+ function resolveManagedLlamaCppProviderConfig(config) {
110
+ const provider = config.models?.providers?.[LLAMA_CPP_PROVIDER_ID];
111
+ if (!provider?.localService || !provider.baseUrl) throw new Error(MANAGED_LLAMA_CPP_CONFIG_REQUIRED_MESSAGE);
112
+ return provider;
179
113
  }
180
114
  //#endregion
181
- export { resolveLlamaCppModelSource as A, buildLlamaCppProviderConfig as C, resolveLegacyLlamaCppModelCacheDir as D, resolveHomePath as E, resolveLlamaCppDataDir as O, LLAMA_CPP_PROVIDER_LABEL as S, resolveCachedLlamaCppModelPath as T, DEFAULT_LLAMA_CPP_MODEL_SHA256 as _, selectLlamaServerAsset as a, LLAMA_CPP_DEFAULT_PORT as b, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL as c, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_SHA256 as d, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_SIZE_BYTES as f, DEFAULT_LLAMA_CPP_MODEL_REVISION as g, DEFAULT_LLAMA_CPP_MODEL_REF as h, resolveManagedLlamaServerPaths as i, resolveLlamaCppSyntheticApiKey as j, resolveLlamaCppModelCacheDir as k, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_ID as l, DEFAULT_LLAMA_CPP_MODEL_ID as m, LLAMA_SERVER_COMMIT as n, DEFAULT_LLAMA_CPP_CONTEXT_SIZE as o, DEFAULT_LLAMA_CPP_MODEL_CACHE_FILE as p, LLAMA_SERVER_RELEASE as r, DEFAULT_LLAMA_CPP_EMBEDDING_CACHE_FILE as s, LLAMA_SERVER_BUILD as t, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_REVISION as u, DEFAULT_LLAMA_CPP_MODEL_SIZE_BYTES as v, meetsLlamaCppDefaultModelRamFloor as w, LLAMA_CPP_PROVIDER_ID as x, DEFAULT_LLAMA_CPP_MODEL_URI as y };
115
+ export { resolveHomePath as C, resolveLlamaCppModelSource as D, resolveLlamaCppModelCacheDir as E, resolveLlamaCppSyntheticApiKey as O, resolveCachedLlamaCppModelPath as S, resolveLlamaCppDataDir as T, LLAMA_CPP_DEFAULT_PORT as _, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL as a, buildLlamaCppProviderConfig as b, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_SHA256 as c, DEFAULT_LLAMA_CPP_MODEL_ID as d, DEFAULT_LLAMA_CPP_MODEL_REF as f, DEFAULT_LLAMA_CPP_MODEL_URI as g, DEFAULT_LLAMA_CPP_MODEL_SIZE_BYTES as h, DEFAULT_LLAMA_CPP_EMBEDDING_CACHE_FILE as i, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_SIZE_BYTES as l, DEFAULT_LLAMA_CPP_MODEL_SHA256 as m, resolveManagedLlamaCppProviderConfig as n, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_ID as o, DEFAULT_LLAMA_CPP_MODEL_REVISION as p, DEFAULT_LLAMA_CPP_CONTEXT_SIZE as r, DEFAULT_LLAMA_CPP_EMBEDDING_MODEL_REVISION as s, MANAGED_LLAMA_CPP_CONFIG_REQUIRED_MESSAGE as t, DEFAULT_LLAMA_CPP_MODEL_CACHE_FILE as u, LLAMA_CPP_PROVIDER_ID as v, resolveLegacyLlamaCppModelCacheDir as w, meetsLlamaCppDefaultModelRamFloor as x, LLAMA_CPP_PROVIDER_LABEL as y };
@@ -0,0 +1,19 @@
1
+ import { n as resolveManagedLlamaCppProviderConfig, t as MANAGED_LLAMA_CPP_CONFIG_REQUIRED_MESSAGE } from "./managed-provider-config-BDKErKo0.js";
2
+ //#region extensions/llama-cpp/provider-policy-api.ts
3
+ function inspectEmbeddingProviderSetup(params) {
4
+ if (params.provider !== "local") return null;
5
+ const fixHint = `Run \`openclaw models --agent ${params.agentId} auth login --provider llama-cpp --method local\` in an interactive terminal, then rerun this check.`;
6
+ try {
7
+ resolveManagedLlamaCppProviderConfig(params.config);
8
+ } catch {
9
+ return {
10
+ provider: params.provider,
11
+ reason: MANAGED_LLAMA_CPP_CONFIG_REQUIRED_MESSAGE,
12
+ requirement: "managed-llama-cpp-setup",
13
+ fixHint
14
+ };
15
+ }
16
+ return null;
17
+ }
18
+ //#endregion
19
+ export { inspectEmbeddingProviderSetup };
@@ -1,19 +1,25 @@
1
1
  {
2
2
  "id": "llama-cpp",
3
3
  "name": "llama.cpp Provider",
4
- "description": "Managed local llama.cpp server for GGUF chat and embeddings.",
5
- "doctorContract": {
6
- "configRepair": true
7
- },
4
+ "description": "Managed and external llama.cpp servers for GGUF chat and embeddings.",
8
5
  "activation": {
9
6
  "onStartup": false
10
7
  },
11
8
  "enabledByDefault": true,
9
+ "autoEnableWhenConfiguredProviders": ["llama-cpp"],
12
10
  "providers": ["llama-cpp"],
11
+ "modelCatalog": {
12
+ "discovery": {
13
+ "llama-cpp": "refreshable"
14
+ }
15
+ },
13
16
  "providerRequest": {
14
17
  "providers": {
15
18
  "llama-cpp": {
16
- "family": "llama-cpp"
19
+ "family": "llama-cpp",
20
+ "openAICompletions": {
21
+ "supportsStreamingUsage": true
22
+ }
17
23
  }
18
24
  }
19
25
  },
@@ -26,6 +32,14 @@
26
32
  },
27
33
  "syntheticAuthRefs": ["llama-cpp"],
28
34
  "nonSecretAuthMarkers": ["llama-cpp-local"],
35
+ "setup": {
36
+ "providers": [
37
+ {
38
+ "id": "llama-cpp",
39
+ "envVars": ["LLAMA_SERVER_API_KEY"]
40
+ }
41
+ ]
42
+ },
29
43
  "providerAuthChoices": [
30
44
  {
31
45
  "provider": "llama-cpp",
@@ -33,11 +47,27 @@
33
47
  "choiceId": "llama-cpp",
34
48
  "appGuidedDiscovery": true,
35
49
  "appGuidedActionLabel": "Set up model",
36
- "choiceLabel": "llama.cpp",
50
+ "choiceLabel": "Managed local server",
37
51
  "choiceHint": "Install a verified llama.cpp server and run a private GGUF model managed by OpenClaw",
38
52
  "groupId": "llama-cpp",
39
53
  "groupLabel": "Local llama.cpp",
40
- "groupHint": "No API key required"
54
+ "groupHint": "Managed or external llama.cpp server"
55
+ },
56
+ {
57
+ "provider": "llama-cpp",
58
+ "method": "existing-server",
59
+ "choiceId": "llama-cpp-existing-server",
60
+ "appGuidedDiscovery": true,
61
+ "appGuidedSecret": true,
62
+ "choiceLabel": "Existing llama-server",
63
+ "choiceHint": "Connect to a llama.cpp server managed outside OpenClaw",
64
+ "groupId": "llama-cpp",
65
+ "groupLabel": "Local llama.cpp",
66
+ "groupHint": "Managed or external llama.cpp server",
67
+ "optionKey": "llamaServerApiKey",
68
+ "cliFlag": "--llama-server-api-key",
69
+ "cliOption": "--llama-server-api-key <key>",
70
+ "cliDescription": "llama-server API key"
41
71
  }
42
72
  ],
43
73
  "contracts": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openclaw/llama-cpp-provider",
3
- "version": "2026.8.1-beta.2",
4
- "description": "OpenClaw managed llama.cpp server provider plugin",
3
+ "version": "2026.9.1-beta.1",
4
+ "description": "OpenClaw provider for managed and external llama.cpp servers",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/openclaw/openclaw"
@@ -24,10 +24,10 @@
24
24
  "minHostVersion": ">=2026.6.2"
25
25
  },
26
26
  "compat": {
27
- "pluginApi": ">=2026.8.1-beta.2"
27
+ "pluginApi": ">=2026.9.1-beta.1"
28
28
  },
29
29
  "build": {
30
- "openclawVersion": "2026.8.1-beta.2"
30
+ "openclawVersion": "2026.9.1-beta.1"
31
31
  },
32
32
  "release": {
33
33
  "bundleRuntimeDependencies": false,
@@ -44,7 +44,7 @@
44
44
  "README.md"
45
45
  ],
46
46
  "peerDependencies": {
47
- "openclaw": ">=2026.8.1-beta.2"
47
+ "openclaw": ">=2026.9.1-beta.1"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "openclaw": {
@@ -1,55 +0,0 @@
1
- import { C as buildLlamaCppProviderConfig, a as selectLlamaServerAsset, b as LLAMA_CPP_DEFAULT_PORT, i as resolveManagedLlamaServerPaths, x as LLAMA_CPP_PROVIDER_ID } from "./llama-server-assets-BEF3s_UC.js";
2
- //#region extensions/llama-cpp/doctor-contract-api.ts
3
- const LEGACY_BASE_URL = "local://llama-cpp";
4
- const PROVIDER_PATH = "models.providers.llama-cpp";
5
- const legacyConfigRules = [{
6
- path: [
7
- "models",
8
- "providers",
9
- LLAMA_CPP_PROVIDER_ID,
10
- "baseUrl"
11
- ],
12
- message: `${PROVIDER_PATH}.baseUrl uses the retired in-process runtime. Run "openclaw doctor --fix", then rerun interactive llama.cpp setup.`,
13
- match: (value) => value === LEGACY_BASE_URL
14
- }];
15
- function normalizeCompatibilityConfig({ cfg }) {
16
- const provider = cfg.models?.providers?.[LLAMA_CPP_PROVIDER_ID];
17
- if (provider?.baseUrl !== LEGACY_BASE_URL) return {
18
- config: cfg,
19
- changes: []
20
- };
21
- const { command, presetPath } = resolveManagedLlamaServerPaths(selectLlamaServerAsset());
22
- const rootUrl = `http://127.0.0.1:${LLAMA_CPP_DEFAULT_PORT}`;
23
- const managed = {
24
- command,
25
- baseUrl: `${rootUrl}/v1`,
26
- healthUrl: `${rootUrl}/health`,
27
- args: [
28
- "--host",
29
- "127.0.0.1",
30
- "--port",
31
- String(LLAMA_CPP_DEFAULT_PORT),
32
- "--models-preset",
33
- presetPath,
34
- "--models-max",
35
- "2",
36
- "--metrics",
37
- "--no-ui"
38
- ]
39
- };
40
- return {
41
- config: {
42
- ...cfg,
43
- models: {
44
- ...cfg.models,
45
- providers: {
46
- ...cfg.models?.providers,
47
- [LLAMA_CPP_PROVIDER_ID]: buildLlamaCppProviderConfig(provider, managed)
48
- }
49
- }
50
- },
51
- changes: [`${PROVIDER_PATH}: migrated from the retired in-process runtime to managed llama-server; rerun interactive llama.cpp setup to verify/install runtime artifacts`]
52
- };
53
- }
54
- //#endregion
55
- export { legacyConfigRules, normalizeCompatibilityConfig };