Generate OpenAI embeddings locally with minilm+adapter
Published:Dec 31, 2025 16:22
•1 min read
•r/deeplearning
Analysis
This article introduces a Python library, EmbeddingAdapters, that allows users to translate embeddings from one model space to another, specifically focusing on adapting smaller models like sentence-transformers/all-MiniLM-L6-v2 to the OpenAI text-embedding-3-small space. The library uses pre-trained adapters to maintain fidelity during the translation process. The article highlights practical use cases such as querying existing vector indexes built with different embedding models, operating mixed vector indexes, and reducing costs by performing local embedding. The core idea is to provide a cost-effective and efficient way to leverage different embedding models without re-embedding the entire corpus or relying solely on expensive cloud providers.
Key Takeaways
- •EmbeddingAdapters is a Python library for translating embeddings between different model spaces.
- •It uses pre-trained adapters to maintain fidelity during translation.
- •Key use cases include querying existing vector indexes, operating mixed indexes, and reducing costs by performing local embedding.
- •The library allows users to leverage different embedding models without re-embedding the entire corpus.
Reference
“The article quotes a command line example: `embedding-adapters embed --source sentence-transformers/all-MiniLM-L6-v2 --target openai/text-embedding-3-small --flavor large --text "where are restaurants with a hamburger near me"`”