InfiniGPT is an OpenAI chatbot for the Matrix chat protocol. It has a great prompt which allows it to roleplay as almost anything you can think of. You can set any default personality you would like. It can be changed at any time, and each user has their own separate chat history with their chosen personality setting. Users can interact with each others chat histories for collaboration if they would like, but otherwise, conversations are separated, per channel, per user.
Also available for IRC at infinigpt-irc
Now with Ollama support and model switching.
pip3 install matrix-nio openai
Get an OpenAI API key, set it as an environment variable as OPENAI_API_KEY. There is a place to set the environment variable in the code if you want to use that instead.
Add desired Ollama models to the models list in config.json, if using. You'll first need to install and familiarize yourself with Ollama, make sure you can run local LLMs, etc. If you can't, don't worry about it, you can just omit these models from the config.
You can install and update it with this command:
curl https://ollama.ai/install.sh | sh
Once it's all set up, you'll need to download the models you want to use. You can play with the available ones and see what works best for you. Add those to the config.json file. If you want to use the ones I've included, just run ollama pull modelname for each.
Set up a Matrix account for your bot. You'll need the server, username and password.
Add those to the config.json file.
python3 infinigpt.py
.ai message or botname: message Basic usage. Personality is preset by bot operator.
.x user message This allows you to talk to another user's chat history. user is the display name of the user whose history you want to use
.persona personality Changes the personality. It can be a character, personality type, object, idea. Don't use a custom prompt here.
.custom prompt Allows use of a custom system prompt instead of the built-in one
.reset Reset to preset personality
.stock Remove personality and reset to standard GPT settings
.model List available large language models
.model modelname Change model
.model reset Reset model
.help Show the built-in help menu