A conversational AI agent that lets you upload any PDF and chat with its contents!
Built with smolagents, Google Gemini, pypdf, and Gradio.
| Layer | Technology | Purpose |
|---|---|---|
| LLM Orchestration | smolagents | Agent framework, tool integration |
| Language Model | Google Gemini 1.5 Flash | Large Language Model for Q&A |
| LLM API Adapter | LiteLLM | Unified LLM API interface |
| PDF Processing | pypdf | Extracts text from uploaded PDF files |
| Web UI | Gradio | Interactive chat interface |
| Environment Mgmt | python-dotenv | Loads environment variables (local dev) |
| Deployment | Hugging Face Spaces | Cloud hosting (public demo) |
git clone https://github.com/KunalGupta25/chat-with-pdf.git
cd chat-with-pdf
pip install -r requirements.txt
.env file in the project root:GEMINI_API_KEY=your_actual_key_here
python app.py
Open http://localhost:7860 in your browser.
GEMINI_API_KEY as a secret in the Space settings (if you duplicate or deploy privately)."gemini/gemini-1.5-flash" by default. If you have access to "gemini/gemini-1.5-pro", change the model_id in app.py.api_base needed for Gemini AI Studio keys.pypdf.@tool decorator from smolagents to add custom functions.app.py.MIT License.
See LICENSE for details.
Enjoy chatting with your PDFs!
For questions or contributions, open an issue or pull request.