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
- 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.
- Python 3.10 or higher
- A virtual environment (recommended)
Clone the AnyChat repository from GitHub:
git clone https://github.com/shitan198u/AnyChat.git
cd Anychat
-
Install the Rye package manager: Installation Guide
-
Sync the project:
rye sync
- Create a virtual environment:
python -m venv anychat-env
- Activate the virtual environment:
source anychat-env/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Create a conda environment:
conda create -n anychat-env python=3.12
- Activate the conda environment:
conda activate anychat-env
- Install the required dependencies:
conda install --file requirements.txt
- Rename the
secrets_example.toml
file tosecrets.toml
in thesrc/anychat/.streamlit/
directory.
To use Ollama for AnyChat, you need to install Ollama and download the necessary models. Follow the instructions below:
- Install Ollama:
Visit the official Ollama website for installation instructions: Ollama Download
- 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.
- 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.
- Run the Application:
cd src/anychat
streamlit run chatbot.py
- Using Rye
cd src/anychat
rye run streamlit run chatbot.py
- Upload Documents:
- In the Streamlit interface, upload the documents you want to chat with.
- Click the "Process" button to process the documents.
- 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.
This project is licensed under the MIT License. See the LICENSE
file for details.
- 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.