You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://colab.research.google.com/drive/1wfgfkt6xk3meSF5jWHDMqo6mL0ZvPw2f?usp=sharing)
Many open source projects support the compatibility of the `completions` and the `chat/completions` endpoints of the OpenAI API, but do not support the `embeddings` endpoint.
7
8
8
9
The goal of this project is to create an OpenAI API-compatible version of the `embeddings` endpoint, which serves open source sentence-transformers models and other models supported by the LangChain's [HuggingFaceEmbeddings](https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html), HuggingFaceInstructEmbeddings and HuggingFaceBgeEmbeddings class.
9
10
10
-
## Supported Text Embeddings Models
11
+
## ℹ️ Supported Text Embeddings Models
11
12
12
13
Below is a compilation of open-source models that are tested via the `embeddings` endpoint:
13
14
@@ -17,9 +18,15 @@ Below is a compilation of open-source models that are tested via the `embeddings
-[universal-sentence-encoder-large/5](https://tfhub.dev/google/universal-sentence-encoder-large/5) (Please refer to the `universal_sentence_encoder` branch for more details)
19
20
20
-
The models mentioned above have undergone personal testing and verification. It is worth noting that all sentence-transformers models are expected to perform seamlessly with the endpoint.
21
+
The models mentioned above have undergone testing and verification. It is worth noting that all sentence-transformers models are expected to perform seamlessly with the endpoint.
21
22
22
-
## Standalone FastAPI Server
23
+
## 🔍 Demo
24
+
25
+
Try out open-text-embeddings in your browser:
26
+
27
+
[](https://colab.research.google.com/drive/1wfgfkt6xk3meSF5jWHDMqo6mL0ZvPw2f?usp=sharing)
28
+
29
+
## 🖥️ Standalone FastAPI Server
23
30
24
31
To run the embeddings endpoint locally as a standalone FastAPI server, follow these steps:
25
32
@@ -52,7 +59,7 @@ To run the embeddings endpoint locally as a standalone FastAPI server, follow th
52
59
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
53
60
```
54
61
55
-
## AWS Lambda Function
62
+
## ☁️ AWS Lambda Function
56
63
57
64
To deploy the embeddings endpoint as an AWS Lambda Function using GitHub Actions, follow these steps:
58
65
@@ -62,22 +69,52 @@ To deploy the embeddings endpoint as an AWS Lambda Function using GitHub Actions
62
69
63
70
3. Manually trigger the `Deploy Dev` or `Remove Dev` GitHub Actions to deploy or remove the AWS Lambda Function.
64
71
65
-
## Testing the Embeddings Endpoint
72
+
## 🧪 Testing the Embeddings Endpoint
66
73
67
-
To test the embeddings endpoint, the repository includes an [embeddings.ipynb](https://github.com/limcheekin/open-text-embeddings/blob/main/embeddings.ipynb) notebook with a LangChain-compatible `OpenAIEmbeddings` class.
74
+
To test the `embeddings` endpoint, the repository includes an [embeddings.ipynb](https://github.com/limcheekin/open-text-embeddings/blob/main/embeddings.ipynb) notebook with a LangChain-compatible `OpenAIEmbeddings` class.
68
75
69
76
To get started:
70
77
71
78
1. Install the dependencies by executing the following command:
Thank you very much for the following contributions:
82
100
83
101
-[Vokturz](https://github.com/Vokturz) contributed [#2](https://github.com/limcheekin/open-text-embeddings/pull/2): support for CPU/GPU choice and initialization before starting the app.
102
+
103
+
## 📔 License
104
+
105
+
This project is licensed under the terms of the MIT license.
106
+
107
+
## 🗒️ Citation
108
+
109
+
If you utilize this repository, please consider citing it with:
110
+
111
+
```
112
+
@misc{open-text-embeddings,
113
+
author = {Lim Chee Kin},
114
+
title = {open-text-embeddings: Open Source Text Embedding Models with OpenAI API-Compatible Endpoint},
0 commit comments