Created
November 28, 2025 20:50
-
-
Save davidmezzetti/ca31dff155d2450ea1b51634a814d37f to your computer and use it in GitHub Desktop.
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
| import numpy as np | |
| from txtai.ann import ANNFactory | |
| # Index 10M vectors using llama.cpp style quants | |
| ann = None | |
| for _ in range(1000): | |
| # Generate batch of vectors | |
| batch = np.random.rand(10000, 768).astype(np.float32) | |
| if not ann: | |
| ann = ANNFactory.create({ | |
| "backend": "ggml", | |
| "ggml": { | |
| "quantize": "MXFP4" | |
| } | |
| }) | |
| ann.index(batch) | |
| else: | |
| ann.append(batch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment