pip install -r requirements.txt
# .env file in lightrag_hepai/
Embedding_model_path="/path/to/embedding_model"
embedding_dimension=your_embedding_dimension
max_token_size=your_max_token_size
gpu_id=your_gpu_id
llm_api_key="your_api_key"
llm_base_url="your_base_url"
llm_model_name="openai/gpt-4o-mini"
working_dir="/path/to/working_dir"python run_worker.py
Run the following command in the root directory to build the Docker image:
docker build -t lightrag-backend:latest .Start a new container from the image:
docker run -d -p 4260:4260 --name lightrag-backend-container lightrag-backend:latestCheck if the container is running:
docker psYou should see an active container named lightrag-backend-container.
Open your browser and navigate to http://localhost:4260 to access the FastAPI backend.
- Swagger UI: http://localhost:4260/docs
docker stop lightrag-backend-containerdocker start lightrag-backend-containerFirst, stop the container if it's running:
docker stop lightrag-backend-containerThen, remove it:
docker rm lightrag-backend-containerdocker rmi lightrag-backend:latest-
Logs: To view logs from the running container, use:
docker logs -f lightrag-backend-container
-
Interactive Shell: To access the container's shell:
docker exec -it lightrag-backend-container /bin/bash -
Rebuilding the Image: If you make changes to the code or dependencies, rebuild the image:
docker build -t lightrag-backend:latest . docker stop lightrag-backend-container docker rm lightrag-backend-container docker run -d -p 4260:4260 --name lightrag-backend-container lightrag-backend:latest
python request_lightrag.py