Add vector-search-tool: MLX TurboQuant vector search example#482
Open
joelnishanth wants to merge 1 commit into
Open
Add vector-search-tool: MLX TurboQuant vector search example#482joelnishanth wants to merge 1 commit into
joelnishanth wants to merge 1 commit into
Conversation
Introduces a CLI tool that indexes synthetic vectors with TurboVec (mlx-turbovec-swift), runs approximate top-k search, and reports compression, latency, and recall vs brute-force cosine similarity. - Tools/vector-search-tool with ArgumentParser CLI and README - SPM executable target + Xcode scheme wired to mlx-turbovec-swift - CI builds vector-search-tool alongside other tools Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
|
I like the idea and the tool but I don't want external dependencies like this. How about a section in the top level readme that links to examples that you host in your own repo? |
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
Adds
vector-search-tool— a CLI example demonstrating on-device vector search using mlx-turbovec-swift, a TurboQuant implementation with optional MLX GPU acceleration.This complements
embedder-tool(which embeds text and stores raw vectors as JSON) by showing compressed vector search: 768-dim embeddings shrink from 3,072 bytes to 384 bytes (4-bit) with >90% recall@10.What it demonstrates
mlx-turbovec-swift) alongsidemlx-swift--gpuflag to enable MLX GPU batch rotation viaMLXBackend.enableGPU()Usage
Or via SPM:
Changes
Tools/vector-search-tool/— CLI tool + READMEPackage.swift— executable target withmlx-turbovec-swift+swift-argument-parserdepsTesting
swift build --target vector-search-tool— PASSxcodebuild -scheme vector-search-tool -skipMacroValidation— PASS--count 500 --queries 10 --k 5— PASS (R@1=1.0, 7.9× compression)— Joel Nishanth · offlyn.AI
Made with Cursor