feat(vector): replace hnsw_rs with TurboQuant 4-bit backend#30
Merged
Conversation
- Add llm-kernel-vector-index dependency (TurboQuant) behind turboquant feature - TurboQuant provides 8x memory compression, SIMD-accelerated search, and built-in filtered search/remove - hnsw_rs kept as fallback behind vector feature (without turboquant) - SQLite remains for metadata; TurbovecIndex handles in-memory search - Index persistence via save/load to .alcove/vectors.tvim - full-macos and full-cross presets now use turboquant - Patch llm-kernel to git to ensure trait coherence with vector-index crate Closes #25 (P3 TurboQuant adoption)
TurboQuant depends on faer/nalgebra which links against OpenBLAS. Add apt-get install step to check, cross-check-linux, and test-linux jobs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the hnsw_rs HNSW backend with TurboQuant 4-bit compressed vector index for 8x memory reduction and faster search.
Problem
Current
VectorStoreuses hnsw_rs for in-memory search with f32 raw vectors. For large vaults:ef_build=200)Solution
TurboQuant benefits:
search_filteredandremove(native, no SQLite workarounds)save/load— no rebuild on restartChanges
Cargo.tomlllm-kernel-vector-indexdep,turboquantfeature, update presetssrc/vector.rssrc/lib.rssrc/main.rsmod vectorfor turboquantFeature Gates
Verification
Notes
[patch.crates-io]redirectsllm-kernelto git — temporary untilllm-kernel-vector-indexis published on crates.iohnsw_rsremains available as fallback viavectorfeature