A simple service for generating embeddings based on a given text string. It also saves data in a ChromaDB organized by topic. Based on a given search string, the service will return the top n best matches.
The saved data can be used to configure RAG when communicating with LLM.
- Install a package manager uv:
curl -LsSf https://astral.sh/uv/install.sh | sh- Install dependencies -
uv sync - Based on the .env_example file, create a .env file and fill in the variable values. he path to the model folder should be specified as the location where the model repository will be cloned (see, deploy of the embedding model).
- Activate venv -
source .venv/bin/activate - Run
uvicorn:
uvicorn app.main:app --host 0.0.0.0 --port 8080 # or any other portThe complete list of endpoints is available at http://0.0.0.0:8080/docs
/app/v1/embeddings/get_collection- get a collection by name or the default collection/app/v1/embeddings/update- create or update a collection/app/v1/content/search- search for relevant text fragments in the collection for the message
You can use any offline model compatible with sentence_transformers, for instance, multilingual-e5-small.
To deploy this model, do the following:
- Install git-lfs (if you don't have it)
sudo apt update
sudo apt install git-lfs
git lfs install- Clone the model repository to the desired directory
git clone https://huggingface.co/intfloat/multilingual-e5-smallRu Простой сервис для генерации эмбеддингов по переданному тексту. Хранит данные оффлайн в ChromaDB в разрезе топиков (sources). По переданной строке сервис вернет топ n ближайших совпадений.