LEANN

(โ˜… 12,821)

[MLsys2026]: RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.

  • .gitignore
  • .gitmodules
  • .pre-commit-config.yaml
  • .python-version
  • CLAUDE.md
  • demo.ipynb
  • LICENSE
  • llms.txt
  • pyproject.toml
  • README.md
  • uv.lock

๐Ÿš€ Installation Guide

1. Get the code
git clone https://github.com/StarTrail-org/LEANN

Downloads the entire project code from GitHub to your computer.

cd LEANN

Moves into the project folder you just downloaded.

2. Official Install Script

Easy Recommended
Prerequisites
curl -LsSf https://astral.sh/uv/install.sh | sh

Downloads and runs the official install script in one line โ€” this handles the full setup automatically.

brew install libomp boost protobuf zeromq pkgconf

Installs the pre-built package via Homebrew โ€” no source build required.

choco install cmake swig pkgconfiglite nuget.commandline -y

Installs directly via Chocolatey (Windows).

curl -fsSL https://ollama.ai/install.sh | sh

Downloads and runs the official install script in one line โ€” this handles the full setup automatically.

โœ… After installing, open a new terminal and run the program's version command (e.g. --version) to confirm it worked.

Pulled directly from this repo's README.

3. Docker

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Docker Desktop Needed to build and run containers. Install it and keep it running in the background.
docker build -f docker/Dockerfile -t leann .

Builds a runnable image based on the Dockerfile.

docker run -p 8080:80 leann

Runs the built image as an actual container.

โœ… Run docker compose ps to check the containers are Up. If the README mentions a port, open http://localhost:PORT in your browser.

4. CMake

Medium
Prerequisites
  • Git Needed to download the project code from GitHub.
  • CMake The tool used to generate build configuration.
  • C/C++ ์ปดํŒŒ์ผ๋Ÿฌ Windows needs Visual Studio (Community edition, free), macOS needs Xcode Command Line Tools, Linux needs the gcc/g++ package.
sudo pacman -Syu && sudo pacman -S --needed base-devel cmake pkgconf git gcc \

Type this command into your terminal and run it.

choco install cmake swig pkgconfiglite nuget.commandline -y

Installs directly via Chocolatey (Windows).

โœ… Check that an executable was created inside the build folder, then run it directly (e.g. ./build/app_name).

Pulled directly from this repo's README.

5. Python

Easy
Prerequisites
  • Git Needed to download the project code from GitHub.
  • Python 3 On Windows, be sure to check 'Add Python to PATH' during installation.
uv pip install leann

Installs the Python libraries listed in requirements.txt (or similar).

python -m apps.document_rag --query "What are the main techniques LEANN explores?"

Runs the Python script (or module).

python -m apps.document_rag --data-dir "~/Documents/Papers" --chunk-size 1024

Runs the Python script (or module).

python -m apps.document_rag --data-dir "./docs" --chunk-size 256 --file-types .md .py

Runs the Python script (or module).

python -m apps.document_rag --enable-code-chunking --data-dir "./my_project"

Runs the Python script (or module).

โœ… If it runs without errors and prints output in the terminal, it worked.

Pulled directly from this repo's README.

// repository documentation