{"id":25059569,"url":"https://github.com/shubhammandowara/llm_rag","last_synced_at":"2026-04-14T14:32:59.263Z","repository":{"id":275778582,"uuid":"927154924","full_name":"ShubhamMandowara/llm_rag","owner":"ShubhamMandowara","description":"🚀 Transform Any PDF into an AI-Powered Q\u0026A Chatbot!","archived":false,"fork":false,"pushed_at":"2025-02-28T12:50:50.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T10:39:26.029Z","etag":null,"topics":["faiss","huggingface","langchain","llm","llm-rag","llm-rag-chatbot","pdf-chat-bot","pdf-chatbot","qna","questions-and-answers","rag","streamlit","vector-database"],"latest_commit_sha":null,"homepage":"https://pdfllmrag.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShubhamMandowara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-04T13:53:19.000Z","updated_at":"2025-03-12T16:16:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"cca2b569-427c-4551-aa88-845d5afbb0f2","html_url":"https://github.com/ShubhamMandowara/llm_rag","commit_stats":null,"previous_names":["shubhammandowara/llm_rag"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ShubhamMandowara/llm_rag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhamMandowara%2Fllm_rag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhamMandowara%2Fllm_rag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhamMandowara%2Fllm_rag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhamMandowara%2Fllm_rag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShubhamMandowara","download_url":"https://codeload.github.com/ShubhamMandowara/llm_rag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShubhamMandowara%2Fllm_rag/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272566827,"owners_count":24956660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faiss","huggingface","langchain","llm","llm-rag","llm-rag-chatbot","pdf-chat-bot","pdf-chatbot","qna","questions-and-answers","rag","streamlit","vector-database"],"created_at":"2025-02-06T15:35:18.965Z","updated_at":"2026-04-14T14:32:59.192Z","avatar_url":"https://github.com/ShubhamMandowara.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📖 PDF Q\u0026A Chatbot using Streamlit \u0026 Hugging Face API\n\n## 🚀 Overview\nThis project is a **PDF-based Q\u0026A chatbot** built with **Streamlit**, **FAISS** for similarity search, and **Hugging Face Inference API** for generating answers. Users can upload a **PDF file**, ask questions about its content, and receive answers using an **LLM (e.g., Mistral-7B, Falcon-7B, Llama-3, etc.)**.\n\n---\n\n## 🎯 Features\n✅ **Upload PDFs** \u0026 extract text + tables 📄  \n✅ **Vector search with FAISS** for retrieving relevant text 🔍  \n✅ **Generate answers using Hugging Face Inference API** 🤖  \n✅ **Streamlit UI for easy interaction** 🖥️  \n✅ **Supports any Hugging Face text generation model** 🔄  \n\n---\n\n## 🛠️ Installation\n\n### **1️⃣ Clone the Repository**\n```bash\ngit clone https://github.com/ShubhamMandowara/llm_rag.git\ncd pdf-qna-chatbot\n```\n\n### **2️⃣ Create a Virtual Environment**\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n### **3️⃣ Install Dependencies**\n```bash\npip install -r requirements.txt\n```\n\n---\n\n## 🔑 Set Up Hugging Face API Token\n1. Get your API token from [Hugging Face Tokens](https://huggingface.co/settings/tokens).\n2. When running the Streamlit app, enter the API token in the provided input field.\n3. Or, store it in **Streamlit secrets** by adding to `.streamlit/secrets.toml`:\n   ```toml\n   [secrets]\n   HUGGINGFACEHUB_API_TOKEN = \"your_token_here\"\n   ```\n\n---\n\n## 🎯 Usage\n\n### **Run the Streamlit App**\n```bash\nstreamlit run app.py\n```\n\n### **How It Works**\n1️⃣ **Upload a PDF** to extract text \u0026 tables.  \n2️⃣ **FAISS retrieves relevant text chunks** from the document.  \n3️⃣ **Hugging Face Inference API** generates an answer based on context.  \n4️⃣ **Streamlit UI displays the answer.** 🎉  \n\n---\n\n## 🏗️ Project Structure\n```\n📂 pdf-qna-chatbot\n│── app.py              # Main Streamlit app\n│── requirements.txt    # Required dependencies\n│── secrets.toml         # Streamlit config folder (for secrets)\n```\n\n---\n\n## 📌 Example Models (Change in `app.py`)\n- **Mistral-7B**: `mistralai/Mistral-7B-Instruct`\n- **Llama-3**: `meta-llama/Llama-3-8B`\n- **Falcon-7B**: `tiiuae/falcon-7b-instruct`\n\nTo change the model, update:\n```python\nHF_MODEL = \"mistralai/Mistral-7B-Instruct\"  # Change to your preferred model\n```\n\n---\n\n## 🛠️ Troubleshooting\n### **1️⃣ Model Not Found / API Issues**\n- Ensure your **Hugging Face API token** is correct.\n- Check if the model is **public** and supports the **Inference API**.\n- Try testing API manually:\n  ```bash\n  curl -H \"Authorization: Bearer your_api_token\" https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct\n  ```\n\n### **2️⃣ FAISS Index Not Working**\n- Ensure FAISS is installed:\n  ```bash\n  pip install faiss-cpu  # Or faiss-gpu if using CUDA\n  ```\n\n### **3️⃣ Streamlit Not Running**\n- Restart the app after setting environment variables:\n  ```bash\n  streamlit run app.py\n  ```\n\n---\n\n## 📜 License\nThis project is **open-source** under the GPL-3.0 License.\n\n---\n\n## 👨‍💻 Author\nDeveloped by [Shubham Mandowara](https://github.com/shubhammandowara). Contributions are welcome! 😊🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhammandowara%2Fllm_rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshubhammandowara%2Fllm_rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshubhammandowara%2Fllm_rag/lists"}