{"id":24064530,"url":"https://github.com/sourasishbasu/chatpdf-clone-llama2b","last_synced_at":"2026-03-12T23:32:00.663Z","repository":{"id":214835990,"uuid":"737467711","full_name":"SourasishBasu/ChatPDF-clone-llama2b","owner":"SourasishBasu","description":"Chatbot app for interactively conversing with PDFs","archived":false,"fork":false,"pushed_at":"2023-12-31T07:48:40.000Z","size":24,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T21:38:51.936Z","etag":null,"topics":["astradb","chatbot","gradientai","llama2","llama2-7b","llm","meta","python","streamlit-webapp","vector-database"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SourasishBasu.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}},"created_at":"2023-12-31T06:18:47.000Z","updated_at":"2024-11-07T09:40:43.000Z","dependencies_parsed_at":"2023-12-31T08:37:18.231Z","dependency_job_id":null,"html_url":"https://github.com/SourasishBasu/ChatPDF-clone-llama2b","commit_stats":null,"previous_names":["sourasishbasu/chatpdf-clone-llama2b"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SourasishBasu/ChatPDF-clone-llama2b","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourasishBasu%2FChatPDF-clone-llama2b","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourasishBasu%2FChatPDF-clone-llama2b/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourasishBasu%2FChatPDF-clone-llama2b/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourasishBasu%2FChatPDF-clone-llama2b/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SourasishBasu","download_url":"https://codeload.github.com/SourasishBasu/ChatPDF-clone-llama2b/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SourasishBasu%2FChatPDF-clone-llama2b/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502666,"owners_count":23618671,"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","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":["astradb","chatbot","gradientai","llama2","llama2-7b","llm","meta","python","streamlit-webapp","vector-database"],"created_at":"2025-01-09T10:37:48.648Z","updated_at":"2026-03-12T23:32:00.603Z","avatar_url":"https://github.com/SourasishBasu.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatPDF Clone\n\u003e Chatbot app for interactively conversing with documents\n\n# Introduction\n\nWith the emergence of services like ChatGPT, showcasing the power of LLMs and RAG in generating contextually relevant responses, I was motivated to understand their underlying mechanics. It led to me working on this chatbot which not only converses intelligently but also interacts seamlessly with PDF documents.\n\n# Technical Overview\n\nWe utilize LlamaIndex, enhanced with the Llama2 model API using Gradient's LLM solution, seamlessly merge it with DataStax's Apache Cassandra as a vector database and develop the frontend UI with Streamlit using Python.\n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/89c8505f-4c5a-429c-bade-03e4fdc7f7d2)\n\u003cp align=\"center\"\u003e\u003cstrong\u003eArchitecture Diagram\u003c/strong\u003e\u003c/p\u003e\n\n### LlamaIndex\nServes as a powerful framework for handling embeddings, efficient document indexing and retrieval. \n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/e6588ecf-f1ec-49ab-b354-11f23a76ea08)\n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/be5095a7-4b4c-409c-861d-1a6c33092ddd)\n\u003cp align=\"center\"\u003e\u003cstrong\u003eRetriever Engine\u003c/strong\u003e\u003c/p\u003e\n\n### GradientAI's LLM\nBy tapping into Gradient's LLM solution, we leverage state-of-the-art open source language models such as Meta's LLAMA 2 model specifically `llama-2b-chat`, allowing the chatbot to generate coherent and informed responses. \n\n### Cassandra Vector Store\nIntegrates Apache Cassandra as a vector database, offering a solution for storing and managing vector embeddings of the provided documents which facilitates efficient retrieval and storage of document-related information.\n\n### Streamlit\nSimplifies the creation and deployment of web applications, providing a user friendly interface to initiate conversations with chatbot, explore document-related insights, and experience immersive interactions with PDFs in a visually appealing manner.\n\n# Prerequisites\n\n- Python 3.9 or above\n- **GradientAI Account**:\n  - Create an account on GradientAI to access the LLMs required for training and deploying models.\n  - Create a new workspace \u0026 generate and store your `Access token` and `Workspace ID` credentials as secrets/environment variables.\n\n- **AstraDB Account**\n  - Set up an account on AstraDB, a cloud-native database service built on Apache Cassandra and create a Vector Database.\n  - Under Connect generate an App Token as `Database Administrator` and save the `app-token.json` and the `Secure-Connect-Bundle.zip`.\n\n  ![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/50570a51-fade-485d-b747-f8ba308f16e7)\n\n# Setup\n\nTo set up ChatPDF Clone, follow these steps:\n\n1. **Clone the Repository**: Clone the ChatPDF Clone repository to your local machine.\n   ```bash\n   git clone https://github.com/your-username/ChatPDF-Clone.git\n   ```\n\n2. **Install Dependencies**: Navigate to the project directory and install the necessary dependencies.\n   ```bash\n   cd ChatPDF-Clone/project\n   pip install -r requirements.txt\n   ```\n\n3. **Configure Credentials**: Add the GradientAI credentials as environment variables to your project environment. Copy the `Secure-Connect-Bundle.zip` and `app-token.json` into the project root directory.\n\n## Open in Google Colab\n\nClick to open the Notebook directly in Google Colab. Configure the access tokens under the Secrets section and upload PDFs into the Documents folder.\n\n\u003cp\u003e\u003ca href=\"https://colab.research.google.com/github/SourasishBasu/ChatPDF-clone-llama2b/blob/main/ChatPDF_Clone.ipynb\" target=\"_blank\"\u003e\u003cimg height=\"30\" src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/\u003e\u003c/a\u003e\u003c/p\u003e\n\n# Usage\n\nOnce the setup is complete, you can use ChatPDF Clone for interactive conversations. Run the script as follows and navigate to the locahost URL generated to access the webapp:\n\n```bash\nstreamlit run main.py\n```\n\nIn the following examples, I provided the PDF for a [summary of Merchant of Venice](https://pennstatelaw.psu.edu/_file/TheMerchantofVeniceSummary.pdf) to the service.\n\n### Screenshots\n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/503c9af3-3f25-4b49-9a78-e4fb90444a85)\n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/3c632afd-a807-408b-80c5-1fe815d4a41e)\n\n![image](https://github.com/SourasishBasu/ChatPDF-clone-llama2b/assets/89185962/526195de-ca55-4289-9c72-694ba6e6c2b5)\n\n\n## Challenges\n\nDuring the development of ChatPDF Clone, we encountered several challenges, including:\n\n- **Integration Complexity**: Integrating GradientAI and AstraDB posed challenges in terms of authentication and data synchronization.\n- **Retrieval Performance**: Retrieval Accuracy and Speed was severely affected with increase in document quantity.\n- **Handling Dynamic Conversations**: Adapting the chatbot to handle dynamic and evolving conversations while maintaining coherence presented a challenge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourasishbasu%2Fchatpdf-clone-llama2b","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourasishbasu%2Fchatpdf-clone-llama2b","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourasishbasu%2Fchatpdf-clone-llama2b/lists"}