[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
Python aifaissgpt-osslangchainllama-indexllmlocalstorageoffline-firstollamaprivacypythonragretrieval-augmented-generationvector-databasevector-searchvectors
fix(colqwen): allow transformers 4.x required by colpali_engine (#309)
Aakash Suresh003f3c305b72
diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.ymlindex ed87502..fe1c655 100644--- a/.github/workflows/build-reusable.yml+++ b/.github/workflows/build-reusable.yml@@ -139,7 +139,7 @@ jobs:if: runner.os == 'Linux'run: |sudo apt-get update- sudo apt-get install -y libomp-dev libboost-all-dev protobuf-compiler libzmq3-dev \+ sudo apt-get install -y cmake libomp-dev libboost-all-dev protobuf-compiler libzmq3-dev \pkg-config libabsl-dev libaio-dev libprotobuf-dev \patchelf@@ -188,7 +188,9 @@ jobs:if: runner.os == 'macOS'run: |# Don't install LLVM, use system clang for better compatibility- brew install libomp boost protobuf zeromq+ # CMake is required for scikit-build (HNSW + DiskANN); install via brew so+ # we do not depend on fetching the PyPI cmake package during uv build.+ brew install cmake libomp boost protobuf zeromq- name: Install system dependencies (Windows)if: runner.os == 'Windows'diff --git a/apps/colqwen_rag.py b/apps/colqwen_rag.pyindex 5878c48..e2da48e 100644--- a/apps/colqwen_rag.py+++ b/apps/colqwen_rag.py@@ -133,7 +133,12 @@ class ColQwenRAG:raisedef _assert_supported_transformers(self) -> None:- """Fail fast on unsupported transformers versions."""+ """Fail fast on transformers versions known to break ColPali/ColQwen2.++ colpali_engine (ColQwen2) requires a recent 4.x line (e.g. >=4.46.1); an+ older guard here rejected all of 4.46+, which made that stack impossible+ to run even when dependencies resolved correctly (see issue #308).+ """from importlib.metadata import PackageNotFoundError, versiontry:@@ -156,13 +161,13 @@ class ColQwenRAG:numbers.append(0)return tuple(numbers) # type: ignore[return-value]- if _parse_semver(transformers_version) >= (4, 46, 0):+ if _parse_semver(transformers_version) >= (5, 0, 0):raise RuntimeError("Unsupported transformers version detected. "- "LEANN currently requires transformers<4.46 due to typing changes "- "and transformers 5.x removing symbols such as HybridCache. "- "Please install a compatible version, e.g. "- '`pip install "transformers<4.46"`.'+ "LEANN's ColQwen/ColPali path is not tested with transformers 5.x "+ "(e.g. API removals such as HybridCache). "+ "Install a 4.x release that satisfies colpali_engine, e.g. "+ '`pip install "transformers>=4.46.1,<5"`.')def _get_device(self):diff --git a/packages/leann-backend-diskann/pyproject.toml b/packages/leann-backend-diskann/pyproject.tomlindex e8f3858..3dfa801 100644--- a/packages/leann-backend-diskann/pyproject.toml+++ b/packages/leann-backend-diskann/pyproject.toml@@ -1,5 +1,8 @@[build-system]-requires = ["scikit-build-core>=0.10", "pybind11>=2.12.0", "numpy", "cmake>=3.30"]+# Like leann-backend-hnsw: rely on system CMake on PATH (CI images + brew/apt ship it).+# Listing cmake here forces a PyPI fetch during isolated builds and has flaked on+# transient network timeouts (e.g. macOS runners failing to reach pypi.org/simple/cmake/).+requires = ["scikit-build-core>=0.10", "pybind11>=2.12.0", "numpy"]build-backend = "scikit_build_core.build"[project]