From 1a3592bc1b800bd2018d631ea7e68cc9941f4705 Mon Sep 17 00:00:00 2001 From: Ravenmoray Date: Fri, 19 Jan 2024 20:48:20 -0500 Subject: [PATCH] Updated README.md for better clarity and installation instructions --- README.md | 78 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 34e2950..2ad702e 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,76 @@ + # discollama -`discollama` is a Discord bot powered by a local large language model backed by [Ollama](https://github.com/jmorganca/ollama). +`discollama` is an innovative Discord bot that leverages a local large language model to interact in Discord channels. It's powered by [Ollama](https://github.com/jmorganca/ollama), making it a powerful and customizable tool for Discord server administrators and enthusiasts. ## Dependencies -- Docker and Docker Compose +Before you begin, ensure you have the following installed: +- Docker +- Docker Compose -## Run `discollama.py` +### Installing Docker -``` -DISCORD_TOKEN=xxxxx docker compose up -``` +#### Linux +- Install Docker using your package manager or follow the instructions here: [Install Docker on Linux](https://docs.docker.com/engine/install/). -> Note: You must setup a [Discord Bot](https://discord.com/developers/applications) and set environment variable `DISCORD_TOKEN` before `discollama.py` can access Discord. +#### Mac +- Download and install Docker Desktop for Mac from [Docker Hub](https://hub.docker.com/editions/community/docker-ce-desktop-mac/). -`discollama.py` requires an [Ollama](https://github.com/jmorganca/ollama) server. Follow the steps in [jmorganca/ollama](https://github.com/jmorganca/ollama) repository to setup Ollama. +#### Windows +- Download and install Docker Desktop for Windows from [Docker Hub](https://hub.docker.com/editions/community/docker-ce-desktop-windows/). -By default, it uses `127.0.0.1:11434` which can be overwritten with `OLLAMA_HOST`. +### Installing Docker Compose +- Docker Compose is included in Docker Desktop for Mac and Windows. +- For Linux, follow the instructions here: [Install Docker Compose on Linux](https://docs.docker.com/compose/install/). -> Note: Deploying this on Linux requires updating network configurations and `OLLAMA_HOST`. +## Setting Up a Discord Bot -## Customize `discollama.py` +To use `discollama`, you'll need a Discord bot token. Follow these steps to set one up: -The default LLM is `mike/discollama`. A custom personality can be added by changing the `SYSTEM` instruction in the Modelfile and running `ollama create`: +1. **Create a Discord account**: If you don’t already have a Discord account, create one at [Discord's registration page](https://discord.com/register). +2. **Create a new application**: Visit the [Discord Developer Portal](https://discord.com/developers/applications), click on "New Application", and give it a name. +3. **Create a Bot User**: In your application, navigate to the “Bot” tab and click "Add Bot". +4. **Get your Bot Token**: Under the bot section, find the “Token” and click "Copy". This is your `DISCORD_TOKEN` which you'll use later. Keep this token private! +5. **Invite Bot to Server**: In the “OAuth2” tab, under “Scopes”, select “bot”. Choose the permissions your bot needs and use the generated URL to invite your bot to your Discord server. -``` -ollama create mymodel -f Modelfile -``` +## Installation and Running `discollama` -This can be changed in `compose.yaml`: +1. **Clone the Repository**: First, clone the `discollama` repository from GitHub. + ``` + git clone https://github.com/mxyng/discollama.git + cd discollama + ``` -``` -environment: - - OLLAMA_MODEL=mymodel -``` +2. **Setup Environment Variables**: Create a `.env` file in the root directory and add your Discord token. + ``` + echo DISCORD_TOKEN=your_discord_bot_token > .env + ``` -See [jmorganca/ollama](https://github.com/jmorganca/ollama/blob/main/docs/modelfile.md) for more details. +3. **Running the Bot**: Use Docker Compose to build and run the bot. + ``` + docker compose up + ``` + > This command builds the Docker image and starts the `discollama` bot in a Docker container. + +> **Note**: Ensure your `OLLAMA_HOST` is set correctly in the `compose.yaml` if you are deploying on a network other than localhost. ## 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. +Once `discollama` is running, you can interact with it in your Discord server. Just mention the bot in a message to start a new conversation, or reply to its messages to continue an ongoing conversation. + +## Troubleshooting + +[Common issues and solutions] + +## Contributing + +[Information on how others can contribute to the project] + +## Contact + +[Provide contact information or methods for support and feedback] + +## License + +`discollama` is open-source software licensed under the MIT License. [See the full license here](./LICENSE).