Moss is my graduation project based on HuggingGPT. It is a system based on large language model agents designed to tackle complex artificial intelligence tasks, powerd by LangChain.
🏗️ Road Work Ahead
Moss presents a collaborative system comprising LLM agents serving as controllers and multiple expert tools acting as collaborative executors. The workflow encompasses:
- Task Planning: Employing LLMs to analyze user requests to comprehend their intentions and break them down into feasible solvable tasks.
- Tool Selection: In order to address the planned tasks, LLM chooses appropriate expert tools considering their descriptions.
- Task Execution: LLM invokes and executes each selected tool, subsequently delivering the results.
- Response Generation: Ultimately, LLM integrates the predictions made by all tools and generates appropriate responses in friendly natural language.
- Clone this repository
$ git clone https://github.com/MoyusiteruIori/moss.git
$ cd moss
- Create configuration file from template
$ cp .env.example .env
Replace OPENAI_API_KEY
, HF_TOKEN
and SD_TOKEN
in .env
file with your own keys/tokens. If you don't know what these are, see openai-api, huggingface and stability.ai.
Note: Only Linux systems are guaranteed good support as the host machine for this Docker image. Ubuntu 22.04 is recommended.
Option 1: Use docker-compose (recommended):
$ docker compose up -d
# To utilize your local GPUs for certain local inferences:
# INFERENCE_MODE=HYBRID docker compose up -d
Option 2: Build a Docker image locally and manually start:
$ docker build -t moss .
# To utilize your local GPUs for certain local inferences:
# docker build --build-arg INFERENCE_MODE=HYBRID -t moss .
$ docker run -p 7860:7860 --name moss moss
Linux and macOS are supported.
- Install dependencies
conda create -n moss python=3.11
conda activate moss
pip install -r requirements.txt
Optional: To utilize your local GPUs for certain local inferences, you'll need some extra packages (Linux only) :
pip install accelerate==0.29.3 diffusers==0.27.2 controlnet-aux==0.0.8 transformers==4.40.1
- Run gradio demo
python gradio_demo.py
You can then access localhost:7860
to use moss.
- Run command line version
python cli.py
Demo video for my final presentation!