Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mxyng/discollama
Run an AI-powered Discord bot from the comfort of your laptop.
https://github.com/mxyng/discollama
bot discord discord-bot discord-py llm ollama python python3
Last synced: 7 days ago
JSON representation
Run an AI-powered Discord bot from the comfort of your laptop.
- Host: GitHub
- URL: https://github.com/mxyng/discollama
- Owner: mxyng
- License: mit
- Created: 2023-07-30T19:43:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T21:35:15.000Z (about 2 months ago)
- Last Synced: 2024-12-28T22:12:34.386Z (14 days ago)
- Topics: bot, discord, discord-bot, discord-py, llm, ollama, python, python3
- Language: Python
- Homepage:
- Size: 110 KB
- Stars: 143
- Watchers: 3
- Forks: 25
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - mxyng/discollama - Run an AI-powered Discord bot from the comfort of your laptop. (Python)
README
# discollama
`discollama` is a Discord bot powered by a local large language model backed by [Ollama](https://github.com/ollama/ollama).
## Dependencies
- Docker and Docker Compose
## Run `discollama.py`
```
DISCORD_TOKEN=xxxxx docker compose up
```> [!NOTE]
> You must setup a [Discord Bot](https://discord.com/developers/applications) and set environment variable `DISCORD_TOKEN` before `discollama.py` can access Discord.`discollama.py` requires an [Ollama](https://github.com/ollama/ollama) server. Follow the steps in [ollama/ollama](https://github.com/ollama/ollama) repository to setup Ollama.
By default, it uses `127.0.0.1:11434` which can be overwritten with `OLLAMA_HOST`.
> Note: Deploying this on Linux requires updating network configurations and `OLLAMA_HOST`.
## Customize `discollama.py`
The default LLM is `mike/discollama`. A custom personality can be added by changing the `SYSTEM` instruction in the Modelfile and running `ollama create`:
```
ollama create mymodel -f Modelfile
```This can be changed in `compose.yaml`:
```
environment:
- OLLAMA_MODEL=mymodel
```See [ollama/ollama](https://github.com/ollama/ollama/blob/main/docs/modelfile.md) for more details.
## Activating the Bot
Discord users can interact with the bot by mentioning it in a message to start a new conversation or in a reply to a previous response to continue an ongoing conversation.