RyanCodrai/turbovec
A vector index built on TurboQuant, written in Rust with Python bindings
What it solves
turbovec provides a high-performance, memory-efficient way to store and search massive collections of vector embeddings. It significantly reduces memory usage—storing vectors at 2 or 4 bits per dimension—while maintaining high search speeds and recall, making it suitable for local, in-process applications where large-scale vector storage is required without the overhead of a dedicated database server.
How it works
The library uses TurboQuant, a quantization technique that rotates vectors by a shared random orthogonal matrix to ensure coordinates follow a predictable distribution. It then quantizes these coordinates using a pre-computed Lloyd-Max codebook and packs them into bits. At search time, it uses SIMD-optimized kernels to perform fast inner-product searches directly on the compressed data. It supports incremental updates, atomic file synchronization, and filtering via allowlists or bitmasks.
Who it’s for
Developers building local AI applications in Python or Rust who need to perform fast similarity searches on large datasets (e.g., millions of embeddings) but are constrained by RAM. It is designed for those who prefer an in-process library over a standalone vector database service and are comfortable with a lossy, quantized search approach.
Highlights
- Extreme Compression: Reduces memory footprint by up to 15.5× compared to float32 storage.
- High Performance: Searches are significantly faster than FAISS FastScan on both ARM and x86 architectures.
- Zero-Training: Uses a mathematical codebook, meaning no training phase or index rebuilding is required when adding new data.
- Drop-in Integrations: Compatible with popular frameworks like LangChain, LlamaIndex, Haystack, and Agno.
- Local & Durable: Operates entirely within your process and supports atomic, crash-safe persistence.
Related
- Dispatch
- Project
- Project
- Project
- Project