Use natural language when interacting with PDF files.
Ask questions, and receive answers using a locally hosted LLaMA model.
|-- backend/
| |-- app/ # FastAPI Endpoints
| |-- models/ # Contains the LLaMA GGUF File
| |-- uploads/ # Folder where Uploaded Files are Stored
| |-- Dockerfile
|
|-- frontend/
| |-- src/
| | |-- assets/ # Logo SVG
| | |-- components/
| |-- App.jsx
| |-- main.jsx
|
| |-- Dockerfile
| |-- package.json
|
|-- docker-compose.yml
|-- README.md
|-- requirements.txt
|-- app/
| |-- main.py # Intialises FastAPI
| |-- api.py # Connection and Comunication with LLaMa and Database
| |-- utils.py # Utility Functions for User Interaction
|
|-- models/
| |-- mistral-7b-instruct-v0.1.Q4_K_M.gguf
|
|-- uploads/
| |-- Sample1.pdf
| |-- Sample2.pdf
|
|-- .env
|
|-- Dockerfile
|-- src/
| |-- assets/
| | |-- logo.svg
|
| |-- components/
| | |-- Components.jsx
|
| | |-- ChatSection.jsx # Displays Chat + Text Box
| | |-- DarkModeToggle.jsx # Light/Dark Mode
| | |-- ModalUpload.jsx # Used for Uploading PDFs
| | |-- Navbar.jsx # Navigation bar with Logo and Utility Buttons.
| | |-- Sidebar.jsx # Shows the List of Uploaded PDFs
|
| |-- App.css
| |-- App.jsx
| |-- index.css # Colour Palette Definition for Light/Dark Mode
| |-- main.jsx
|
|-- .env
|-- .gitignore
|-- Dockerfile
- Upload your PDF documents.
- Enquire about any Uploaded File in Plain Language.
- Integration of LLaMA model (using mistral-7b-instruct).
- The Per-File Chat History Enabled by MongoDB.
- Dockerized Deployment.
- Toggle between Light and Dark Mode.
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload
cd frontend
npm install
npm run dev
Click on Connect to localhost:27017
In browser, open the Ask-PDF Website at localhost:5173
i/o type | i/o Value |
---|---|
Request | Form Data (File) |
Response | File Name |
i/o type | i/o Value |
---|---|
Request | File Name, Query |
Response | Answer |
i/o type | i/o Value |
---|---|
Request | Sender, Text, File Name |
Response | Status (Saved) |
i/o type | i/o Value |
---|---|
Request | Internal Hit |
Response | [Sender, Text] |
- Handles File Uploads and Text Extraction.
- Uses llama_index with local LLaMA model (GGUF format).
- Stores Chat History in MongoDB.
Feature | File |
---|---|
Upload PDFs | ModalUpload.jsx |
Interact via Chat | ChatSection.jsx |
Sidebar displays List of PDFs | Sidebar.jsx |
Light/Dark Mode | DarkModeToggle.jsx |
- LLaMA Model: mistral-7b-instruct-v0.1.Q4_K_M.gguf
- Loaded with llama-cpp-python.
- MongoDB container.
- Stores Chat Messages per Filename.
- fastapi
- uvicorn
- pymongo
- llama-cpp-python
$pip install -r requirements.txt
- axios
- react
- vite
- tailwind
$npm install