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)
| File | Size | Uploaded | |
|---|---|---|---|
| leann-0.3.8.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|