Skip to content

Run an AI-powered Discord bot from the comfort of your laptop.

License

Notifications You must be signed in to change notification settings

BadgerSnacks/discollama-portainer

This branch is 4 commits ahead of mxyng/discollama:main.

Repository files navigation

Discollama

discollama is a Discord bot powered by a local large language model backed by Ollama.

Dependencies

  • Docker, Docker Compose, Portainer

Installation

On host machine create a file directly where you want to clone the directory to that is easy to located, I use a folder called portainer to hold all my containers so it would look like

EXAMPLE
/home/USER/portainer/discollama

Clone the repository into your desired folder (note that clone will create a folder)

git clone https://github.com/BadgerSnacks/discollama-portainer.git

Copy the contents of the compose.ymal into your portainer web editor, You will need to edit your compose.ymal file to match the file structure

EXAMPLE
volumes:
      - YOUR FILE DIRECTORY

dockerfile: FILE DIRECTORY THAT DOCKERFILE IS LOCATED

change to

volumes:
      - /home/USER/portainer/discollama:/discollama

dockerfile: /home/USER/portainer/discollama/Dockerfile

Make sure you update all 3 areas for file locations in the compose.ymal file.

Note

You must setup a Discord Bot and set environment variable DISCORD_TOKEN before discollama.py can access Discord.

In poratiner you will need to add your discord token into an environment variable. While under the editor tab of your stack scroll down and find Environment Variables dropdown menu, click Advanced mode and enter your discord token.

EXAMPLE
DISCORD_TOKEN=################

After you succsessfully deply the stack you will need intall your models as they are not pulled yet, defualt is set to llama3.2. there are two ways to do this.

From the container terminal

ollama pull llama3.2

From bash(terminal) outside of the container

docker exec -it ollama ollama pull llama3.2

Customize discollama.py

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

You should be able to update this environment to change any to any other ollama models you have pulled. I have only tested with 1 model as of now.

See ollama/ollama 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.

About

Run an AI-powered Discord bot from the comfort of your laptop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.4%
  • Dockerfile 4.6%