Chatbots for Matrix.
Go to file
Cyberes 564bbe073d c 2024-11-16 13:38:49 -07:00
docs docs 2024-04-10 22:51:22 -06:00
matrix_gpt c 2024-11-16 13:38:49 -07:00
.gitignore add vision 2024-04-09 19:26:44 -06:00
LICENSE Initial commit 2023-03-17 20:11:13 -06:00
README.md simplify copilot response, adjust error responses, other minor changes 2024-04-11 14:32:38 -06:00
config.sample.yaml implement context into copilot, various minor changes 2024-04-10 22:47:15 -06:00
main.py simplify copilot response, adjust error responses, other minor changes 2024-04-11 14:32:38 -06:00
matrixgpt.service fix service 2024-04-08 00:12:37 -06:00
new-fernet-key.py implement context into copilot, various minor changes 2024-04-10 22:47:15 -06:00
requirements.txt implement context into copilot, various minor changes 2024-04-10 22:47:15 -06:00

README.md

MatrixGPT

Chatbots for Matrix.

This bot supports OpenAI, Anthropic, and locally hosted models that use an OpenAI-compatible endpoint. It can run multiple different models using different triggers, such as !c4 for GPT4 and !ca for Anthropic, all through the same bot.

Supported Services

  • OpenAI (+ vision)
  • Anthropic (+ vision)
  • Anthropic
  • Bing Copilot
  • Dalle-3 (TODO)

Install

  1. Install requirements:
    sudo apt install libolm-dev gcc python3-dev
    pip install -r requirements.txt
    
  2. Copy config.sample.yaml to config.yaml and fill it out with the bot's Matrix authentication and your OpenAI and/or Anthropic API keys.
  3. Start the bot with python3 main.py

Pantalaimon is required for the bot to be able to talk in encrypted rooms.

If you are using Copilot, please read the extra documentation: docs/Copilot.md

I included a sample Systemd service (matrixgpt.service).

Use

First, invite your bot to a room. Then you can start a chat by prefixing your message with your trigger (for example, !c hello). The bot will create a thread when it replies. You don't need to use the trigger in the thread.

Use !matrixgpt to view the bot's help. The bot also responds to !bots.


  • Don't try to use two bots in the same thread.
  • You can DM the bot for a private chat.
  • The bot will move its read marker whenever a message is sent in the room.

The bot can give helpful reactions:

  • 🚫 means permission denied (not allowed to chat with the bot).
  • 🕒 means the API timed out.
  • means the bot encountered an exception.
  • 🔐 means there was a decryption failure.

TODO

  • Add our own context mechanism to Copilot
  • Dalle bot
  • Improve error messages sent with reactions to narrow down where the issue occurred.
  • Allow replying to an image post which will give a vision model an image + text on the first message.
  • Fix the typing indicator being removed when two responses are generating.
  • Add vision to Copilot (not doing, API to unstable).