This is a simple matrix bot that transcribes your voice to text message using faster-whisper, a reimplementation of OpenAI's Whisper model using CTranslate2.
- Liberate your hands: support automatically speech to text transcribtion
- Support E2EE Room
- Self host your service without privacy problem
- Edit
config.json
or.env
with proper values - Edit
compose.yaml
- Launch the container
Here is a guide to make bot works on E2E encrypted room.
For explainations and complete parameter list see: https://github.com/hibobmaster/matrix-stt-bot/wiki
- Create
config.json
Tips: set a non-exist room_id
at the first time to prevent bot handling historical message which may mess your room up.
{
"homeserver": "https://matrix.org",
"user_id": "@xxxx:matrix.org",
"password": "xxxxxxxxxx",
"device_id": "GMIAZSVFF",
"room_id": "!xxxxxxxx:xxx.xxx.xxx",
"model_size": "base",
"import_keys_path": "element-keys.txt",
"import_keys_password": "xxxxxxxxxxxx"
}
- Create
compose.yaml
services:
app:
image: ghcr.io/hibobmaster/matrix-stt-bot:latest
container_name: matrix-stt-bot
restart: always
# build:
# context: .
# dockerfile: ./Dockerfile
# env_file:
# - .env
volumes:
# use env file or config.json
- ./config.json:/app/config.json
# use touch to create an empty file stt_db, for persist database only
- ./stt_db:/app/db
# import_keys path
- ./element-keys.txt:/app/element-keys.txt
# store whisper models that program will download
- ./models:/app/models
networks:
- matrix_network
networks:
matrix_network:
Get your E2E room keys here: Notice: If you deploy matrix_chatgpt_bot along with this project, remember do not use the same database name.
- Launch for the first time
docker compose up
You will get notice: INFO - start import_keys process
After INFO - import_keys success, please remove import_keys configuration!!!
Wait a second, to see if stt_db
has finished syncing_progress (The space occupied is about 100kb and above?)
Then Ctrl+C
stop the container
- Edit
config.json
again
Remove import_keys_path
and import_keys_password
options
Set a correct room_id
or remove it if you hope the bot to work in the rooms it is in.
Tips: if bot exits because RuntimeError: Unable to open file 'model.bin' in model
, try rm -r models
then relaunch the container.
- Finally
Launch the container
docker compose up -d
- https://github.com/guillaumekln/faster-whisper
- https://github.com/poljar/matrix-nio
- https://github.com/8go/matrix-commander