Skip to content

mrzaizai2k/LLM-with-RAG

Repository files navigation

LLM-with-RAG

I just wanna build my own LLM with RAG

CI/CD Repo Size License Release

Table of Contents

  1. Introduction
  2. Features
  3. How to Set Up
  4. Example Uses
  5. To-Do List

Introduction

Welcome to the my LLM with RAG system! This system is designed for me the ease the learning as a master in HCMUT

Features

  1. Update vector database

         curl -X POST http://localhost:8083/update
    
  2. Ask questions with vector data

         curl -X POST -H "Content-Type: application/json" -d '{"query": "who is karger"}' http://localhost:8083/query
    

Nougat

Link: https://github.com/facebookresearch/nougat

  nougat data/web_data/Growth_of_Functions.pdf --markdown --no-skipping -m 0.1.0-base -o data/nougat

How to Set Up

Prerequisites

Before running the system, follow these steps to set up the environment:

  1. Clone the Repository:

    • Close the Git repository to your local machine:
      git clone [repository_url]
  2. Install Dependencies:

  • Navigate to the project directory and install the required packages using the provided setup.txt file:

    pip install -r setup.txt
  • To read .ppt file we need to run this code

      apt update
      apt install libreoffice 
    
  1. Get OPENAI_API_KEY Key:

    • Google and get OPENAI_API_KEY from OpenAI
  2. Create .env File:

    • Create a new file named .env in the project root directory.
    • Add the following line to the file
      OPENAI_API_KEY=YOUR_OPENAI_API_KEY

Run docker

For Linux you must open the port first:

  sudo ufw allow 8083

docker:

  docker build -t mrzaizai2k/llm_n_rag .
  docker run -p 8083:8083 -v data:/app/data -e OPENAI_API_KEY llm_test

Build, run docker compose:

  docker-compose up

Test docker on port 8083:

  curl -X POST -H "Content-Type: application/json" -d '{"query": "who is karger"}' http://localhost:8083/query
  curl -X POST http://localhost:8083/update

Example Uses

Explore practical implementations and demonstrations of the functions in the notebook folder. These examples showcase real-world scenarios, illustrating how the chatbot can be effectively utilized for stock market monitoring.

To-Do List

  • Update some features with langchain
  • Build the docker to use with my Telegram bot