turbovec क्या है?
turbovec TurboQuant पर आधारित Rust vector index, जिसमें Python bindings हैं और कोई training step नहीं है. यह Retrieval & Knowledge (RAG) टूल्स की Vector Databases श्रेणी में आता है; ओपन सोर्स है, Rust में लिखा गया है और MIT लाइसेंस के तहत है। शुरू करने के लिए: python package इंस्टॉल करें.
सारांश
turbovec, Rust में लिखा गया एक embedded vector index है, जो Python bindings के साथ आता है। यह Google Research के TurboQuant quantizer पर आधारित है, जो data-oblivious है: इसे अलग training चरण की ज़रूरत नहीं होती और कोई parameter tuning भी नहीं करना पड़ता। इसलिए vectors को जोड़ते ही वे index हो जाते हैं, build या retrain step के बाद नहीं। इससे यह उन corpora के लिए सही है जो लगातार बढ़ते रहते हैं, जहाँ train-then-index वाले workflow में बार-बार rebuild करना पड़ता है।
इस प्रोजेक्ट का सबसे बड़ा दावा memory को लेकर है: 10-million दस्तावेज़ों का corpus, जिसे float32 के रूप में 31 GB RAM चाहिए, 4-bit quantization के बाद 4 GB में फिट हो जाता है। Search हाथ से लिखे SIMD kernels के ज़रिए चलता है: ARM पर NEON SDOT/SMMLA, x86 पर AVX-512 VNNI और vpermb, और AVX2 व scalar fallbacks के साथ। Maintainers ने 100K vectors पर FAISS IndexPQFastScan के मुकाबले benchmark किया है और हर मापी गई configuration में जीत का दावा किया है: दोनों architectures पर 4-bit पर औसतन लगभग 3.4x, और 2-bit पर लगभग 20-26%।
यह पूरी तरह in-process चलता है: कोई managed service नहीं है और कोई data आपकी machine या VPC से बाहर नहीं जाता। इसलिए यह air-gapped या privacy-constrained RAG stacks में, किसी भी ओपन सोर्स embedding model के साथ, फिट बैठता है। दो index types उपलब्ध हैं: positional results के लिए TurboQuantIndex और delete के बावजूद बने रहने वाले stable uint64 external ids के लिए IdMapIndex। LangChain, LlamaIndex, Haystack और Agno के लिए drop-in vector-store adapters प्रकाशित हैं।
यह क्या करता है
- Online ingest: vectors को जोड़ते ही index कर दिया जाता है, इसमें कोई train step नहीं, कोई parameter tuning नहीं, और corpus बढ़ने पर कोई rebuild नहीं
- 2-bit और 4-bit TurboQuant compression, जिससे 10M documents वाला 31 GB float32 corpus घटकर लगभग 4 GB रह जाता है
- ARM (NEON SDOT/SMMLA) और x86 (AVX-512 VNNI, vpermb) के लिए हाथ से लिखे SIMD search kernels, AVX2 और scalar fallbacks के साथ
- Incremental crash-safe persistence: sync(path) हर call पर एक fsync के साथ केवल पिछले sync के बाद बदली चीज़ें लिखता है
- Filtered search: search() को id allowlist दें, और kernel उसे SIMD scan के अंदर लागू करता है, इसलिए selective filters over-fetch करने के बजाय काम छोड़ देते हैं
- O(1) remove-by-id के साथ stable uint64 external ids के लिए IdMapIndex
- LangChain, LlamaIndex, Haystack और Agno में in-tree vector stores की drop-in replacements
शुरू करें
turbovec PyPI पर Python के लिए और crates.io पर Rust के लिए उपलब्ध है। Vectors और queries (n, dim) shape वाले 2-D float32 arrays होते हैं; दूसरे dtypes को चुपचाप convert करने के बजाय reject कर दिया जाता है, इसलिए ज़रूरत हो तो पहले np.asarray(x, dtype=np.float32) से cast करें।
Python package इंस्टॉल करें
PyPI से इंस्टॉल करें। wheel में compiled Rust extension पहले से शामिल है।
pip install turbovecIndex बनाएं और उसमें search करें
अपने embedding dimension और bit width के लिए index बनाएं, vectors आते ही जोड़ें, फिर search करें। write() पूरी फ़ाइल का snapshot लेता है; उसके बाद sync() durable incremental save करता है।
from turbovec import TurboQuantIndex
index = TurboQuantIndex(dim=1536, bit_width=4)
index.add(vectors)
index.add(more_vectors)
scores, indices = index.search(query, k=10)
index.write("my_index.tv")
loaded = TurboQuantIndex.load("my_index.tv")
index.sync("my_index.tv") # after more changes: durable incremental saveStable ids इस्तेमाल करें जो delete के बाद भी बने रहें
IdMapIndex आपके अपने uint64 ids को index slots से जोड़ता है, इसलिए search आपके ids लौटाता है और remove() id के हिसाब से O(1) है।
import numpy as np
from turbovec import IdMapIndex
index = IdMapIndex(dim=1536, bit_width=4)
index.add_with_ids(vectors, np.array([1001, 1002, 1003], dtype=np.uint64))
scores, ids = index.search(query, k=10) # ids are your uint64 external ids
index.remove(1002) # O(1) by id
index.write("my_index.tvim")Candidate set पर filter करें (hybrid retrieval)
किसी और system, जैसे SQL, BM25, ACL check या time window, को candidates संकुचित करने दें, फिर उस set के अंदर dense reranking करें। जिन blocks में कोई allowed slot नहीं है, उन्हें किसी भी scoring work से पहले ही छोड़ दिया जाता है।
import numpy as np
from turbovec import IdMapIndex
idx = IdMapIndex(dim=1536, bit_width=4)
idx.add_with_ids(vectors, ids)
# Stage 1: external system narrows to candidate ids.
allowed = np.array(db.execute("SELECT id FROM docs WHERE tenant=?", (t,)).fetchall(),
dtype=np.uint64)
# Stage 2: dense rerank within the candidate set.
scores, ids = idx.search(query, k=10, allowlist=allowed)या इसे Rust से इस्तेमाल करें
वही index types एक crate के रूप में उपलब्ध हैं।
cargo add turbovecमौजूदा framework में इसे स्वैप करें
हर integration framework के in-tree store जैसी ही public surface, persistence semantics और retriever wiring रखता है, इसलिए आप import बदलते हैं और pipeline वही रखते हैं।
pip install turbovec[langchain] # replaces InMemoryVectorStore
pip install turbovec[llama-index] # replaces SimpleVectorStore
pip install turbovec[haystack] # replaces InMemoryDocumentStore
pip install turbovec[agno] # replaces agno.vectordb.lancedb.LanceDbकमांड और कोड प्रोजेक्ट के अपने दस्तावेज़ों से लिए गए हैं — हमेशा जांचें आधिकारिक repo ताज़ा जानकारी के लिए।
कब इस्तेमाल करें
- RAG retrieval को पूरी तरह लोकली या air-gapped चलाएं, जहाँ embeddings को managed vector service पर भेजना विकल्प नहीं है
- cluster provision करने के बजाय 2-bit या 4-bit quantization का इस्तेमाल करके एक मशीन पर बड़ा embedding corpus memory में फिट करें
- लगातार बढ़ते corpus को बिना periodic retrain-and-rebuild चक्रों के index करें
- मौजूदा SQL, BM25 या permissions filter को search में id allowlist देकर dense reranking के साथ जोड़ें
- LangChain, LlamaIndex, Haystack या Agno pipeline में in-memory reference vector store को बिना दोबारा लिखे बदलें
How turbovec compares
turbovec alongside other open-source vector databases tools AI/TLDR tracks, ranked by GitHub stars.
| टूल | स्टार | यह क्या करता है |
|---|---|---|
| Supabase | ★ 116k | Managed Postgres backend whose Vector toolkit (pgvector) stores, indexes, and queries embeddings next to transactional data. |
| Redis Cloud | ★ 77.9k | Fully-managed Redis with built-in vector search, offering low-latency similarity and hybrid queries over any embeddings. |
| Milvus | ★ 46.8k | अरबों embeddings में बड़े पैमाने पर खोज के लिए एक ओपन सोर्स वेक्टर डेटाबेस |
| FAISS | ★ 42k | dense vectors पर कुशल similarity search और clustering के लिए लाइब्रेरी |
| Qdrant | ★ 35.9k | Rust में लिखा, समृद्ध payload फ़िल्टरिंग वाला सिमेंटिक सर्च के लिए वेक्टर सर्च इंजन |
| Chroma | ★ 29.8k | ओपन सोर्स एम्बेडिंग डेटाबेस, जो रिट्रीवल और RAG फ़ीचर बनाने में मदद करता है |
| pgvector | ★ 23.9k | Postgres के लिए ओपन सोर्स वेक्टर similarity search |
| turbovec | ★ 17.5k | TurboQuant पर आधारित Rust vector index, जिसमें Python bindings हैं और कोई training step नहीं है |
