mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
docs: add discord-bot example
This commit is contained in:
parent
16773e2a35
commit
a247e8af67
4 changed files with 58 additions and 0 deletions
6
examples/discord-bot/.env.example
Normal file
6
examples/discord-bot/.env.example
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
OPENAI_API_KEY=x
|
||||||
|
DISCORD_BOT_TOKEN=x
|
||||||
|
DISCORD_CLIENT_ID=x
|
||||||
|
OPENAI_API_BASE=http://api:8080
|
||||||
|
ALLOWED_SERVER_IDS=x
|
||||||
|
SERVER_TO_MODERATION_CHANNEL=1:1
|
28
examples/discord-bot/README.md
Normal file
28
examples/discord-bot/README.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# discord-bot
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Clone LocalAI
|
||||||
|
git clone https://github.com/go-skynet/LocalAI
|
||||||
|
|
||||||
|
cd LocalAI/examples/discord-bot
|
||||||
|
|
||||||
|
git clone https://github.com/go-skynet/gpt-discord-bot.git
|
||||||
|
|
||||||
|
# (optional) Checkout a specific LocalAI tag
|
||||||
|
# git checkout -b build <TAG>
|
||||||
|
|
||||||
|
# Download gpt4all-j to models/
|
||||||
|
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
|
||||||
|
|
||||||
|
# Set the discord bot options
|
||||||
|
cp -rfv .env.example .env
|
||||||
|
vim .env
|
||||||
|
|
||||||
|
# start with docker-compose
|
||||||
|
docker-compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
|
Open up the URL in the console and give permission to the bot in your server. Start a thread with `/chat ..`
|
||||||
|
|
23
examples/discord-bot/docker-compose.yaml
Normal file
23
examples/discord-bot/docker-compose.yaml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
version: '3.6'
|
||||||
|
|
||||||
|
services:
|
||||||
|
api:
|
||||||
|
image: quay.io/go-skynet/local-ai:latest
|
||||||
|
build:
|
||||||
|
context: ../../
|
||||||
|
dockerfile: Dockerfile.dev
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
environment:
|
||||||
|
- DEBUG=true
|
||||||
|
- MODELS_PATH=/models
|
||||||
|
volumes:
|
||||||
|
- ./models:/models:cached
|
||||||
|
command: ["/usr/bin/local-ai" ]
|
||||||
|
|
||||||
|
bot:
|
||||||
|
build:
|
||||||
|
context: ./gpt-discord-bot
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
env_file:
|
||||||
|
- .env
|
1
examples/discord-bot/models
Symbolic link
1
examples/discord-bot/models
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../chatbot-ui/models/
|
Loading…
Add table
Add a link
Reference in a new issue