Telegram summary bot that runs on Vercel. It listens for /summary (or /activity
for latest activity highlights) in a group chat and uses the Hugging Face inference
API to summarize recent messages. It also supports /quote to generate and send
a random Greek, Chinese, or Stoic quote via the Hugging Face model directly in chat.
- Create a Telegram bot with @BotFather and grab the bot token.
- Create a Hugging Face account and generate an access token with access to the Hugging Face router.
- Deploy to Vercel and set the environment variables:
TELEGRAM_BOT_TOKENHF_TOKENTELEGRAM_BOT_USERNAME(optional, without the leading@, to match/summary@YourBot)
After deployment, set the webhook to your Vercel URL:
curl -X POST \
"https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook" \
-d "url=https://<your-vercel-domain>/api/telegram"- The bot stores the last 50 text messages per chat in memory. Vercel serverless functions are stateless, so the cache resets when the function instance is recycled.
- The summary uses the
mistralai/Mistral-7B-Instruct-v0.2:featherless-aimodel through the Hugging Face router. You can change it inapi/telegram.js.