defenseunicorns / leapfrogai

Production-ready Generative AI for local, cloud native, airgap, and edge deployments.
https://leapfrog.ai
Apache License 2.0
245 stars 25 forks source link

feat(db,backend): Allow for the embeddings to be changed at runtime #589

Open CollectiveUnicorn opened 1 month ago

CollectiveUnicorn commented 1 month ago

User Story

As a LeapfrogAI user I want to be able to switch the embedding model used for my data at runtime
So that I can experiment with different embedding models and find the one that works best for my specific needs.

Acceptance Criteria

Given that there are multiple embedding models available When a user requests to switch the embedding model Then the system should update the embedding model used for all subsequent operations.

Given that the embedding models have different vector sizes When a user switches embedding models Then the system should automatically adjust the vector storage format and indexing method to accommodate the new vector size.

Given that a user has previously used an embedding model to generate embeddings When the user switches to a different embedding model Then the system should re-embed existing data using the new model.

Describe alternatives you've considered

Additional context

We need to find a way to store vectors of different sizes efficiently in the database. This may involve using a combination of quantization, variable-length vectors, and multiple tables. We also need to consider the impact of switching embedding models on existing data and how to handle re-embedding.