feat(embeddingModel): add embedding model into mongodb
Hi there,
I decided to create the first PR which migrate config management from .env file to UI.
How do I see it:
- Migrate the
EmbeddingModel - Migrate the
Model - Create UI for
EmbeddingModelandModel
WDYT?
Part of https://github.com/huggingface/chat-ui/issues/1286
Will the default embedding model setting be inserted in the database every time the server restarts?
Will the default embedding model setting be inserted in the database every time the server restarts?
For now - yes, in order to support the current behavior and allow users to edit embedding models via .env file (until the UI for editing is created)
Hi @nsarrazin, what do you think about this?
Hi, thanks for the contrib, this looks like a nice feature, will do a deeper review soon but just curious, how do you handle the API keys stored in the env variable? Do you copy these over in the DB?
Hi there, I hope I got the question right.
I'm not touching API keys at all, I just parse TEXT_EMBEDDING_MODELS from the .env file and populate database with it.
I meant for example the OpenAI embedding endpoint has an apiKey property (permalink) would it get copied over into the DB ? :eyes:
Oh, good catch, I missed that part. In this case we need to encrypt/decrypt api keys using some encryption key 👍
Hi @nsarrazin, I added an encryption for sensitive data 👍