This repo is an implementartion of LLAMA/ALPACA. It's a chatbot made with Python that simulates natural conversation with users. The chatbot is designed to be used in the Discord platform, providing an interactive experience for the users.
The following instructions will help you install LLAMA on your machine through the docker
- Docker
- Docker Compose
- Discord Token
- Make sure you’re logged on to the Discord website.
- Navigate to the Applications.
- Click on the “New Application” button.
- Give the application a name and click “Create”.
- Navigate to the “Bot” tab to configure it.
- Make sure that Public Bot is ticked if you want others to invite your bot.
- Copy the token using the “Copy” button. do not share this token.
- Go to the “OAuth2 > URL Generator” tab.
- Tick the “bot” checkbox under “scopes”.
- Tick the permissions required for your bot to function under “Bot Permissions”.
- Now the resulting URL can be used to add your bot to a server. Copy and paste the URL into your browser, choose a server to invite the bot to, and click “Authorize”
- Clone the repository
git clone https://github.com/HectorPulido/discord-bot-LLama.git
- Create a
.env
file in the root directory of the project with the following content:
TOKEN_DISCORD='<FILL THIS WITH YOUR DISCORD TOKEN>'
CHAT_CHANNELS='<YOUR SERVER>:*' # <- This can be a channel or all the server
EMOJI_ONLY_CHANNELS='406975052286787585:944410045871947797' # This is a feature to only allow emojis in some channels
MEMORY_SIZE=4 # This is the memory size of the chatbot
TRANSLATOR=FALSE # This is a feature to translate the messages to english (if your server is in spanish)
MODEL_NAME='gemma:7b' # This is the model name of the chatbot
OLLAMA_URL='ollama' # This is the url of the chatbot, set it to 'ollama' if you are using the docker-compose file
- Build the docker image
docker-compose build
- Run the docker container
docker-compose up
-
Invite the bot to your server using the URL generated in the previous steps
-
Enjoy the bot! 🎉
You can check the previous version of this bot and follow the instructions in the following link: https://github.com/HectorPulido/discord-bot-LLama/tree/6c79b3bf2d3956617f6789934320352ae776adc2
- Follow the instructions for the use of the container-toolkit: https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
- It's worth to check the docker-compose.gpu.yml file and adapt it to your needs
- Run the docker container with the following command
docker compose -f docker-compose.gpu.yml up --build --remove-orphans
- Suffer for CUDA out of memory errors 😅
This project is licensed under the MIT License. See the LICENSE file for details.