Prototype of a LLM with access to python and system commands
Find a file
2024-10-05 21:45:27 +02:00
helper First commit 2024-10-05 16:33:07 +02:00
prompts First commit 2024-10-05 16:33:07 +02:00
.gitignore Initial commit 2024-10-05 14:05:56 +00:00
LICENSE Initial commit 2024-10-05 14:05:56 +00:00
main.py First commit 2024-10-05 16:33:07 +02:00
README.md Adding gif for readme 2024-10-05 21:45:27 +02:00
requirements.txt First commit 2024-10-05 16:33:07 +02:00

ExecAI

🚧 Prototype of a LLM with access to python and system commands. 🚧

The chatbot has full access to python eval and system console

⚠️ Use at your own risk, with caution. this chatbot could completely destroy your system ⚠️

Example Usage in Terminal Gif

Usage

Clone the repo

git clone https://codeberg.org/timedin/ExecAI.git
cd ExecAI

Create VENV and install librariees

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Run the script

python main.py

Arguments

  • -d or --debug Enable debug logging
  • --info Enable info logging (reduced logs, only shows direct LLM responses)
  • -i or --insecure-func Enable direct running of insecure functions (python exec and os.exec).

How does it work

This code instructs a LLM to use various functions (like python commands or shell commands) to do various things on your system. Like creating and reading files, accessing website, opening programs and shutting your system down.

First the user request is send to the LLM, this replies in a JSON format and specifies all functions it needs to run. The script runs the functions with the supplied parameters and sends the output back in another request to the LLM to let it respond with a matching confirmation.

Functions

The LLM knows the system the script is running on. It currently can use the following functions:

  • getDate, returns the current datetime
  • getUrl: Send GET-requests to websites
  • eval: Execute Python commands
  • os: Run System Console commands
  • exit: On user Request the Chatbot can exit the app