Skip to content
Scripts and code to make a slack bot that's almost, but not quite entirely unlike Libby
JavaScript Python Shell Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Scripts and code to make a slack bot that's almost, but not quite entirely unlike Libby.

This code is a couple of hours' work and therefore adapts others' code and may in places be shit. All the shit parts are mine. It uses python for the ML parts, node for the slackbot and ruby and bash for scripting.

see for more detail.

For a Pi 4

Burn a 16GB+ SD card using Etcher

then, on a laptop

touch /Volumes/boot/ssh
nano /Volumes/boot/wpa_supplicant.conf

set wifi contents

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev


Boot up the pi and log in.

Use virtualenv

virtualenv -p python3 env
cd env/
source bin/activate

Download the gpt-2 model

Not actually sure if this is needed if you've built your own model, but anyway

git clone
git checkout finetuning
cd gpt-2/
git checkout finetuning
pip3 install -r requirements.txt 
python3 src/ 117M

Add the fine-tuned model

'libby' is the name of my pre-built fine-tuned model - see the blog post or for more detail on how

mv ~/libby models/
mv ~/ src/
pip3 install flask
pip3 install numpy
sudo apt-get install libatlas-base-dev
curl -O
pip3 install tensorflow-1.13.1-cp37-none-linux_armv7l.whl
python3 src/

Add the slackbot

sudo apt-get install npm
npm install
SLACK_API_TOKEN="xxx" node real_libby_slackbot.js

real_libby_multi_slackbot.js is a special version for when there are several bots and you want them to communicate.

Add systemd scripts

sudo cp systemd/*.service /lib/systemd/system/
sudo systemctl enable /lib/systemd/system/real_libby_server.service
sudo systemctl start real_libby_server.service
systemctl enable /lib/systemd/system/real_libby_slack.service
sudo systemctl start real_libby_slack.service

Running more than one


BOT_NAME="real_tim" SLACK_API_TOKEN="xxxx" /usr/bin/node slackbots/real_libby_multi_slackbot.js

with a config file (see example)

You can’t perform that action at this time.