{"id":43117024,"url":"https://github.com/modal-labs/doppel-bot","last_synced_at":"2026-01-31T19:05:34.037Z","repository":{"id":164152953,"uuid":"635924960","full_name":"modal-labs/doppel-bot","owner":"modal-labs","description":"Train a language model to answer Slack messages as you.","archived":false,"fork":false,"pushed_at":"2025-03-24T01:35:12.000Z","size":135,"stargazers_count":240,"open_issues_count":2,"forks_count":32,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T02:20:01.280Z","etag":null,"topics":["ai","artificial-intelligence","language-model","python","pytorch","slack-bot"],"latest_commit_sha":null,"homepage":"https://modal.com/docs/guide/slack-finetune","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modal-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-03T18:50:36.000Z","updated_at":"2025-03-24T01:35:16.000Z","dependencies_parsed_at":"2024-12-15T20:21:28.583Z","dependency_job_id":"24498de4-0a0a-41f9-85a5-e1c25efb5f0e","html_url":"https://github.com/modal-labs/doppel-bot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/modal-labs/doppel-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modal-labs%2Fdoppel-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modal-labs%2Fdoppel-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modal-labs%2Fdoppel-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modal-labs%2Fdoppel-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modal-labs","download_url":"https://codeload.github.com/modal-labs/doppel-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modal-labs%2Fdoppel-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28950365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","artificial-intelligence","language-model","python","pytorch","slack-bot"],"created_at":"2026-01-31T19:05:33.451Z","updated_at":"2026-01-31T19:05:34.021Z","avatar_url":"https://github.com/modal-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DoppelBot: Replace your CEO with an LLM\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://modal-labs-doppel-env--doppel.modal.run/slack/install\"\u003e\u003cimg 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\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nDoppelBot is a Slack app that scrapes a target user's messages in Slack and fine-tunes a large language model (Llama 3.1) to learn how to respond like them.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"489\" alt=\"doppel-bot in action\" src=\"https://github.com/modal-labs/doppel-bot/assets/5786378/4075e372-3a84-4dd3-9ed2-8beaeb18e0d2\"\u003e\n\u003c/p\u003e\n\nAll the components, including fine-tuning, inference and scraping are serverless and run on [Modal](https://modal.com).\n\n## How it works\n\n[Read the docs](https://modal.com/docs/examples/slack-finetune).\n\n## Usage\n\n- [Install the app](https://modal-labs-doppel-env--doppel.modal.run/slack/install)\n- In any channel, run `/doppel \u003cuser\u003e`. Here, `\u003cuser\u003e` is either the slack handle or real name of the user you want to target. _Note: for now, we limit each workspace to one target user, and this cannot be changed after installation._\n- Wait for the bot to finish training (few minutes to an hour, depending on how prolific your user is on Slack). You can run the command above again to check the status. _Note: Modal does not store any of your slack messages used for training; we only store training states_\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"489\" alt=\"/doppel command\" src=\"https://github.com/modal-labs/doppel-bot/assets/5786378/9bca0534-5898-4a02-968b-93095ac52b66\"\u003e\n\u003c/p\u003e\n\n- Optional: rename the bot to `\u003cuser\u003e-bot` (or whatever you want).\n  - Go to the [Manage Apps](https://app.slack.com/apps-manage/) page and find `DoppelBot`.\n  - Click on `App Details`.\n  - Click on `Configuration`.\n  - Scroll down to the section named `Bot User`. Click on `Edit` to change the name.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"489\" alt=\"/doppel command\" src=\"https://github.com/modal-labs/doppel-bot/assets/5786378/c11c5e24-94ed-4fa0-a445-fa7c6010dc10\"\u003e\n\u003c/p\u003e\n\n- In any public Slack channel, including `@doppel` (or the name above if you changed it) in a message will summon the bot.\n\n## Development\n\nThis repo contains everything you need to run DoppelBot for yourself.\n\n### Set up Modal\n\n- Create a [Modal](http://modal.com/) account.\n- Install the `modal` client in your current Python environment (`pip install modal`).\n- Set up a Modal token in your environment (`modal setup`).\n\n### Create a Slack app\n\n- Go to [https://api.slack.com/apps](https://api.slack.com/apps) and click\n  **Create New App**.\n- Select **From scratch** if asked _how_ you want to create your app.\n- Name your app and select your workspace.\n- Go to **Features** \u003e **OAuth \u0026 Permissions** on the left navigation pane.\n  Under the **Scopes** \u003e **Bot Token Scopes** section, add the following scopes:\n  - `app_mentions:read`\n  - `channels:history`\n  - `channels:join`\n  - `channels:read`\n  - `chat:write`\n  - `chat:write.customize`\n  - `commands`\n  - `users.profile:read`\n  - `users:read`\n- On the same page, under the **OAuth tokens for Your Workspace** section,\n  click **Install to Workspace** (or reinstall if it's already installed).\n- Create a Modal secret\n  - On the [create secret page](https://modal.com/secrets/create), select **Slack** as the type.\n  - Back on the Slack app settings page, go to **Settings** \u003e **Basic Information** on the left navigation pane.\n    Under **App Credentials**, copy the **Signing Secret** and paste its value with the key `SLACK_SIGNING_SECRET`.\n  - Go to **OAuth \u0026 Permissions** again and copy the **Bot User OAuth Token** and\n    paste its value with the key `SLACK_BOT_TOKEN`.\n  - Name this secret `slack-finetune-secret`.\n\n### (Optional) Set up Weights \u0026 Biases\n\nTo track your fine-tuning runs on [Weights \u0026 Biases](https://wandb.ai), you'll need to create a Weights \u0026 Biases account, and then [create a Modal secret](https://modal.com/secrets/create) with the credentials (select **Weights \u0026 Biases** from the secrets templates and follow the instructions). Then, set `WANDB_PROJECT` in `src/common.py` to the name of the project you want to use.\n\n### Deploy your app\n\nFrom 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/`).\n\nNow, we need to point our Slack app to this URL:\n\n- Go to **Features** \u003e **Event Subscriptions** on the left navigation pane:\n  - Turn it on.\n  - Paste the URL from above into the **Request URL** field, and wait for it to be verified.\n  - Under **Subscribe to bot events**, click on **Add bot user event** and add `@app_mention`.\n  - Click **Save Changes**.\n- Go to **Features** \u003e **Slash Commands** on the left navigation pane. Click **Create New Command**. Set the command to `/doppel` and the request URL to the same URL as above.\n- Return to the **Basic Information** page, and click **Install to Workspace**.\n\n### (Optional) Multi-workspace app\n\nIf 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`](https://github.com/modal-labs/doppel-bot/blob/aae3f8675e9052251690997557aa8d4a9ae447e6/src/common.py#L8) to `True` in `src/common.py`.\n\nThen, you'll need to set up [Neon](https://neon.tech/), a serverless Postgres database, for storing user data:\n\n- Create an account and a database on [Neon](https://neon.tech/).\n- Create a Modal secret with DB credentials.\n  - On the [create secret page](https://modal.com/secrets/create), select **Postgres** as the type.\n  - Fill out the values based on the host URL, database name, username and password from Neon. [This page](https://neon.tech/docs/connect/connect-from-any-app) has an example for what it should look like.\n  - Name this secret `neon-secret`.\n- Create tables by running `modal run src.db` from the root directory of this repo.\n- Add two new environment variables to your Modal Slack secret: `SLACK_CLIENT_ID` and `SLACK_CLIENT_SECRET` (the values should be in the Slack app **Settings** \u003e **Basic Information** )\n- On the Slack app settings page, go to **Settings** \u003e **Manage Distribution**. The **Redirect URLs** should be be `https://\u003cyour-modal-run-url\u003e/slack/oauth_redirect`, where `\u003cyour-modal-run-url\u003e` is the URL you received after deploying the app above. Once everything looks good, click **Activate Public Distribution**.\n\nNow, deploying the app with `modal deploy src.bot` will take care of setting up all the [intricacies of OAuth](https://api.slack.com/authentication/oauth-v2) for you, and create a multi-workspace Slack app that can be installed by anyone. By default, the install link is at `https://\u003cyour-modal-run-url\u003e/slack/install`.\n\n### (Optional) Running each step manually\n\nIf you wish, you can also run each step manually. This is useful for debugging or iterating on a specific function.\n\n- Scraper: `modal run src.scrape::scrape --user=\"\u003cuser\u003e\"`\n- Fine-tuning: `modal run --detach src.finetune --user=\"\u003cuser\"` (note that the `--detach` lets you ctrl+c any time without killing the training run)\n- Inference: `modal run src.inference --user=\"\u003cuser\u003e\"`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodal-labs%2Fdoppel-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodal-labs%2Fdoppel-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodal-labs%2Fdoppel-bot/lists"}