mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 22:20:43 +00:00
docs: update discord-bot example
This commit is contained in:
parent
38c256d1d2
commit
1e2a665116
2 changed files with 50 additions and 6 deletions
|
@ -8,15 +8,13 @@ git clone https://github.com/go-skynet/LocalAI
|
||||||
|
|
||||||
cd LocalAI/examples/discord-bot
|
cd LocalAI/examples/discord-bot
|
||||||
|
|
||||||
git clone https://github.com/go-skynet/gpt-discord-bot.git
|
|
||||||
|
|
||||||
# (optional) Checkout a specific LocalAI tag
|
# (optional) Checkout a specific LocalAI tag
|
||||||
# git checkout -b build <TAG>
|
# git checkout -b build <TAG>
|
||||||
|
|
||||||
# Download gpt4all-j to models/
|
# Download gpt4all-j to models/
|
||||||
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
|
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
|
||||||
|
|
||||||
# Set the discord bot options
|
# Set the discord bot options (see: https://github.com/go-skynet/gpt-discord-bot#setup)
|
||||||
cp -rfv .env.example .env
|
cp -rfv .env.example .env
|
||||||
vim .env
|
vim .env
|
||||||
|
|
||||||
|
@ -24,5 +22,53 @@ vim .env
|
||||||
docker-compose up -d --build
|
docker-compose up -d --build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: see setup options here: https://github.com/go-skynet/gpt-discord-bot#setup
|
||||||
|
|
||||||
Open up the URL in the console and give permission to the bot in your server. Start a thread with `/chat ..`
|
Open up the URL in the console and give permission to the bot in your server. Start a thread with `/chat ..`
|
||||||
|
|
||||||
|
## Kubernetes
|
||||||
|
|
||||||
|
- install the local-ai chart first
|
||||||
|
- change OPENAI_API_BASE to point to the API address and apply the discord-bot manifest:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: discord-bot
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: localai
|
||||||
|
namespace: discord-bot
|
||||||
|
labels:
|
||||||
|
app: localai
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: localai
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: localai
|
||||||
|
name: localai
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: localai-discord
|
||||||
|
env:
|
||||||
|
- name: OPENAI_API_KEY
|
||||||
|
value: "x"
|
||||||
|
- name: DISCORD_BOT_TOKEN
|
||||||
|
value: ""
|
||||||
|
- name: DISCORD_CLIENT_ID
|
||||||
|
value: ""
|
||||||
|
- name: OPENAI_API_BASE
|
||||||
|
value: "http://local-ai.default.svc.cluster.local:8080"
|
||||||
|
- name: ALLOWED_SERVER_IDS
|
||||||
|
value: "xx"
|
||||||
|
- name: SERVER_TO_MODERATION_CHANNEL
|
||||||
|
value: "1:1"
|
||||||
|
image: quay.io/go-skynet/gpt-discord-bot:main
|
||||||
|
```
|
|
@ -16,8 +16,6 @@ services:
|
||||||
command: ["/usr/bin/local-ai" ]
|
command: ["/usr/bin/local-ai" ]
|
||||||
|
|
||||||
bot:
|
bot:
|
||||||
build:
|
image: quay.io/go-skynet/gpt-discord-bot:main
|
||||||
context: ./gpt-discord-bot
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue