Skip to main content

LEANN - The smallest vector index in the world

LEANN is a revolutionary vector database that democratizes personal AI. Transform your laptop into a powerful RAG system that can index and search through millions of documents while using 97% less storage than traditional solutions without accuracy loss.

Installation

# Default installation (HNSW, DiskANN, and IVF backends)
uv pip install leann

# CPU-only install (Linux)
uv pip install \
  --default-index https://download.pytorch.org/whl/cpu \
  --index https://pypi.org/simple \
  --index-strategy first-index \
  "leann[cpu]"

Quick Start

from leann import LeannBuilder, LeannSearcher, LeannChat
from pathlib import Path
INDEX_PATH = str(Path("./").resolve() / "demo.leann")

# Build an index (choose backend: "hnsw", "diskann", or "ivf" for incremental updates)
builder = LeannBuilder(backend_name="hnsw")  # or "diskann" / "ivf"
builder.add_text("LEANN saves 97% storage compared to traditional vector databases.")
builder.add_text("Tung Tung Tung Sahur called—they need their banana‑crocodile hybrid back")
builder.build_index(INDEX_PATH)

# Search
searcher = LeannSearcher(INDEX_PATH)
results = searcher.search("fantastical AI-generated creatures", top_k=1)

# Chat with your data
chat = LeannChat(INDEX_PATH, llm_config={"type": "hf", "model": "Qwen/Qwen3-0.6B"})
response = chat.ask("How much storage does LEANN save?", top_k=1)

License

MIT License

Release files for leann 0.3.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for leann 0.3.8
File Size Uploaded
leann-0.3.8.tar.gz 2.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leann 0.3.8
File Interpreter ABI Platform
leann-0.3.8-py3-none-any.whl Python 3 none any Details

Total release size: 4.3 kB

Release files / leann-0.3.8.tar.gz

Download URL leann-0.3.8.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
65f74279f079a11c5c5ecc87da2ba11e2b7c3b344035f7b920ccec773c69f412
BLAKE2b-256 checksum
How to use checksums
4120e10bbf648093d9903303e5079b06942e92d02cdbeec638af4b61359677e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / leann-0.3.8-py3-none-any.whl

Download URL leann-0.3.8-py3-none-any.whl
Size 2.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
697a80fbb800df1dcd37611f627180fddb78fb9ab77b755f60af475399279274
BLAKE2b-256 checksum
How to use checksums
6832ed842cdc041c893eee42a87e029d2d5522bc0731b5dac714ffed373d5046
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.3.8 This release

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page