- Python =3.11
It is implementation of inferencing pipeline.
- Create, activate virtual environment, and install the dependencies.
- Look at
config.ini
file forSTORAGE_ROOT_PATH
anddpp_input_config_file_path
and create path.
e.g. Create C:/DPP/infy_libraries_client/STORAGE/ - Copy config file from
\apps\config\dpp_docwb_infy_search_service_processor_input_config.json
toSTORAGE_ROOT_PATH
+dpp_input_config_file_path
e.g. C:/DPP/infy_libraries_client/STORAGE/data/config/ dpp_docwb_infy_search_service_processor_input_config.json - If centralised db is being used to query from (i.e. indexed stored via infy_db_service), modify config file of infy_search_service:
- Enable
infy_db_service
undervectordb
andsparseindex
ofQueryRetriever
andReader
processor config - Provide value for
db_service_url
understorage
ofQueryRetriever
processor.- For vectordb
http://<hostname>:8005/api/v1/vectordb/getmatches
- For sparseindex
http://<hostname>:8005/api/v1/sparsedb/getmatches
.
(Replace the hostname from URL with your hostname).
"QueryRetriever": { "embedding": {}, "storage": { "vectordb": { "faiss": {}, "infy_db_service": { "enabled": true, "configuration": { "db_service_url": "http://localhost:8005/api/v1/vectordb/getmatches", "model_name": "", "index_id": "", "collections": [ { "collection_name": "", "collection_secret_key": "" } ] } } }, "sparseindex": { "bm25s": {}, "infy_db_service": { "enabled": true, "configuration": { "db_service_url": "http://localhost:8005/api/v1/sparsedb/getmatches", "method_name": "", "index_id": "", "collections": [ { "collection_name": "", "collection_secret_key": "" } ] } } } }, "hybrid_search": { "rrf": { "enabled": true }, "queries": [] }
- For vectordb
- Enable
- At
variables
part of the config file provide respective LLM URL and Key to be used, underReader
processor for fetching answer. - When you run the code from local, run this in browser http://localhost:8004/api/v1/docs#
- Now use
http://localhost:8004/api/v1/inference/search
API by passingquestion
andindex_id
(created at time of indexing pipeline; checkprocessor_response_data.json
file after running indexing pipeline for it).
- Run
BuildPackage.bat
. - Package will be available at
apps\infy_search_service\target
.
- Copy the package from
apps\infy_search_service\target
to target server machine where you want to deploy. - Create and activate a virtual environment:
python -m venv .venv source ./.venv/bin/activate
- Upgrade pip:
pip install --upgrade pip
- Install required dependencies
pip install -r requirements.txt
- Steps to follow for only the first time you are setting up the service.
- Update Firewall:
( replace <port_number> with the port number used for this service in code)sudo firewall-cmd --zone=public --add-port=8004/tcp --permanent sudo firewall-cmd --reload
- Start in Foreground (for Verification):
Make sure you are inside the service folder and run the following commands:export PYTHONPATH=`pwd`/src cd src python main.py
- Copy the service file to the systemd directory:
sudo cp infy_search_service.service /etc/systemd/system/
- Verify the service file:
sudo cat /etc/systemd/system/infy_search_service.service
- Enable and start the service:
sudo systemctl enable infy_search_service.service
sudo systemctl daemon-reload
sudo systemctl start infy_search_service.service
sudo systemctl status infy_search_service.service
Verify if the URL is working from browser.
http://<hostname>:8004/api/v1/docs