crispy-recall 0.1.2 → 0.1.4

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.
@@ -57,6 +57,9 @@ function runDir() {
57
57
  function ensureDir() {
58
58
  (0, import_node_fs.mkdirSync)(recallRoot(), { recursive: true });
59
59
  }
60
+ function transcriptGlob(...segments) {
61
+ return segments.join("/").replace(/\\/g, "/");
62
+ }
60
63
  var import_node_fs, import_node_os, import_node_path, rootOverride;
61
64
  var init_paths = __esm({
62
65
  "src/paths.ts"() {
@@ -4594,6 +4597,11 @@ async function startServer() {
4594
4597
  "-ub",
4595
4598
  "8192",
4596
4599
  // micro-batch (ubatch) — also defaults to 512, must be raised
4600
+ // Flash Attention: the attention compute buffer is otherwise O(n²) in the
4601
+ // 8192-token batch (~3.7 GB on GPU), which OOMs cards <6 GB and forces CPU.
4602
+ // -fa makes it O(n) (~0.8 GB → ~2.9 GB total), so 4 GB cards run on GPU,
4603
+ // with numerically identical embeddings (verified cosine 1.0 vs non-FA).
4604
+ "-fa",
4597
4605
  // nomic-embed-text-v1.5 is trained at 2048 ctx and uses Dynamic NTK-aware
4598
4606
  // RoPE scaling to extend to 8192. Without these flags, newer llama.cpp
4599
4607
  // (b9253+) refuses inputs >2048 tokens, and older versions silently
@@ -4801,6 +4809,9 @@ async function embedViaProcess(texts, modelPath) {
4801
4809
  "array",
4802
4810
  "-c",
4803
4811
  "8192",
4812
+ // Flash Attention — see startServer: O(n) attention buffer instead of
4813
+ // O(n²), so the one-shot path also fits cards <6 GB. Identical embeddings.
4814
+ "-fa",
4804
4815
  // Match the YaRN flags on the llama-server batch path — nomic-embed-text-v1.5
4805
4816
  // is trained at 2048 ctx and extends to 8192 via Dynamic NTK-aware RoPE.
4806
4817
  // Without these, newer llama.cpp (b9253+) refuses inputs >2048 tokens here
@@ -13195,9 +13206,9 @@ async function mtimeScan(opts) {
13195
13206
  const codexRoot = process.env["CODEX_HOME"] ?? (0, import_node_path7.join)((0, import_node_os3.homedir)(), ".codex");
13196
13207
  const patterns = [];
13197
13208
  if (vendors.includes("claude"))
13198
- patterns.push([(0, import_node_path7.join)(claudeRoot, "projects", "**", "*.jsonl"), "claude"]);
13209
+ patterns.push([transcriptGlob(claudeRoot, "projects", "**", "*.jsonl"), "claude"]);
13199
13210
  if (vendors.includes("codex"))
13200
- patterns.push([(0, import_node_path7.join)(codexRoot, "sessions", "**", "*.jsonl"), "codex"]);
13211
+ patterns.push([transcriptGlob(codexRoot, "sessions", "**", "*.jsonl"), "codex"]);
13201
13212
  const db3 = getDb(dbPath());
13202
13213
  const watermarks = /* @__PURE__ */ new Map();
13203
13214
  const rows = db3.all("SELECT * FROM ingest_watermark");
package/dist/recall.js CHANGED
@@ -2570,6 +2570,9 @@ function logsDir() {
2570
2570
  function ensureDir() {
2571
2571
  (0, import_node_fs.mkdirSync)(recallRoot(), { recursive: true });
2572
2572
  }
2573
+ function transcriptGlob(...segments) {
2574
+ return segments.join("/").replace(/\\/g, "/");
2575
+ }
2573
2576
  var import_node_fs, import_node_os, import_node_path, rootOverride;
2574
2577
  var init_paths = __esm({
2575
2578
  "src/paths.ts"() {
@@ -3268,6 +3271,11 @@ async function startServer() {
3268
3271
  "-ub",
3269
3272
  "8192",
3270
3273
  // micro-batch (ubatch) — also defaults to 512, must be raised
3274
+ // Flash Attention: the attention compute buffer is otherwise O(n²) in the
3275
+ // 8192-token batch (~3.7 GB on GPU), which OOMs cards <6 GB and forces CPU.
3276
+ // -fa makes it O(n) (~0.8 GB → ~2.9 GB total), so 4 GB cards run on GPU,
3277
+ // with numerically identical embeddings (verified cosine 1.0 vs non-FA).
3278
+ "-fa",
3271
3279
  // nomic-embed-text-v1.5 is trained at 2048 ctx and uses Dynamic NTK-aware
3272
3280
  // RoPE scaling to extend to 8192. Without these flags, newer llama.cpp
3273
3281
  // (b9253+) refuses inputs >2048 tokens, and older versions silently
@@ -3475,6 +3483,9 @@ async function embedViaProcess(texts, modelPath) {
3475
3483
  "array",
3476
3484
  "-c",
3477
3485
  "8192",
3486
+ // Flash Attention — see startServer: O(n) attention buffer instead of
3487
+ // O(n²), so the one-shot path also fits cards <6 GB. Identical embeddings.
3488
+ "-fa",
3478
3489
  // Match the YaRN flags on the llama-server batch path — nomic-embed-text-v1.5
3479
3490
  // is trained at 2048 ctx and extends to 8192 via Dynamic NTK-aware RoPE.
3480
3491
  // Without these, newer llama.cpp (b9253+) refuses inputs >2048 tokens here
@@ -13749,9 +13760,9 @@ async function mtimeScan(opts) {
13749
13760
  const codexRoot = process.env["CODEX_HOME"] ?? (0, import_node_path6.join)((0, import_node_os3.homedir)(), ".codex");
13750
13761
  const patterns = [];
13751
13762
  if (vendors.includes("claude"))
13752
- patterns.push([(0, import_node_path6.join)(claudeRoot, "projects", "**", "*.jsonl"), "claude"]);
13763
+ patterns.push([transcriptGlob(claudeRoot, "projects", "**", "*.jsonl"), "claude"]);
13753
13764
  if (vendors.includes("codex"))
13754
- patterns.push([(0, import_node_path6.join)(codexRoot, "sessions", "**", "*.jsonl"), "codex"]);
13765
+ patterns.push([transcriptGlob(codexRoot, "sessions", "**", "*.jsonl"), "codex"]);
13755
13766
  const db4 = getDb(dbPath());
13756
13767
  const watermarks = /* @__PURE__ */ new Map();
13757
13768
  const rows = db4.all("SELECT * FROM ingest_watermark");
@@ -14548,7 +14559,7 @@ function listAllSessions(opts) {
14548
14559
  const codexRoot = process.env["CODEX_HOME"] ?? (0, import_node_path7.join)((0, import_node_os4.homedir)(), ".codex");
14549
14560
  const out = [];
14550
14561
  if (vendors.includes("claude")) {
14551
- const files = globSync((0, import_node_path7.join)(claudeRoot, "projects", "**", "*.jsonl"), { nodir: true });
14562
+ const files = globSync(transcriptGlob(claudeRoot, "projects", "**", "*.jsonl"), { nodir: true });
14552
14563
  for (const file of files) {
14553
14564
  out.push({
14554
14565
  sessionId: sessionIdFromPath2(file, "claude"),
@@ -14559,7 +14570,7 @@ function listAllSessions(opts) {
14559
14570
  }
14560
14571
  }
14561
14572
  if (vendors.includes("codex")) {
14562
- const files = globSync((0, import_node_path7.join)(codexRoot, "sessions", "**", "*.jsonl"), { nodir: true });
14573
+ const files = globSync(transcriptGlob(codexRoot, "sessions", "**", "*.jsonl"), { nodir: true });
14563
14574
  for (const file of files) {
14564
14575
  out.push({
14565
14576
  sessionId: sessionIdFromPath2(file, "codex"),
@@ -14585,6 +14596,7 @@ var init_session_manager_shim = __esm({
14585
14596
  init_esm5();
14586
14597
  import_node_os4 = require("node:os");
14587
14598
  import_node_path7 = require("node:path");
14599
+ init_paths();
14588
14600
  }
14589
14601
  });
14590
14602
 
@@ -15016,6 +15028,12 @@ async function defaultProbe(args) {
15016
15028
  "array",
15017
15029
  "-c",
15018
15030
  "8192",
15031
+ // Probe with the SAME flags the real embed server uses (esp. -fa). Without
15032
+ // Flash Attention the probe allocates the ~3.7 GB O(n²) attention buffer and
15033
+ // OOMs on a 4 GB card — failing the probe and falling back to CPU even
15034
+ // though the actual -fa server (~2.9 GB) would have fit. Probe must mirror
15035
+ // runtime to gate GPU adoption correctly.
15036
+ "-fa",
15019
15037
  "--rope-scaling",
15020
15038
  "yarn",
15021
15039
  "--rope-freq-scale",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crispy-recall",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Local session transcript memory for Claude Code and Codex — search past sessions with FTS5 + semantic vectors.",
5
5
  "license": "MIT",
6
6
  "author": "Sylvester Wong",