LEANN - The smallest vector index in the world. RAG Everything with LEANN!
Project description
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 (includes both HNSW and DiskANN backends)
uv pip install leann
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" or "diskann")
builder = LeannBuilder(backend_name="hnsw") # or "diskann" for large-scale deployments
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
leann-0.2.1.tar.gz
(2.1 kB
view details)
Built Distribution
leann-0.2.1-py3-none-any.whl
(1.9 kB
view details)
File details
Details for the file leann-0.2.1.tar.gz
.
File metadata
- Download URL: leann-0.2.1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
24adca5c07e03cb6a28b6974f48f1daff3d0aaf8dbc0fa692d7fbd90db5da297
|
|
MD5 |
9e9c8a603fe8c68e65dfd343a463cfa3
|
|
BLAKE2b-256 |
9f36d3fd2868ad84ca2ae1f1cc54c352e211d32b8c58b0da6b90efb292dc9616
|
File details
Details for the file leann-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: leann-0.2.1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
68422b233f4be9c9b99c545186c5f90b4523164f8c3d753f7adbe28107b99b75
|
|
MD5 |
881a3d870200f042812b42dcd4ff0448
|
|
BLAKE2b-256 |
03c86f865cb9cc9dcbc0a99f17c8a6d64ec51032245d61382a3121ee26749f28
|