chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

feat(embeddingModel): add embedding model into mongodb

Open neven4 opened this issue 1 year ago • 7 comments

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 EmbeddingModel and Model

WDYT?

Part of https://github.com/huggingface/chat-ui/issues/1286

neven4 avatar Jul 25 '24 16:07 neven4

Will the default embedding model setting be inserted in the database every time the server restarts?

KartikGS avatar Aug 05 '24 14:08 KartikGS

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)

neven4 avatar Aug 05 '24 19:08 neven4

Hi @nsarrazin, what do you think about this?

neven4 avatar Aug 20 '24 10:08 neven4

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.

neven4 avatar Aug 26 '24 14:08 neven4

I meant for example the OpenAI embedding endpoint has an apiKey property (permalink) would it get copied over into the DB ? :eyes:

nsarrazin avatar Aug 26 '24 16:08 nsarrazin

Oh, good catch, I missed that part. In this case we need to encrypt/decrypt api keys using some encryption key 👍

neven4 avatar Aug 26 '24 19:08 neven4

Hi @nsarrazin, I added an encryption for sensitive data 👍

neven4 avatar Sep 23 '24 18:09 neven4