danny-avila / rag_api

ID-based RAG FastAPI: Integration with Langchain and PostgreSQL/pgvector
https://librechat.ai/
143 stars 60 forks source link

LibreChat unable to connect to local RAG API #31

Closed K-J-VV closed 2 months ago

K-J-VV commented 2 months ago

The guide I am following is: https://docs.librechat.ai/features/rag_api.html#configuration

Per the rag-dev container, everything looks fine:

024-05-05 21:02:57,510 - uvicorn.error - INFO - Application startup complete.
2024-05-05 21:02:57,510 - uvicorn.error - INFO - Uvicorn running on http://10.10.10.11:8000

However, per the librechat container, it can't bind to the RAG container (they're on the same network):

2024-05-05 21:05:13,764 - uvicorn.error - INFO - Application startup complete.
2024-05-05 21:05:13,765 - uvicorn.error - ERROR - [Errno 99] error while attempting to bind on address ('10.10.10.11', 8000): cannot assign requested address
2024-05-05 21:05:13,765 - uvicorn.error - INFO - Waiting for application shutdown.
2024-05-05 21:05:13,765 - uvicorn.error - INFO - Application shutdown complete.

.env variables are:

RAG_API_URL=http://10.10.10.11:8000 RAG_HOST=10.10.10.11 RAG_PORT=8000

FYI... it seems that the RAG environment variables can't understand when other variables are referenced. Example: in my .env file if I set RAG_PORT=${RAG_PORT_EXPOSED} and another variable set as RAG_PORT_EXPOSED=8000 then I have an error saying the RAG port needs to be a number. So it appears it's reading the text directly ather than referencing the value of RAG_PORT_EXPOSED?

I've noticed this problem only with variables relating to the RAG API container

K-J-VV commented 2 months ago

My problem on both parts; working!

  1. was not using the librechat-dev container, was just using the standard container
  2. formatting issue on my part regarding env variables