The PDF AI Assistant enhances document interaction by allowing users to upload, summarize, and ask questions about PDFs using Large Language Models (LLMs). This system is built with FastAPI for backend processing, Streamlit for the user interface, LiteLLM for efficient API interactions, and Redis for caching. The entire application is deployed using Docker Compose for seamless cloud deployment.
Codelab: https://asavari24.github.io/BigDataAssignment4Part1/#0
The system follows a structured approach:
- Document Selection → Users can choose previously parsed PDFs or upload new ones.
- Text Processing → Extracts and structures PDF content for analysis.
- Summarization & Q&A → Leverages LLMs to summarize content and answer queries.
- Model Pricing & Usage → Calculates token usage and cost estimation per model.
- Deployment & Integration → Uses Docker for deployment and integrates Redis for caching and S3 for storage.
- Users can select from previously parsed PDFs or upload new ones.
- Uploaded PDFs are processed, and extracted text is stored for further interactions.
- Supports multiple LLM models:
- GPT-4o (OpenAI)
- Gemini-Flash (Google)
- DeepSeek
- Claude (Anthropic)
- Grok (xAI)
- Summarizes document content concisely.
- Provides accurate responses based on document context.
- Caches processed PDFs and summaries to reduce redundant API calls.
- Enhances response speed for frequently accessed documents.
- Calculates token consumption per model for cost transparency.
- Provides an estimate of total query cost before execution.
- Docker Compose setup for containerized deployment.
- Uses AWS S3 for file storage and retrieval.
- Redis is utilized for temporary caching of processed content.
Frontend: Streamlit UI for interactive user engagement.
Backend: FastAPI for API endpoints handling document selection, uploads, summarization, and question-answering.
LLM Integration: LiteLLM is used to manage multiple LLM API connections efficiently.
Storage & Caching:
- Redis: Temporarily caches extracted content for quick access.
- AWS S3: Stores parsed markdown files for long-term retrieval.
- GitHub Repository
- Includes well-organized source code with documentation.
- Clear API documentation and implementation details.
- AIUseDisclosure.md outlining AI tools used.
- README.md with project overview and usage guide.
