feat(qmd): switch to Qwen3 4B embedding and reranker models

Use Qwen3-Embedding-4B and Qwen3-Reranker-4B (both Q4_K_M) for QMD local
search, and make the switch reach existing installations:

- Rewrite the setup-owned models block on every install and update, while
  still recording the user's original block only once.
- When the new embedding size no longer matches stored vectors, the daemon
  clears the old vectors and re-embeds the repository.
- Delete setup-downloaded model files the current models no longer use.
- Skip npm and pnpm lockfiles and minified bundles when indexing
  repositories, which saves embedding work and removes search noise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian LechnerandClaude Opus 5.5 committed 2026-11-16 09:51:58 +01:00
1 parent 3fcd7bcbfd
commit ca4cb2a144
8 files changed
+113 -10

No files matched your search

+6 -1
View File
@@ -79,8 +79,13 @@ Quickupdate reuses the saved choice and device; it does not rerun the benchmark.
- **No:** omit the search skill and its instruction line, remove the warm-up hook registration,
and disable search for the selected clients. Dry runs do not download, benchmark, or remove QMD resources.
The models are Qwen3-Embedding-0.6B, Qwen3-Reranker-0.6B, and QMD Query Expansion 1.7B.
The models are Qwen3-Embedding-4B, Qwen3-Reranker-4B, and QMD Query Expansion 1.7B.
Exact model URIs live in [`shared/qmd/qmd-lib.mjs`](../shared/qmd/qmd-lib.mjs).
Install and update rewrite the setup-owned `models:` block, so changed models reach existing installations.
When a new embedding model produces vectors of another size, the daemon clears all old vectors and
re-embeds each repository on its next search; run `qmd embed` to re-embed your own QMD collections.
Install and update also delete model files the setup downloaded that the current models no longer use.
Repository indexes skip git-ignored files, npm and pnpm lockfiles, and minified `*.min.js` bundles.
Auto thresholds can be overridden with `QMD_BENCHMARK_MAX_QUERY_SECONDS` and
`QMD_BENCHMARK_MIN_CHUNKS_PER_SECOND`. The benchmark uses a temporary database and a deterministic
100-document fixture; its measurements are not an end-to-end estimate for a user's repository.