{"data":{"slug":"ryancodrai-turbovec","name":"turbovec","tagline":"A vector index built on TurboQuant with Rust and Python bindings","github_url":"https://github.com/RyanCodrai/turbovec","owner":"RyanCodrai","repo":"turbovec","owner_avatar_url":"https://avatars.githubusercontent.com/u/10856497?v=4","primary_language":"Python","stars":12595,"forks":1117,"topics":["ann","avx512","embedding","embeddings","faiss","nearest-neighbor","neon","python","quant","quantization","rag","rust","simd","turboquant","vector-search"],"archived":false,"github_pushed_at":"2026-06-10T18:07:32+00:00","url":"https://www.graphcanon.com/tools/ryancodrai-turbovec","markdown_url":"https://www.graphcanon.com/tools/ryancodrai-turbovec.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/ryancodrai-turbovec","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=ryancodrai-turbovec","description":"A vector index built on TurboQuant, written in Rust with Python bindings","homepage_url":"https://pypi.org/project/turbovec/","license":"MIT","open_issues":12,"watchers":59,"ai_summary":"turbovec is a Rust-based vector index system designed for efficient vector search. It employs Google Research's TurboQuant algorithm, enabling it to achieve significant memory savings while maintaining high-speed search performance compared to alternatives like FAISS.","readme_excerpt":"<p align=\"center\">\n  <img src=\"docs/header.png\" alt=\"turbovec — Google's TurboQuant for vector search\" width=\"100%\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/RyanCodrai/turbovec/blob/main/LICENSE\"><img src=\"https://img.shields.io/pypi/l/turbovec\" alt=\"License\"></a>\n  <a href=\"https://pypi.org/project/turbovec/\"><img src=\"https://img.shields.io/pypi/v/turbovec?label=pypi&color=blue\" alt=\"PyPI version\"></a>\n  <a href=\"https://crates.io/crates/turbovec\"><img src=\"https://img.shields.io/crates/v/turbovec?label=crates.io&color=blue\" alt=\"crates.io version\"></a>\n  <a href=\"https://arxiv.org/abs/2504.19874\"><img src=\"https://img.shields.io/badge/paper-arXiv-b31b1b.svg\" alt=\"TurboQuant paper\"></a>\n</p>\n\n---\n\n**A 10 million document corpus takes 31 GB of RAM as float32. turbovec fits it in 4 GB - and searches it faster than FAISS.**\n\nturbovec is a Rust vector index with Python bindings, built on Google Research's [**TurboQuant**](https://arxiv.org/abs/2504.19874) algorithm — a data-oblivious quantizer with near-optimal distortion and no separate training phase.\n\n- **Online ingest.** Add vectors, they're indexed — no train step, no parameter tuning, no rebuilds as the corpus grows.\n- **Fast SIMD search.** Hand-written NEON (ARM) and AVX-512BW (x86) kernels beat FAISS IndexPQFastScan by 10–19% on ARM; on x86 they win the 4-bit configs and trail by a few percent on 2-bit.\n- **Filter at search time.** Pass an id allowlist (or a slot bitmask) to `search()` and the kernel honours it directly. You always get up to `k` results from the allowed set — no over-fetching, no recall hit on selective filters.\n- **Pure local.** No managed service, no data leaving your machine or VPC. Pair with any open-source embedding model for a fully air-gapped RAG stack.\n\nBuilding RAG where privacy, memory, or latency matters? **You're in the right place.**\n\n## Python\n\n```bash\npip install turbovec\n```\n\n```python\nfrom turbovec import TurboQuantIndex\n\nindex = TurboQuantIndex(dim=1536, bit_width=4)\nindex.add(vectors)\nindex.add(more_vectors)\n\nscores, indices = index.search(query, k=10)\n\nindex.write(\"my_index.tv\")\nloaded = TurboQuantIndex.load(\"my_index.tv\")\n```\n\nNeed stable ids that survive deletes? Use `IdMapIndex`:\n\n```python\nimport numpy as np\nfrom turbovec import IdMapIndex\n\nindex = IdMapIndex(dim=1536, bit_width=4)\nindex.add_with_ids(vectors, np.array([1001, 1002, 1003], dtype=np.uint64))\n\nscores, ids = index.search(query, k=10)   # ids are your uint64 external ids\nindex.remove(1002)                         # O(1) by id\n\nindex.write(\"my_index.tvim\")\nloaded = IdMapIndex.load(\"my_index.tvim\")\n```\n\n### Hybrid retrieval (filtered search)\n\nRestrict results to a candidate set produced by another system (SQL, BM25, ACL, time window, …):\n\n```python\nimport numpy as np\nfrom turbovec import IdMapIndex\n\nidx = IdMapIndex(dim=1536, bit_width=4)\nidx.add_with_ids(vectors, ids)\n\n# Stage 1: external system narrows to candidate ids.\nallowed = np.array(db.execute(\"SELECT id FROM docs WHERE tenant=?\", (t,)).fetchall(),\n                   dtype=np.uint64)\n\n# Stage 2: dense rerank within the candidate set.\nscores, ids = idx.search(query, k=10, allowlist=allowed)\n```\n\nFiltering happens inside the SIMD kernel at 32-vector block granularity: blocks with no allowed slots are short-circuited before any LUT lookup or scoring work, and individual non-allowed slots inside scored blocks are dropped at heap-insert. Selective allowlists (small fraction of the index allowed) therefore avoid most of the SIMD cost rather than paying it and discarding the result afterwards.\n\nThe output length is `min(k, len(allowed))` — when the allowlist is smaller than `k` you get exactly `len(allowed)` results rather than padded fallbacks.\n\nSee [`docs/api.md`](docs/api.md) for the full reference.\n\n### Framework integrations\n\nDrop-in replacements for the in-tree reference vector / document stores in each framework. Same public surface, same persistence semantics, same retriever and pipeline wiring — s","github_created_at":"2026-03-26T10:32:44+00:00","created_at":"2026-07-07T17:37:00.853364+00:00","updated_at":"2026-07-07T19:44:54.921823+00:00","categories":[{"slug":"vector-databases","name":"Vector Databases","url":"https://www.graphcanon.com/categories/vector-databases","markdown_url":"https://www.graphcanon.com/categories/vector-databases.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/vector-databases"}],"tags":[{"slug":"embeddings","name":"embeddings"},{"slug":"neon","name":"neon"},{"slug":"python","name":"python"},{"slug":"nearest-neighbor","name":"nearest-neighbor"},{"slug":"embedding","name":"embedding"},{"slug":"avx512","name":"avx512"},{"slug":"faiss","name":"faiss"},{"slug":"ann","name":"ann"}]}}