Skip to content

Chat with your Documents(PDF, TXT, DOCX, ODT, PPTX etc), Websites and Youtube Chat too!, CSV files. Uses langchain, Ollama, Groq, Gemini, Streamlit. Llama3 available

License

Notifications You must be signed in to change notification settings

shitan198u/AnyChat

Repository files navigation

AnyChat: Chat with Your Documents

AnyChat is a powerful chatbot that allows you to interact with your documents (PDF, TXT, DOCX, ODT, PPTX, CSV, etc.) in a natural and conversational way. It leverages the capabilities of LangChain, Ollama, Groq, Gemini, and Streamlit to provide an intuitive and informative experience.

Chatbot-20_04_24.mp4

Features

  • Conversational Interaction: Ask questions about your documents and receive human-like responses from the chatbot.
  • Multi-Document Support: Upload and process various document formats, including PDFs, text files, Word documents, spreadsheets, and presentations.
  • Website-Chat Support: Chat with any valid website.
  • Advanced Language Models: Choose from different language models (LLMs) like Ollama, Groq, and Gemini to power the chatbot's responses.
  • Embedding Models: Select from Ollama Embeddings or GooglePalm Embeddings to enhance the chatbot's understanding of your documents.
  • User-Friendly Interface: Streamlit provides a clean and intuitive interface for interacting with the chatbot.

Installation

Prerequisites

  • Python 3.10 or higher
  • A virtual environment (recommended)

Clone the Repository

Clone the AnyChat repository from GitHub:

git clone https://github.com/shitan198u/AnyChat.git

Navigate to the working directory

cd Anychat

Using Rye (Recommended)

  1. Install the Rye package manager: Installation Guide

  2. Sync the project:

rye sync

Using venv

  1. Create a virtual environment:
python -m venv anychat-env
  1. Activate the virtual environment:
source anychat-env/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt

Using conda

  1. Create a conda environment:
conda create -n anychat-env python=3.12
  1. Activate the conda environment:
conda activate anychat-env
  1. Install the required dependencies:
conda install --file requirements.txt

Configuration

  • Rename the secrets_example.toml file to secrets.toml in the src/anychat/.streamlit/ directory.

Ollama Installation

To use Ollama for AnyChat, you need to install Ollama and download the necessary models. Follow the instructions below:

  1. Install Ollama:

Visit the official Ollama website for installation instructions: Ollama Download

  1. Download Ollama Models:

Open your terminal and run the following commands to download the required models:

ollama pull nomic-embed-text

This command downloads the nomic-embed-text model, which is necessary for running Ollama embeddings.

ollama pull openchat

This command downloads the openchat model, which you can use as a language model in AnyChat.

Usage

  1. Set API Keys:
  • If you're using Google Gemini or Groq, obtain the necessary API keys and store them securely in the src/anychat/.streamlit/secrets.toml file or Upload them in the chatbot interface.
  1. Run the Application:
cd src/anychat
streamlit run chatbot.py
  1. Using Rye
cd src/anychat
rye run streamlit run chatbot.py
  1. Upload Documents:
  • In the Streamlit interface, upload the documents you want to chat with.
  • Click the "Process" button to process the documents.
  1. Start Chatting:
  • Once the documents are processed, you can start asking questions in the chat input field.
  • The chatbot will analyze your documents and provide relevant answers based on their content.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Additional Notes

  • For optimal performance, ensure you have the necessary resources (CPU, RAM) to handle the document processing and LLM computations.
  • The chatbot's accuracy and responsiveness may vary depending on the complexity of your documents and the chosen LLM.
  • Consider using a GPU-enabled environment if you have access to one, as it can significantly speed up the processing.

About

Chat with your Documents(PDF, TXT, DOCX, ODT, PPTX etc), Websites and Youtube Chat too!, CSV files. Uses langchain, Ollama, Groq, Gemini, Streamlit. Llama3 available

Topics

Resources

License

Stars

Watchers

Forks

Languages