ChatGPT bot for Matrix
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Cyberes d7d68f4d42 fix keyerror 2 weeks ago
matrix_gpt fix keyerror 2 weeks ago
.gitignore add system prompt 7 months ago
LICENSE Initial commit 7 months ago mark unknown events as read, no longer require model config key 5 months ago
config.sample.yaml add local model support 2 weeks ago fix keyerror 2 weeks ago
matrixgpt.service service 7 months ago
requirements.txt handle timeouts 6 months ago


ChatGPT bot for Matrix.

Uses code from anoadragon453/nio-template.


sudo apt install libolm-dev gcc python3-dev
pip install -r requirements.txt

Copy config.sample.yaml to config.yaml and fill it out with your bot's auth and your OpenAI API key.

Then invite your bot and start a chat by prefixing your message with !c. The bot will create a thread (you don't need to use !c in the thread).

I included a sample Systemd service.


Invite the bot to your room and query it with the command !c (this can be changed in the config.)

Don't try to use two bots in the same thread.

The bot will move its read marker when a new message is sent in the room.

The bot can give helpful reactions:

  • 🚫 means that the user is not allowed to chat with the bot.
  • means the bot encountered an exception. The bot restarts when it encounters an exception which means it will not be able to respond for a short time after this reaction.
  • 🔐 means there was a decryption failure.


This bot supports encryption. I recommend using Pantalaimon to manage encryption keys as the built-in solution is a little janky and may be unreliable.