CoffeeeAtNight / MilkyTeadrop_Bot

MilkyTeadrop: A versatile Discord bot for on-demand image generation and interactive Q&A, integrating a Rust backend and Python REST API. Enhances user engagement with easy-to-use commands and real-time responses.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MilkyTeadrop Discord Bot

MilkyTeadrop is a Discord bot designed to provide image generation and Q&A services. It interfaces with a Rust backend server for processing and forwarding questions to a local LLM and also prompts a Python-based AI Service exposing a Rest-API for image generation. It utilizes a custom-written upstream remote UNIX-based fileserver via REST-API to persist and retrieve images.

Examples:

image

image

Features

  • Ask Questions: Users can ask questions which are processed by a backend server.
  • Image Generation: Users can request image generation with specific prompts.

Setup and Installation

Prerequisites

  • Go
  • Rust / Cargo
  • Python / Pip
  • Discord Bot Token
  • 'MilkyTeadrop-Fileserver' or any other fileserver (might require changes to code)

Configuration

  1. Set up the Configuration File: Create a config.json file in the project root with the following content:
{
"Token": "YOUR_DISCORD_BOT_TOKEN"
}
  1. Rust Backend: Ensure the Rust backend server is running on 127.0.0.1:7878.

  2. Python REST API: Make sure the Python REST API is active on http://127.0.0.1:5000. (Note: You might need to donwload the model and specifc pip packages on your own for this to work. Also check if your system is capable to power the models used.)

  3. File Server: The MilkyTeadrop File Server should be reachable at http:/{IP}:7676. (Note: This is a custom written open-source standalone fileserver which exposes a REST-API, also avaliable on my github profile HERE)

Running the Bot

Execute the following commands to start the Discord bot:

cd ./scripts
./start.sh && ./start-python.sh

Usage

  • Asking Questions: Use the !ask [question] command in any Discord channel where the bot is present.
  • Requesting Images: Use the !img [prompt] command to generate images based on the provided prompt.

Notes

  • This README is not intended to fully guide you to setup the enviroment on your own machine and requires installation of seperate tools.
  • For the Q&A Model, I use ollama/llama2. A docker like system to serve locally hosted LLMs. llama2
  • The Stable Diffusion model is pulled from hugging face Stable Diffusion v1.5
  • THE CODE IS NOT INTENDED FOR PRODUCTION USE AND IS ONLY A FUN PROJECT OF MINE. SAME GOES FOR THE MILKYTEADROP-FILESERVER AS THE SYSTEM EXPOSES APIS THAT ARE VULNERABLE TO CYBER ATTACKS.

Contributing

Contributions to MilkyTeadrop are welcome!

Acknowledgements

  • Aki, the creator of MilkyTeadrop.
  • Mocha, Aki's cat and the unofficial mascot.

image (3)

About

MilkyTeadrop: A versatile Discord bot for on-demand image generation and interactive Q&A, integrating a Rust backend and Python REST API. Enhances user engagement with easy-to-use commands and real-time responses.


Languages

Language:Go 43.0%Language:Rust 33.7%Language:Python 16.8%Language:Shell 6.5%