r/vectordatabase
Been using OpenAI embeddings for indexing but want to switch to a local model for queries - solved this without touching the index
- upvotes
- 1
- comments
- 0
Post
Highlighted: the lines this signal was extracted from
This came up in my own project and I couldn't find a clean solution, so I built one. **The situation:** - Knowledge base indexed with OpenAI text-embedding-ada-002 (1536d) - Costs adding up every time I query - Wanted to switch to a local MiniLM (384d) - free, fast, runs offline - Problem: completely different vector spaces, search quality tanks Tried naive cross-model search first. R@5 dropped from 0.77 → 0.13. Basically unusable. **What I ended up building:** A small alignment layer that bridges the two spaces using SVD projection + Procrustes rotation. The key trick: it uses synthetic anchor points instead of real paired data, so you don't need to re-encode anything with the old model. Results on my test set: | Condition | R@5 | |-----------------------------|-------| | Same model (ceiling) | 0.767 | | Cross-model, no alignment | 0.133 | | Cross-model + alignment | 0.400 | Not perfect, but 3x better than naive and took zero reindexing, zero training data, zero labels. **How it works in practice:** ```python pip install zuhut-align ``` ```python from zuhut_align import ZUHUTClient client = ZUHUTClient() adapter = client.create_adapter(src_dim=1536) # match your old model # align your existing corpus vectors once corpus_aligned = adapter.transform(corpus_vectors) # (N, 384) # at query time, just align the query query_aligned =...
Keep reading with a free account
The rest of this post, and every signal for OpenAI, is in your free account.