From 3b6ee3ac074fc2440db92e5bef6e8a9ea572f340 Mon Sep 17 00:00:00 2001 From: Bill Hlavacek Date: Fri, 4 Dec 2026 22:44:17 -0700 Subject: [PATCH] Release LitKit 0.5.0 Adds portable vector export and restore, PubMed baseline records, publication types, exact-search FTS5 indexes, JATS citation links and verified evidence handles, so this is a minor release. Signed-off-by: Bill Hlavacek --- CHANGELOG.md | 18 ++++++++++++++---- LITKIT_CLUSTER_GUIDE.md | 10 +++++----- LITKIT_MAC_GUIDE.md | 10 +++++----- justfile | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- vector_build_multi.sbatch | 2 +- vector_build_single.sbatch | 2 +- vector_resume_consumer.sbatch | 2 +- 9 files changed, 30 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87e8a54..f3e1169 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,19 +6,29 @@ internal versions are summarized under 0.3.33. ## [Unreleased] +## [0.5.0] - 2026-12-04 + ### Added -- Index individual PMID records in PubMed baseline XML gzip files and multi-record tar members. Abstract-only papers remain searchable alongside PMC OA full text. (#73) -- Restore released FAISS files on CPU with verified passage IDs, or fetch matching PMC full text and PubMed abstracts on demand. (#65) +- Index individual PMID records in PubMed baseline XML gzip files and multi-record tar members. Abstract-only papers are searchable alongside PMC OA full text. (#73) +- `litkit rebuild-from-vectors` restores a searchable workspace from a vector release on CPU, keeping the released vectors for unchanged text and re-embedding only changed or new inputs. `litkit search-vectors` searches a release before the archives are downloaded, fetching matching PMC full text and PubMed abstracts on demand and checking each passage against its recorded hash. (#65) - `litkit export-vectors` writes FAISS indexes, text hashes, source checksums, model revisions and per-paper attribution. Use `--license` to select licenses. (#65) -- Paper and passage results report publication type and retraction status. Search with repeatable `--type` and `--exclude-type` filters. (#58) +- Paper and passage results report publication type and retraction status. Search with repeatable `--type` and `--exclude-type` filters. Builds read types from JATS and PubMed records, and from a text-fetch workspace manifest given with `--publication-manifest`. (#58) - `litkit build-fts` indexes passage text for exact search. The optional index stays current through updates, rebuilds and shard merges. (#56) +- LitKit indexes JATS bibliographies and links passage-level citation markers to their original references. (#63) +- Each retrieved passage carries an `evidence_handle` derived from the passage's complete stored text. `chunk-context` and `get-paper` check a saved handle and return `stale_handle` (exit 5) when the text changed, with a replacement handle when the passage moved. The Python APIs raise `StaleHandleError`. (#62) +- With `TRANSFORMERS_USE_SAFE_TENSORS=1`, both embedding loaders and pooled workers require local safetensors weights. The pool reports worker startup failures and unexpected exits. (#64) +- `scripts/verify_index.py` checks a workspace's FAISS indexes against its SQLite database without changing anything, and reports duplicate or missing vectors, duplicate chunks and papers that share a DOI. (#68) + +### Changed +- On macOS, LitKit pins OpenMP and MKL to one thread before loading FAISS and torch, and sets torch and FAISS to one thread when imported into a running program, including when the shell requests more. In 0.4.0 a thread count set in the environment took precedence. (#53) +- Rebuild an existing workspace to record publication types, licenses and citation links for papers indexed earlier. An exact-search index built by 0.4.0's `build_chunks_fts()` is no longer used; run `litkit build-fts` to replace it, and until then exact search scans the passages. (#56, #58, #63) ### Fixed - Concurrent SQLite opens wait for a WAL mode switch up to the configured busy timeout. (#52) -- macOS builds and queries pin OpenMP and MKL to one thread before loading FAISS and torch, including when the shell requests more. (#53) - Lexical retrieval skips common words capitalized for emphasis, including ROLE, DOSE and LOW. (#39) - Reappearing papers retain one current metadata record, set of passages and FAISS vector across writer builds, updates and restarts. (#7) - A later archive linking a PMID and PMCID consolidates the paper records and their file history. Conflicting identifiers or DOIs are reported for review. (#42) +- A DOI or filename shared by several records returns `ambiguous_identifier` (exit 5) with two candidate `paper:N` handles instead of opening one of them. The Python APIs raise `AmbiguousIdentifierError`. Search results fall back to a numeric paper handle when a file handle would match several records. (#61) ## [0.4.0] - 2026-12-03 diff --git a/LITKIT_CLUSTER_GUIDE.md b/LITKIT_CLUSTER_GUIDE.md index c2a7433..8ca7386 100644 --- a/LITKIT_CLUSTER_GUIDE.md +++ b/LITKIT_CLUSTER_GUIDE.md @@ -96,8 +96,8 @@ export CUDA_LIBB="$CUDA_BASE/lib64" LitKit is distributed as a SquashFS container image: ``` -litkit-v0.4.0-aarch64-lean.sqfs # ARM64 (aarch64) -litkit-v0.4.0-x86_64-lean.sqfs # x86-64 (if available) +litkit-v0.5.0-aarch64-lean.sqfs # ARM64 (aarch64) +litkit-v0.5.0-x86_64-lean.sqfs # x86-64 (if available) ``` --- @@ -126,7 +126,7 @@ module load charliecloud # Build lean container (default) just build -# Output: sqfs/litkit-v0.4.0--lean.sqfs +# Output: sqfs/litkit-v0.5.0--lean.sqfs ``` ### Build Commands @@ -350,7 +350,7 @@ export CUDA_LIBB="${CUDA_BASE}/lib64" export HF_HOST="/path/to/hf_cache" # Container image path -export IMG="${LITKIT_REPO}/sqfs/litkit-v0.4.0-aarch64-lean.sqfs" +export IMG="${LITKIT_REPO}/sqfs/litkit-v0.5.0-aarch64-lean.sqfs" ``` ### Manifest Files @@ -698,4 +698,4 @@ salloc -N1 -t 1:00:00 -p YOUR_PARTITION --no-shell --- -*LitKit v0.4.0 — Air-gapped RAG for Scientific Literature* +*LitKit v0.5.0 — Air-gapped RAG for Scientific Literature* diff --git a/LITKIT_MAC_GUIDE.md b/LITKIT_MAC_GUIDE.md index 5e970f4..4afd33a 100644 --- a/LITKIT_MAC_GUIDE.md +++ b/LITKIT_MAC_GUIDE.md @@ -81,7 +81,7 @@ If you received LitKit as a ZIP file: ```bash # 1. Extract the archive -unzip litkit-v0.4.0.zip +unzip litkit-v0.5.0.zip cd litkit # 2. Install all dependencies (uv.lock ensures correct versions) @@ -109,7 +109,7 @@ uv run litkit --version ```bash uv run litkit --version -# Should output: litkit 0.4.0 +# Should output: litkit 0.5.0 # Verify MPS is available (Apple Silicon) uv run python -c "import torch; print('MPS:', torch.backends.mps.is_available())" @@ -329,7 +329,7 @@ For development and testing, use `test_build.sh`: ### Expected Output ``` -[version] litkit 0.4.0 +[version] litkit 0.5.0 [device] using mps # or cpu on Intel Macs [paths] using workspace/tar_shards as source directory for tar shards [paths] using /path/to/litkit/workspace as writable directory @@ -662,7 +662,7 @@ Before relying on LLM answers, use `--no-llm` to verify the right papers/chunks ```bash # 1. Extract and install -unzip litkit-v0.4.0.zip && cd litkit +unzip litkit-v0.5.0.zip && cd litkit uv sync # 2. Download embedding models (once) @@ -702,4 +702,4 @@ uv run litkit "What is the main finding?" \ --- -*LitKit v0.4.0 — Air-gapped RAG for Scientific Literature* +*LitKit v0.5.0 — Air-gapped RAG for Scientific Literature* diff --git a/justfile b/justfile index ac3c394..1d2212e 100644 --- a/justfile +++ b/justfile @@ -51,7 +51,7 @@ set shell := ['bash', '-l', '-c'] # ---- Paths & tags ---- arch := env("ARCH", "aarch64") flavor := env("FLAVOR", "lean") # fat | lean -tag := "v0.4.0-" + arch + "-" + flavor +tag := "v0.5.0-" + arch + "-" + flavor name := "litkit" sqfs-path := "./sqfs" / name + "-" + tag + ".sqfs" diff --git a/pyproject.toml b/pyproject.toml index 5c59550..902648c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "litkit" -version = "0.4.0" +version = "0.5.0" description = "Index JATS corpora of papers and documents for two-stage retrieval of cited passages on laptops and HPC clusters." keywords = ["document retrieval", "scientific literature", "JATS", "embeddings", "FAISS", "citations", "RAG"] readme = "README.md" diff --git a/uv.lock b/uv.lock index 4afe7f0..1378d00 100644 --- a/uv.lock +++ b/uv.lock @@ -292,7 +292,7 @@ wheels = [ [[package]] name = "litkit" -version = "0.4.0" +version = "0.5.0" source = { editable = "." } dependencies = [ { name = "faiss-cpu", version = "1.8.0", source = { registry = "https://pypi.org/simple" }, marker = "(platform_machine == 'AMD64' and sys_platform == 'win32') or (platform_machine == 'x86_64' and sys_platform == 'win32')" }, diff --git a/vector_build_multi.sbatch b/vector_build_multi.sbatch index dae15fd..bd8eb9b 100644 --- a/vector_build_multi.sbatch +++ b/vector_build_multi.sbatch @@ -67,7 +67,7 @@ MANIFEST_FILE="${MANIFEST:-tiny_test.manifest}" export LITKIT_TAR_MANIFEST="${LITKIT_WORKSPACE}/${MANIFEST_FILE}" # Container and CUDA setup for V100 nodes -export IMG="${LITKIT_REPO}/sqfs/litkit-v0.4.0-aarch64-lean.sqfs" +export IMG="${LITKIT_REPO}/sqfs/litkit-v0.5.0-aarch64-lean.sqfs" export CDI_SPEC_DIR="/path/to/cdi-v100" export CUDA_BASE="/path/to/cuda-12.5-host/cuda-12.5" export CUDA_LIBA="${CUDA_BASE}/targets/sbsa-linux/lib" diff --git a/vector_build_single.sbatch b/vector_build_single.sbatch index fa32177..223d7ad 100644 --- a/vector_build_single.sbatch +++ b/vector_build_single.sbatch @@ -121,7 +121,7 @@ fi ### ----- CLUSTER PATHS -------------------------------------------------------- BASE="${BASE:-/path/to}" # CUSTOMIZE: root holding litkit/, cdi-*/, cuda-12.5-host/, hf_cache_persist/ LITKIT_DIR="$BASE/litkit" -IMG="$LITKIT_DIR/sqfs/litkit-v0.4.0-aarch64-lean.sqfs" # keep in sync with your image +IMG="$LITKIT_DIR/sqfs/litkit-v0.5.0-aarch64-lean.sqfs" # keep in sync with your image if [[ "$TARGET" == "gh" ]]; then CDI_SPEC_DIR="$BASE/cdi-grace" else diff --git a/vector_resume_consumer.sbatch b/vector_resume_consumer.sbatch index e633ed1..bce5f8e 100644 --- a/vector_resume_consumer.sbatch +++ b/vector_resume_consumer.sbatch @@ -72,7 +72,7 @@ echo "[resume] Using ch-run: $CHRUN" # Paths (same as vector_build_multi.sbatch; CUSTOMIZE FOR YOUR CLUSTER) export LITKIT_REPO="${LITKIT_REPO:-/path/to/litkit}" export LITKIT_WORKSPACE="${LITKIT_WORKSPACE:-${LITKIT_REPO}/workspace}" -export IMG="${LITKIT_REPO}/sqfs/litkit-v0.4.0-aarch64-lean.sqfs" +export IMG="${LITKIT_REPO}/sqfs/litkit-v0.5.0-aarch64-lean.sqfs" export CDI_SPEC_DIR="/path/to/cdi-v100" export CUDA_BASE="/path/to/cuda-12.5-host/cuda-12.5" export CUDA_LIBA="${CUDA_BASE}/targets/sbsa-linux/lib"