Welcome to the AI-Powered Multi-Mode RAG App repository! This project provides a Python application built using Streamlit
, ChromaDB
, and Ollama
. It allows users to upload multiple file formats (TXT, MD, PDF, DOCX, ODT, RTF), scrape web pages, and perform queries on extracted content using powerful large language models (LLM).
This repository simplifies the process of extracting text content from various documents and webpages, storing it in a vector database (ChromaDB), and using AI models for retrieval-augmented generation (RAG) to enhance querying accuracy.
This repository contains the following files:
llm_rag.py
- Python file containing all the codesrequirements.txt
- A list of Python libraries required to run this appREADME.md
- Documentation and instructuionsgit clone https://github.com/bernardtse/llm-rag.git cd llm-rag
pip install -r requirements.txt
Note: Ensure Python 3 is installed, and that the libraries in requirements.txt
are compatible with each other, as some versions may conflict and cause errors.
Ollama is required to run the LLM models. Visit Ollama’s official website for installation details.
Before running the app, you will need to pull the necessary models. Use the following commands to download the models required for the app:
ollama pull llama3.2 # LLM Model ollama pull nomic-embed-text # Embedding Model
Before proceeding, make sure that Ollama is running. You can start Ollama using either the graphical user interface (GUI) or by running the following command:
ollama serve
To verify that Ollama is running, open your browser and go to http://localhost:11434. If the application is active, you should see the message: Ollama is running
.
streamlit run llm_rag.py
Text Files Processing:
Document Files Processing:
Web Scraping:
By default, the application uses llama3.2
as the LLM model and nomic-embed-text
as the embedding model. You can modify the models used in the Python file. Details of each model can be found on Ollama's website. If you wish to use different models, you can pull your preferred models from Ollama. Here’s how:
ollama pull your-preferred-llm-model # LLM Model ollama pull your-preferred-embedding-model # Embedding Model
In llm_rag.py
, you will find model selection variables at the top. Modify these lines to set your preferred models:
LLM_MODEL = "llama3.2" # Change this for your preferred LLM model
EMBEDDING_MODEL = "nomic-embed-text" # Change this for your preferred embedding model
Simply update the model names and re-run the app.
This project is licensed under the MIT License. See LICENSE for more information.
This project is developed and maintained by Bernard Tse, with assistance from OpenAI’s ChatGPT in areas such as code refinement, optimisation, and debugging.
There are no models linked
There are no datasets linked
There are no models linked
There are no datasets linked