Introducing Open Text Embeddings
The open-text-embeddings project is an innovative initiative designed to expand the capabilities of the OpenAI API by providing an endpoint compatible with open-source text embedding models. While many open-source projects primarily focus on supporting the completions
and chat/completions
endpoints, this project seeks to address the gap for the embeddings
endpoint. It allows the integration of open-source sentence-transformers models and other models supported by LangChain, thereby broadening the utility of the OpenAI API.
Supported Text Embedding Models
The project boasts compatibility with several tested and verified open-source models:
- BAAI/bge-large-en
- intfloat/e5-large-v2
- sentence-transformers/all-MiniLM-L6-v2
- sentence-transformers/all-mpnet-base-v2
- universal-sentence-encoder-large/5
These models are expected to work seamlessly with the embeddings
endpoint. Notably, each model can yield different embeddings based on the input type, whether it's a single string or a list of strings, affecting performance based on their usage for queries or storage in a vector database.
Try It Out
For those eager to explore open-text-embeddings, the project can be experimented with directly in a browser using a demo linked to a Google Colab environment.
On-Premise Deployment
The project supports local deployment through a standalone FastAPI server. To embark on this, one needs to:
- Install necessary dependencies.
- Download the desired model.
- Launch the server with customizable configurations such as enabling or disabling embedding normalization, selecting between CPU or GPU execution, and turning on verbose logging for detailed output.
Cloud Deployment
For deploying the embeddings endpoint to cloud platforms, instructions are available for services like AWS Lambda and Modal. This involves setting up credentials and triggering deployment actions through GitHub.
Testing the Embeddings Endpoint
Included in the project is a testing notebook, embeddings.ipynb
, which can be used to validate the embeddings
endpoint's functionality. Users need only to install the appropriate dependencies and run the provided test cells.
Contribution and License
Open-text-embeddings welcomes contributions from the community. Potential contributors are encouraged to explore existing issues or propose new improvements via pull requests. The project operates under the MIT license, ensuring open access and modification rights for developers.
Citation
Those utilizing this repository are encouraged to acknowledge it using the specified citation format. This helps in recognizing the effort invested in developing this valuable resource.
In summary, open-text-embeddings not only provides a bridge between OpenAI's API and open-source text models but also fosters an inclusive environment for further development and implementation across various programming and deployment domains.