@ruelya/grok-build 1.0.3 → 1.0.5-rev
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/README.md +16 -20
- package/artifacts/BUILD_INFO.txt +2 -2
- package/artifacts/config-fork-notes.toml +4 -5
- package/bin/install.mjs +31 -3
- package/config_example.toml +3 -4
- package/examples/config.api-backends.toml +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -177,23 +177,21 @@ grok-build-orchestrator = true
|
|
|
177
177
|
|
|
178
178
|
### Prompt cache key & recap model
|
|
179
179
|
|
|
180
|
-
#### `auto_prompt_cache_key` (
|
|
180
|
+
#### `auto_prompt_cache_key` (absorbed)
|
|
181
181
|
|
|
182
|
-
**
|
|
182
|
+
**Status:** Absorbed by official Grok Build (product 1.0.3). The per-model flag is kept for config compatibility and does **not** change the wire.
|
|
183
183
|
|
|
184
|
-
**
|
|
184
|
+
**Expected behavior:** On Responses backends (`responses` / `openai_responses`), every request sends `prompt_cache_key`. If unset, it defaults to `x_grok_conv_id` (main turns: the session id). Recap and `/btw` send the **parent session id** so they share that prefix cache. Chat Completions / Messages still do not forward the field.
|
|
185
185
|
|
|
186
186
|
```toml
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
auto_prompt_cache_key = true
|
|
187
|
+
# No longer required — Responses already send prompt_cache_key.
|
|
188
|
+
# [model.sol]
|
|
189
|
+
# auto_prompt_cache_key = true
|
|
190
190
|
```
|
|
191
191
|
|
|
192
|
-
Keys are derived from the session (main vs recap use different derivations so caches do not collide).
|
|
193
|
-
|
|
194
192
|
#### Recap model (`[models] recap`)
|
|
195
193
|
|
|
196
|
-
**Effect:** Session **recap** (`/recap` and automatic return-from-away recap) can run on a **cheaper / smaller** model than the main chat model.
|
|
194
|
+
**Effect:** Session **recap** (`/recap` and automatic return-from-away recap) can run on a **cheaper / smaller** model than the main chat model. **Unset** → current session model (official default). **Set** → that catalog key or model id (own endpoint / credentials when the `[model.*]` entry has them). If the override cannot be resolved, recap falls back to the session model.
|
|
197
195
|
|
|
198
196
|
**Config:**
|
|
199
197
|
|
|
@@ -252,7 +250,7 @@ auto_sync_catalog = true # refresh models.dev on sync
|
|
|
252
250
|
|
|
253
251
|
| File | Purpose |
|
|
254
252
|
|------|---------|
|
|
255
|
-
| `examples/config.api-backends.toml` | Loose backends + `
|
|
253
|
+
| `examples/config.api-backends.toml` | Loose backends + `[models] recap` |
|
|
256
254
|
| `examples/config.usage-pricing.toml` | Cost modes / live display |
|
|
257
255
|
| `examples/prices.custom.toml` | Custom $/1M rates |
|
|
258
256
|
| `examples/usage-sync.toml` | WebDAV sync |
|
|
@@ -433,23 +431,21 @@ grok-build-orchestrator = true
|
|
|
433
431
|
|
|
434
432
|
### Prompt cache key 与 recap 模型
|
|
435
433
|
|
|
436
|
-
#### `auto_prompt_cache_key
|
|
434
|
+
#### `auto_prompt_cache_key`(已被官方吸收)
|
|
437
435
|
|
|
438
|
-
|
|
436
|
+
**状态:** 已被官方 Grok Build(product 1.0.3)吸收。按模型开关仍可写在配置里,**不再改变线上结果**。
|
|
439
437
|
|
|
440
|
-
|
|
438
|
+
**预期行为:** 在 Responses 后端(`responses` / `openai_responses`)上,每个请求都会带 `prompt_cache_key`。未显式设置时回退为 `x_grok_conv_id`(主轮即 session id)。Recap 与 `/btw` 发送 **父 session id**,以便共享该前缀缓存。Chat Completions / Messages 仍不转发该字段。
|
|
441
439
|
|
|
442
440
|
```toml
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
auto_prompt_cache_key = true
|
|
441
|
+
# 已不必设置 — Responses 默认就会带 prompt_cache_key。
|
|
442
|
+
# [model.sol]
|
|
443
|
+
# auto_prompt_cache_key = true
|
|
446
444
|
```
|
|
447
445
|
|
|
448
|
-
key 由会话派生(主轮与 recap 使用不同派生,避免缓存互相污染)。
|
|
449
|
-
|
|
450
446
|
#### Recap 模型(`[models] recap`)
|
|
451
447
|
|
|
452
|
-
**效用:** 会话 **recap**(`/recap` 与离开再回时的自动 recap)可以跑在比主对话 **更便宜/更小**
|
|
448
|
+
**效用:** 会话 **recap**(`/recap` 与离开再回时的自动 recap)可以跑在比主对话 **更便宜/更小** 的模型上。**未设置** → 当前会话模型(与官方一致)。**设置** → 该目录键或模型 id(`[model.*]` 上的 endpoint / 凭据会一并使用)。覆盖无法解析时回退到会话模型。
|
|
453
449
|
|
|
454
450
|
**配置:**
|
|
455
451
|
|
|
@@ -508,7 +504,7 @@ auto_sync_catalog = true # 同步时刷新 models.dev
|
|
|
508
504
|
|
|
509
505
|
| 文件 | 用途 |
|
|
510
506
|
|------|------|
|
|
511
|
-
| `examples/config.api-backends.toml` | 宽松 backend + `
|
|
507
|
+
| `examples/config.api-backends.toml` | 宽松 backend + `[models] recap` |
|
|
512
508
|
| `examples/config.usage-pricing.toml` | 计费模式 / 实时显示 |
|
|
513
509
|
| `examples/prices.custom.toml` | 自定义 $/1M |
|
|
514
510
|
| `examples/usage-sync.toml` | WebDAV 同步 |
|
package/artifacts/BUILD_INFO.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
version=1.0.
|
|
2
|
-
release=https://github.com/Ruelya/grok-build-rev/releases/download/v1.0.
|
|
1
|
+
version=1.0.5-rev
|
|
2
|
+
release=https://github.com/Ruelya/grok-build-rev/releases/download/v1.0.5-rev
|
|
@@ -48,16 +48,15 @@
|
|
|
48
48
|
#
|
|
49
49
|
# [model."proxy"]
|
|
50
50
|
# api_backend = "openai_responses"
|
|
51
|
-
# auto_prompt_cache_key = true
|
|
52
51
|
#
|
|
53
|
-
# --- Prompt cache key (
|
|
52
|
+
# --- Prompt cache key (absorbed by official; Responses always send it) --------
|
|
54
53
|
# [model."your-model-id"]
|
|
55
|
-
# # auto_prompt_cache_key = true
|
|
54
|
+
# # auto_prompt_cache_key = true # no-op; kept for config compatibility
|
|
56
55
|
#
|
|
57
56
|
# --- Recap model (optional) ---------------------------------------------------
|
|
58
|
-
#
|
|
57
|
+
# Unset = current session model. Set = catalog key / model id.
|
|
59
58
|
# [models]
|
|
60
|
-
# # recap = "
|
|
59
|
+
# # recap = "cheap-summary"
|
|
61
60
|
#
|
|
62
61
|
# <<< fork-fork-config-notes
|
|
63
62
|
# =============================================================================
|
package/bin/install.mjs
CHANGED
|
@@ -73,10 +73,21 @@ function runVersion(exe) {
|
|
|
73
73
|
shell: false,
|
|
74
74
|
windowsHide: true,
|
|
75
75
|
});
|
|
76
|
+
// SIGILL / crash → status null + signal; treat as unusable (e.g. neoverse-v2
|
|
77
|
+
// binary on Neoverse-N1 Ampere).
|
|
78
|
+
if (r.error || r.signal || (typeof r.status === "number" && r.status !== 0)) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
76
81
|
const out = ((r.stdout || "") + (r.stderr || "")).trim();
|
|
77
82
|
return out.split(/\r?\n/)[0] || null;
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
/** True when an on-disk binary exists but cannot even print --version. */
|
|
86
|
+
function isBrokenBinary(exe) {
|
|
87
|
+
if (!existsSync(exe) || (fileSize(exe) || 0) < 1_000_000) return false;
|
|
88
|
+
return runVersion(exe) == null;
|
|
89
|
+
}
|
|
90
|
+
|
|
80
91
|
function fileSize(p) {
|
|
81
92
|
try {
|
|
82
93
|
return statSync(p).size;
|
|
@@ -273,14 +284,31 @@ async function resolveSourceBinary() {
|
|
|
273
284
|
);
|
|
274
285
|
}
|
|
275
286
|
|
|
276
|
-
|
|
287
|
+
// Versioned cache so upgrading 1.0.2 → 1.0.3 never reuses a bad binary
|
|
288
|
+
// (e.g. neoverse-v2 SIGILL on Ampere Neoverse-N1).
|
|
289
|
+
const ver = String(pkg.version || "unknown").replace(/[^\w.-]+/g, "_");
|
|
290
|
+
const cacheDir = join(PKG_ROOT, "artifacts", "cache", ver, t.key);
|
|
277
291
|
mkdirSync(cacheDir, { recursive: true });
|
|
278
292
|
const dest = join(cacheDir, t.exeName);
|
|
279
|
-
|
|
280
|
-
|
|
293
|
+
const needFetch =
|
|
294
|
+
!existsSync(dest) ||
|
|
295
|
+
(fileSize(dest) || 0) < 1_000_000 ||
|
|
296
|
+
isBrokenBinary(dest);
|
|
297
|
+
if (needFetch) {
|
|
281
298
|
console.log(`Downloading ${url} …`);
|
|
282
299
|
await download(url, dest);
|
|
283
300
|
}
|
|
301
|
+
// Refuse to install a still-broken download (wrong arch / CPU baseline).
|
|
302
|
+
if (isBrokenBinary(dest)) {
|
|
303
|
+
throw new Error(
|
|
304
|
+
[
|
|
305
|
+
`Downloaded binary cannot run on this CPU (Illegal instruction / crash).`,
|
|
306
|
+
` url: ${url}`,
|
|
307
|
+
` tip: need a portable linux-arm64 build (target-cpu=generic, not neoverse-v2).`,
|
|
308
|
+
` reinstall: npm i -g @ruelya/grok-build@latest && npx grok-build install`,
|
|
309
|
+
].join("\n")
|
|
310
|
+
);
|
|
311
|
+
}
|
|
284
312
|
return { path: dest, source: "download", url };
|
|
285
313
|
}
|
|
286
314
|
|
package/config_example.toml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Grok Build — config_example.toml
|
|
3
3
|
# Copy fields you need into: %USERPROFILE%\.grok\config.toml (or $GROK_HOME)
|
|
4
4
|
# All keys are optional unless noted. Comments document accepted values.
|
|
5
|
-
# Fork extras (openai_responses, toolset.style,
|
|
5
|
+
# Fork extras (openai_responses, toolset.style, recap model)
|
|
6
6
|
# are marked # [fork]
|
|
7
7
|
# =============================================================================
|
|
8
8
|
|
|
@@ -92,7 +92,7 @@ combine_queued_prompts = false
|
|
|
92
92
|
[models]
|
|
93
93
|
default = "grok-4.5"
|
|
94
94
|
default_reasoning_effort = "high" # none | low | medium | high | …
|
|
95
|
-
# recap = "
|
|
95
|
+
# recap = "cheap-summary" # [fork] /recap model; unset = session model
|
|
96
96
|
# web_search = "…"
|
|
97
97
|
# session_summary = "…"
|
|
98
98
|
# image_description = "…"
|
|
@@ -129,7 +129,7 @@ default_reasoning_effort = "high" # none | low | medium | high | …
|
|
|
129
129
|
# "openai_chat_completions" | "openai_responses" | "anthropic_messages"
|
|
130
130
|
# See docs/api-backends.md · examples/config.api-backends.toml
|
|
131
131
|
# api_backend = "openai_responses"
|
|
132
|
-
# auto_prompt_cache_key = true #
|
|
132
|
+
# auto_prompt_cache_key = true # absorbed: Responses already send pck; no-op
|
|
133
133
|
# temperature = 1.0
|
|
134
134
|
# top_p = 1.0
|
|
135
135
|
# max_completion_tokens = 16384
|
|
@@ -163,7 +163,6 @@ default_reasoning_effort = "high" # none | low | medium | high | …
|
|
|
163
163
|
# base_url = "https://your-gateway/v1"
|
|
164
164
|
# api_key = "…"
|
|
165
165
|
# api_backend = "openai_responses" # [fork] loose Responses parse
|
|
166
|
-
# auto_prompt_cache_key = true
|
|
167
166
|
# context_window = 200000
|
|
168
167
|
# reasoning_effort = "high"
|
|
169
168
|
#
|
|
@@ -19,7 +19,6 @@ base_url = "https://your-gateway/v1"
|
|
|
19
19
|
# api_key = "…"
|
|
20
20
|
# env_key = "OPENAI_API_KEY"
|
|
21
21
|
api_backend = "openai_responses"
|
|
22
|
-
auto_prompt_cache_key = true
|
|
23
22
|
context_window = 200000
|
|
24
23
|
reasoning_effort = "high"
|
|
25
24
|
|
|
@@ -60,6 +59,7 @@ anthropic-version = "2023-06-01"
|
|
|
60
59
|
# env_key = "OPENAI_API_KEY"
|
|
61
60
|
# api_backend = "chat_completions"
|
|
62
61
|
|
|
63
|
-
# Optional catalog default
|
|
62
|
+
# Optional catalog default + cheaper recap model:
|
|
64
63
|
# [models]
|
|
65
64
|
# default = "sol"
|
|
65
|
+
# recap = "cheap-chat"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruelya/grok-build",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Grok Build fork (rev). Thin
|
|
3
|
+
"version": "1.0.5-rev",
|
|
4
|
+
"description": "Grok Build fork. Product version tracks upstream (currently 1.0.5-rev). Thin installer downloads from GitHub Releases.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"grok": "bin/grok.mjs",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"access": "public",
|
|
49
49
|
"registry": "https://registry.npmjs.org/"
|
|
50
50
|
},
|
|
51
|
-
"forkReleaseBase": "https://github.com/Ruelya/grok-build-rev/releases/download/v1.0.
|
|
51
|
+
"forkReleaseBase": "https://github.com/Ruelya/grok-build-rev/releases/download/v1.0.5-rev"
|
|
52
52
|
}
|