Spaces:
Running
Running
Added example for OpenAI API embedding models (#1555)
Browse filesAdded an example on how to use OpenAI API embedding models to the documentation
Co-authored-by: Nathan Sarrazin <[email protected]>
docs/source/configuration/embeddings.md
CHANGED
@@ -79,4 +79,27 @@ TEXT_EMBEDDING_MODELS=`[
|
|
79 |
|
80 |
## OpenAI
|
81 |
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
## OpenAI
|
81 |
|
82 |
+
It's also possible to host your own OpenAI API compatible embedding models. [`Infinity`](https://github.com/michaelfeil/infinity) is one example. You may run it locally with Docker:
|
83 |
+
|
84 |
+
`docker run -it --gpus all -v infinity-data:/app/.cache -p 7997:7997 michaelf34/infinity:latest v2 --model-id nomic-ai/nomic-embed-text-v1 --port 7997`
|
85 |
+
|
86 |
+
You can then hook this up to your Chat UI instance with the following configuration.
|
87 |
+
|
88 |
+
```ini
|
89 |
+
TEXT_EMBEDDING_MODELS=`[
|
90 |
+
{
|
91 |
+
"name": "nomic-ai/nomic-embed-text-v1",
|
92 |
+
"displayName": "nomic-ai/nomic-embed-text-v1",
|
93 |
+
"chunkCharLength": 512,
|
94 |
+
"model": {
|
95 |
+
"name": "nomic-ai/nomic-embed-text-v1"
|
96 |
+
},
|
97 |
+
"endpoints": [
|
98 |
+
{
|
99 |
+
"type": "openai",
|
100 |
+
"url": "https://127.0.0.1:7997/embeddings"
|
101 |
+
}
|
102 |
+
]
|
103 |
+
}
|
104 |
+
]`
|
105 |
+
```
|