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

Metadata

Release files for leann 0.3.9

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.9
File Size Uploaded Provenance Actions
leann-0.3.9.tar.gz 2.3 kB Without provenance Details for leann-0.3.9.tar.gz

Built distribution (wheel)

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

Total release size: 4.3 kB

Release files / leann-0.3.9.tar.gz

Download URL leann-0.3.9.tar.gz
Size 2.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f0482785ef6edd75a93ab56297499a0a52a0867e665bf6146e40788cca4be769
BLAKE2b-256 checksum
How to use checksums
4b1f5e7966dc774fd41a2c7ec3fb3ec37df2e2866a60faa569cd2682675f1a02
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.9-py3-none-any.whl

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

Security for leann 0.3.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.9 This release

2 release files No provenance

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