diff --git a/10-systems/bots/gntranscribe.md b/10-systems/bots/gntranscribe.md new file mode 100644 index 0000000..664145c --- /dev/null +++ b/10-systems/bots/gntranscribe.md @@ -0,0 +1,67 @@ +--- +title: GNtranscribe +description: Telegram bot — audio transcription via whisper-server +host: tgbots-vm +status: active +last_reviewed: 2026-09-20 +owner: gmikcon +confidence: 100 +review_interval: 90 +source_of_truth: live_system +--- + +# GNtranscribe + +## Overview + +Telegram bot `@gntranscribe_bot` on VM tg_bots (192.168.1.254). Users forward +or send voice messages, audio files, video circles or videos; the bot queues +them and returns the transcript from whisper-server on bserv-host +(192.168.1.130:8008, model ggml-large-v3-turbo-q5_0, auto language detect). + +Deployed 2026-09-20 by navi instance rei on owner request. + +## Design + +- Multi-user: incoming media jobs go into an asyncio queue (max 20). +- Single worker processes jobs one at a time — whisper-server shares a 4 GB + GPU with Ollama on bserv-host, parallel inference is not safe there. +- Optional chat_id whitelist via `ALLOWED_CHAT_IDS` in `.env` + (comma-separated; empty = open to everyone). Non-whitelisted users get + their chat_id back with a deny message. +- Commands: `/start`, `/help`, `/id` (shows chat_id/user_id for whitelist + setup), `/status` (queue size, worker state, counters, uptime). +- Media accepted: voice, audio, video_note (circle), video, audio/video + documents. Max file size 24 MB (configurable `MAX_FILE_MB`). +- Transcripts over 4096 chars are split into chunks. + +## Technical Details + +- **Host:** VM tg_bots (192.168.1.254), user `ubuntu` +- **Path:** `/home/ubuntu/bots/GNtranscribe` — `bot.py`, `.env`, + `requirements.txt`, `gntranscribe.service`, `venv/` +- **Stack:** Python 3.10, python-telegram-bot 21.10, aiohttp +- **systemd:** `gntranscribe.service` (User=ubuntu, Restart=always, + RestartSec=30), enabled (multi-user.target.wants) +- **Config (`.env`):** `BOT_TOKEN` (stored in gnexus-creds secret + "GNtranscribe token", not in docs), `WHISPER_URL=http://192.168.1.130:8008/inference`, + `MAX_FILE_MB=24`, `MAX_QUEUE=20`, `WHISPER_TIMEOUT=600`, + `ALLOWED_CHAT_IDS=` (empty) +- **Logs:** `/home/ubuntu/bots/GNtranscribe/logs/bot.log` (rotating, 2 MB x 3) + and `journalctl -u gntranscribe.service` +- **Upstream:** whisper-server on bserv-host — see inventory item + `bserv-host` (POST /inference, multipart `file=@`) + +## Verification 2026-09-20 + +- `getMe` → ok, `@gntranscribe_bot`. +- Direct whisper test: TTS-generated Russian audio POSTed to + http://192.168.1.130:8008/inference returned the exact expected text. +- Service active after `enable --now`; two consecutive restarts passed. + +## Operations + +- Restart: `sudo systemctl restart gntranscribe.service` +- Enable whitelist: edit `ALLOWED_CHAT_IDS` in `.env`, then restart. +- Token rotation: update `BOT_TOKEN` in `.env` and the gnexus-creds secret, + restart. diff --git a/10-systems/servers/tgbots-vm-navi-melody.md b/10-systems/servers/tgbots-vm-navi-melody.md index 08ad85f..43b2936 100644 --- a/10-systems/servers/tgbots-vm-navi-melody.md +++ b/10-systems/servers/tgbots-vm-navi-melody.md @@ -2,11 +2,11 @@ title: VM tg_bots — navi melody type: host ip: 192.168.1.254 -purpose: Telegram bot (mardisbot) and navi melody instance +purpose: Telegram bots (mardisbot, GNtranscribe) and navi melody instance owner: gmikcon status: active confidence: high -last_reviewed: 2026-09-16 +last_reviewed: 2026-09-20 review_interval: 90d source_of_truth: ssh-host-verified --- @@ -16,13 +16,21 @@ ## Overview KVM/libvirt VM `tg_bots` on the home LAN (distinct from the older `vmk`/tgbots host at 192.168.1.178 documented in `10-systems/hosts/tgbots.md`). Hostname: -`tgbots`. User: `ubuntu`. Runs two systemd services and one docker container. +`tgbots`. User: `ubuntu`. Runs three systemd services and one docker container. ## Services ### mardisbot.service - Telegram bot (systemd). Do not restart or modify without owner approval. +### gntranscribe.service +- Telegram bot `@gntranscribe_bot` (audio → text via whisper-server on + bserv-host 192.168.1.130:8008). Deployed 2026-09-20 by navi rei. +- Path: `/home/ubuntu/bots/GNtranscribe` (bot.py, .env, venv). +- Config in `.env`: `BOT_TOKEN` (secret in gnexus-creds), `WHISPER_URL`, + `MAX_FILE_MB=24`, `MAX_QUEUE=20`, `ALLOWED_CHAT_IDS=` (empty = open). +- Details: `10-systems/bots/gntranscribe.md`. + ### navi.service (navi instance melody) - systemd unit `/etc/systemd/system/navi.service`, User `ubuntu`. - WorkingDirectory `/home/ubuntu/navi-1`, ExecStart