2023-12-15 05:55:33 +00:00
# ollamarama-matrix
2024-07-31 01:07:47 +00:00
Ollamarama is an AI chatbot for the [Matrix ](https://matrix.org/ ) chat protocol using Ollama. It can 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.
2023-12-15 06:32:52 +00:00
2024-03-15 03:01:14 +00:00
This is based on my earlier project, [infinigpt-matrix ](https://github.com/h1ddenpr0cess20/infinigpt-matrix ), which uses OpenAI and costs money to use. (Now updated with OpenAI/Ollama model switching)
2023-12-15 05:58:10 +00:00
2023-12-23 05:10:03 +00:00
IRC version available at [ollamarama-irc ](https://github.com/h1ddenpr0cess20/ollamarama-irc )
Terminal-based version at [ollamarama ](https://github.com/h1ddenpr0cess20/ollamarama )
2023-12-15 05:58:10 +00:00
2023-12-15 06:15:11 +00:00
## Setup
2024-04-27 02:39:19 +00:00
Install and familiarize yourself with [Ollama ](https://ollama.ai/ ), make sure you can run local LLMs, etc.
2023-12-15 06:15:11 +00:00
2024-03-15 03:01:14 +00:00
You can install and update it with this command:
2023-12-15 06:15:11 +00:00
```
curl https://ollama.ai/install.sh | sh
```
2023-12-21 02:48:51 +00:00
2024-07-31 01:07:47 +00:00
Once it's all set up, you'll need to [download the models ](https://ollama.ai/library ) 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.
2023-12-21 02:48:51 +00:00
2023-12-15 06:15:11 +00:00
2024-07-31 01:07:47 +00:00
You'll also need to install matrix-nio
2023-12-15 06:15:11 +00:00
```
2024-07-31 01:07:47 +00:00
pip3 install matrix-nio
2023-12-15 06:15:11 +00:00
```
Set up a [Matrix account ](https://app.element.io/ ) for your bot. You'll need the server, username and password.
2024-04-27 02:39:19 +00:00
Plug those into the appropriate variables in the config.json file.
2023-12-15 06:15:11 +00:00
```
2024-04-27 02:39:19 +00:00
python3 ollamarama.py
2023-12-15 06:15:11 +00:00
```
## Use
**.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.
2024-03-15 03:01:14 +00:00
Don't use a custom system prompt here.
2023-12-15 06:15:11 +00:00
**.custom _prompt_ **
2023-12-16 01:59:07 +00:00
Allows use of a custom system prompt instead of the roleplaying prompt
2023-12-15 06:15:11 +00:00
**.reset**
Reset to preset personality
**.stock**
Remove personality and reset to standard settings
**.help**
Show the built-in help menu
2023-12-15 05:58:10 +00:00
2023-12-21 02:48:51 +00:00
**.models**
Show current model and available models (admin only)
**.model _name_ **
Set a model (admin only)
**.model _reset_ **
Reset to default model (admin only)
2023-12-23 04:40:53 +00:00
**.temperature**
Set temperature value between 0 and 1. To reset to default, type reset instead of a number. (bot owner only)
**.top_p**
Set top_p value between 0 and 1. To reset to default, type reset instead of a number. (bot owner only)
**.repeat_penalty**
Set repeat_penalty between 0 and 2. To reset to default, type reset instead of a number. (bot owner only)
2023-12-21 02:48:51 +00:00
**.clear**
2023-12-23 04:40:53 +00:00
Resets all bot history and sets default model (bot owner only)
2023-12-21 02:48:51 +00:00
**.auth _user_ **
2023-12-22 21:31:37 +00:00
Add user to admins (bot owner only)
2023-12-21 02:48:51 +00:00
**.deauth _user_ **
2023-12-22 21:31:37 +00:00
Remove user from admins (bot owner only)
2023-12-22 21:23:14 +00:00
2023-12-23 04:41:47 +00:00
**.gpersona _persona_ **
2023-12-22 21:31:37 +00:00
Change global personality (bot owner only)
2023-12-22 21:23:14 +00:00
**.gpersona reset**
2024-05-30 16:12:25 +00:00
Reset global personality (bot owner only)