qmd/src
edy 9718d3767c fix: truncate oversized text before embedding to prevent GGML crash
When a chunk exceeds the embedding model's context window (trainContextSize),
node-llama-cpp's getEmbeddingFor() triggers a native SIGABRT in GGML/Metal,
crashing the entire process.

Fix: Add truncateToContextSize() guard in embed() and embedBatch() that uses
the model's own tokenizer to check token count before calling getEmbeddingFor().
Oversized text is truncated to (trainContextSize - 4) tokens with a warning,
preserving partial embedding coverage instead of crashing.

Fixes #303
2026-03-13 09:35:17 +08:00
..
bench-rerank.ts perf: CPU parallelism via multi-context thread splitting 2026-02-15 11:21:45 -05:00
collections.ts feat(cli): add collection management commands 2026-02-19 05:46:07 -05:00
db.ts fix: hide bun:sqlite import from tsc on Node.js builds 2026-02-16 08:56:02 -04:00
formatter.ts fix: add missing context to search results markdown and XML formatters 2026-02-13 00:34:23 -05:00
llm.ts fix: truncate oversized text before embedding to prevent GGML crash 2026-03-13 09:35:17 +08:00
mcp.ts Document query grammar and add skill helpers 2026-02-22 13:36:08 -04:00
qmd.ts Document query grammar and add skill helpers 2026-02-22 13:36:08 -04:00
store.ts Document query grammar and add skill helpers 2026-02-22 13:36:08 -04:00
test-preload.ts fix: increase bun test timeout to 30s via CLI flag 2026-02-15 21:59:18 -04:00