This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e6764d
commit 0c4e603
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ go.work | |
.vscode/ | ||
|
||
# Env | ||
.env | ||
*.env | ||
|
||
knowledge/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Embedding Models | ||
--- | ||
|
||
# Embedding Models | ||
|
||
## Generate Embeddings | ||
|
||
Embeddings are automatically generated when ingesting a document. | ||
Currently, this is part of the job of the vector store implementation (chromem-go). | ||
|
||
|
||
## Choosing an Embedding Model | ||
|
||
At the moment, knowledge only support OpenAI API compatible model provider endpoints, which you can configure using the following environment variables: | ||
|
||
| Variable | Default | Notes | | ||
|--------------------------|-----------------------------|---------------------------------------| | ||
| `OPENAI_BASE_URL` | `https://api.openai.com/v1` | --- | | ||
| `OPENAI_API_KEY` | `sk-foo` | -!- | | ||
| `OPENAI_EMBEDDING_MODEL` | `text-embedding-ada-002` | --- | | ||
| `OPENAI_API_VERSION` | `2024-02-01` | for Azure | | ||
| `OPENAI_API_TYPE` | `OPEN_AI` | one of `OPEN_AI`, `AZURE`, `AZURE_AD` | | ||
|
||
As you can see above, knowledge defaults to the `text-embedding-ada-002` model from OpenAI. | ||
[Below](#example-configurations) you can see how to configure some other providers/models. | ||
|
||
### Example Configurations | ||
|
||
Here are some example configurations that we tested with the knowledge tool to confirm that they're working as expected. | ||
This is no judgement on the quality of the models or how well they work with the knowledge tool in terms of retrieval accuracy. | ||
|
||
<details> | ||
<summary id="example-configurations-lm-studio"><strong>LM-Studio</strong></summary> | ||
|
||
LM-Studio failed to return any embeddings if requested concurrently, so we set the parallel threads to 1. | ||
This may change in the future. Tested with LM-Studio v0.2.27. | ||
|
||
|
||
```dotenv | ||
export OPENAI_BASE_URL=http://localhost:1234/v1 | ||
export OPENAI_API_KEY=lm-studio | ||
export OPENAI_EMBEDDING_MODEL="CompendiumLabs/bge-large-en-v1.5-gguf" | ||
export VS_CHROMEM_EMBEDDING_PARALLEL_THREAD="1" | ||
``` | ||
|
||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export GIN_MODE=debug | ||
export DEBUG=true | ||
export OPENAI_BASE_URL=http://localhost:1234/v1 | ||
export OPENAI_API_KEY=lm-studio | ||
export OPENAI_EMBEDDING_MODEL="CompendiumLabs/bge-large-en-v1.5-gguf" | ||
export VS_CHROMEM_EMBEDDING_PARALLEL_THREAD="1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters