Skip to content

Chat with LLMs using PDFs as context! Experimental exploration: FastAPI + Streamlit + Langchain

Notifications You must be signed in to change notification settings

aahnik/llm-pdf-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llm-pdf-chat

FastAPI + Streamlit + Langchain!

Running Locally

Make sure to have poetry package manger installed locally.

Configure the .env file as per the .env.template

  • Install all the dependancies locally:

    poetry install
    poetry shell # activate the virtual environment
  • To start the FastAPI backend server:

    # first make sure you have a mongo db server up and running
    # and that you have set the connection string in your .env file
    cd server
    uvicorn main:app --reload
    # --reload if you are developing and changing the source files

    This would start running the API on your localhost:8000 and you can access the Swagger Docs at /docs endpoint.

  • To start the streamlit web-interface:

    cd client
    streamlit run app.py

    This would start the streamlit app at localhost:8501.

Files Directory

Note: Files are shared between the streamlit and FastAPI code.

  • It is expected that both the processes are running on the same machine.
  • The environment variable, FILES_STORAGE_DIR is used by both the streamlit and FastAPI code.
  • The files uploaded from the streamlit interface are stored in this directory, and are accessed by langchain running in the server code of FastAPI.
  • Either write an absolute path, or the path must be wrt the parent of the client or server dirs. like ../uploaded_files/

About

Chat with LLMs using PDFs as context! Experimental exploration: FastAPI + Streamlit + Langchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages