Skip to content

feat(embeddingModel): add embedding model into mongodb#1362

Closed
neven4 wants to merge 2 commits intohuggingface:mainfrom
neven4:feat-add-embedding-model-into-mongodb
Closed

feat(embeddingModel): add embedding model into mongodb#1362
neven4 wants to merge 2 commits intohuggingface:mainfrom
neven4:feat-add-embedding-model-into-mongodb

Conversation

@neven4
Copy link
Copy Markdown
Contributor

@neven4 neven4 commented Jul 25, 2024

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 #1286

@gary149 gary149 requested a review from nsarrazin August 2, 2024 13:52
@KartikGS
Copy link
Copy Markdown
Contributor

KartikGS commented Aug 5, 2024

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

@neven4
Copy link
Copy Markdown
Contributor Author

neven4 commented Aug 5, 2024

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)

@KartikGS KartikGS mentioned this pull request Aug 9, 2024
@neven4
Copy link
Copy Markdown
Contributor Author

neven4 commented Aug 20, 2024

Hi @nsarrazin, what do you think about this?

Copy link
Copy Markdown
Contributor

@nsarrazin nsarrazin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@neven4
Copy link
Copy Markdown
Contributor Author

neven4 commented Aug 26, 2024

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.

@nsarrazin
Copy link
Copy Markdown
Contributor

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

@neven4
Copy link
Copy Markdown
Contributor Author

neven4 commented Aug 26, 2024

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

@neven4 neven4 force-pushed the feat-add-embedding-model-into-mongodb branch from f09dcd0 to ea01acd Compare September 23, 2024 18:02
@neven4
Copy link
Copy Markdown
Contributor Author

neven4 commented Sep 23, 2024

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

@rtrompier rtrompier force-pushed the main branch 4 times, most recently from d147fec to 4d98b15 Compare November 4, 2025 17:37
@gary149 gary149 closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants