Home

Awesome

DoppelBot: Replace your CEO with an LLM

<p align="center"> <a href="https://modal-labs-doppel-env--doppel.modal.run/slack/install"><img alt="Add to Slack" height="40" width="139" src="https://platform.slack-edge.com/img/add_to_slack.png" srcSet="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x" target="_blank" rel="noopener noreferrer" /></a> </p>

DoppelBot is a Slack app that scrapes a target user's messages in Slack and fine-tunes a large language model (OpenLLaMa) to learn how to respond like them.

<p align="center"> <img width="489" alt="doppel-bot in action" src="https://github.com/modal-labs/doppel-bot/assets/5786378/4075e372-3a84-4dd3-9ed2-8beaeb18e0d2"> </p>

All the components, including fine-tuning, inference and scraping are serverless and run on Modal.

How it works

Read the docs.

Usage

<p align="center"> <img width="489" alt="/doppel command" src="https://github.com/modal-labs/doppel-bot/assets/5786378/9bca0534-5898-4a02-968b-93095ac52b66"> </p> <p align="center"> <img width="489" alt="/doppel command" src="https://github.com/modal-labs/doppel-bot/assets/5786378/c11c5e24-94ed-4fa0-a445-fa7c6010dc10"> </p>

Development

This repo contains everything you need to run DoppelBot for yourself.

Set up Modal

Create a Slack app

(Optional) Set up Weights & Biases

To track your fine-tuning runs on Weights & Biases, you'll need to create a Weights & Biases account, and then create a Modal secret with the credentials (click on Weights & Biases in the secrets wizard and follow the steps). Then, set WANDB_PROJECT in src/common.py to the name of the project you want to use.

Deploy your app

From the root directory of this repo, run modal deploy src.bot. This will deploy the app to Modal, and print a URL to the terminal (something like https://aksh-at--doppel.modal.run/).

Now, we need to point our Slack app to this URL:

(Optional) Multi-workspace app

If you just want to run the app in your own workspace, the above is all you need. If you want to distribute the app to others, you'll need to set up a multi-workspace app. To enable this, set MULTI_WORKSPACE_SLACK_APP to True in src/common.py.

Then, you'll need to set up Neon, a serverless Postgres database, for storing user data:

Now, deploying the app with modal deploy src.bot will take care of setting up all the intricacies of OAuth for you, and create a multi-workspace Slack app that can be installed by anyone. By default, the install link is at https://<your-modal-run-url>/slack/install.

(Optional) Running each step manually

If you wish, you can also run each step manually. This is useful for debugging or iterating on a specific function.