duribeiro04

Deploy Safe: Local RAG System with Chinese Semantic Search 🚀

GitHub release License

Table of Contents

Overview

Deploy Safe is a local RAG (Retrieval-Augmented Generation) system that integrates advanced Chinese semantic search capabilities. It leverages the Ollama-based LLM (Large Language Model) to provide a powerful chatbot experience. The system runs on Nginx for hosting and utilizes DuckDNS for easy access.

For the latest release, please visit here to download and execute the necessary files.

Features

Installation

Prerequisites

Before you begin, ensure you have the following installed:

Steps

  1. Clone the Repository:

    git clone https://github.com/duribeiro04/deploy-safe.git
    cd deploy-safe
    
  2. Set Up the Environment:

    Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install Dependencies:

    Install the required Python packages:

    pip install -r requirements.txt
    

    For the frontend, navigate to the frontend directory and install the necessary packages:

    cd frontend
    npm install
    
  4. Configure Nginx:

    Set up Nginx to serve your application. Create a configuration file in /etc/nginx/sites-available/deploy-safe:

    server {
        listen 80;
        server_name your_domain_or_IP;
    
        location / {
            proxy_pass http://localhost:8000;  # Update with your backend URL
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
    

    Enable the configuration and restart Nginx:

    sudo ln -s /etc/nginx/sites-available/deploy-safe /etc/nginx/sites-enabled/
    sudo systemctl restart nginx
    
  5. Run the Application:

    Start the backend server:

    uvicorn main:app --host 0.0.0.0 --port 8000
    

    For the frontend, navigate back to the frontend directory and run:

    npm run dev
    

Usage

Once the application is running, you can access it through your browser at http://your_domain_or_IP. The chatbot interface will allow you to enter queries in Chinese, and you will receive responses powered by the Ollama LLM.

Example Queries

The system will utilize its semantic search capabilities to provide relevant information and engage in meaningful conversations.

Architecture

Deploy Safe is designed with a modular architecture. Here’s a brief overview:

Architecture Diagram

Technologies Used

Contributing

We welcome contributions to Deploy Safe. If you want to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/YourFeature).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a pull request.

Please ensure your code adheres to the project’s coding standards and includes appropriate tests.

License

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

Contact

For questions or support, please reach out:

For the latest release, visit here to download and execute the necessary files.