diff --git a/.env.sample b/.env.sample index 896ee09..483533a 100644 --- a/.env.sample +++ b/.env.sample @@ -10,3 +10,7 @@ DISCORD_IP = IP_ADDRESS # subnet address, ex. 172.18.0.0 as we use /16. SUBNET_ADDRESS = ADDRESS + +# redis port and ip +REDIS_IP = IP_ADDRESS +REDIS_PORT = PORT \ No newline at end of file diff --git a/README.md b/README.md index 1f22ae9..fee417c 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,9 @@ The project aims to: * [x] Administrator Role Compatible * [x] Multi-User Chat Generation (Multiple users chatting at the same time) - This was built in from Ollama `v0.2.1+` * [x] Automatic and Manual model pulling through the Discord client -* [ ] Allow others to create their own models personalized for their own servers! - * [ ] Documentation on creating your own LLM - * [ ] Documentation on web scrapping and cleaning ## Documentation -These are guides to the feature set included and the events triggered in this app. +These are guides to the features and capabilities of this app. * [User Slash Commands](./docs/commands-guide.md) * [Client Events](./docs/events-guide.md) diff --git a/docker-compose.yml b/docker-compose.yml index b104062..37864bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,17 @@ services: - ${OLLAMA_PORT}:${OLLAMA_PORT} # Put Redis Container here? + redis: + image: redis:latest + container_name: redis + restart: always + networks: + ollama-net: + ipv4_address: ${REDIS_IP} + volumes: + - redis:/root/.redis + ports: + - ${REDIS_PORT}:${REDIS_PORT} # create a network that supports giving addresses withing a specific subnet networks: @@ -49,3 +60,4 @@ networks: volumes: ollama: discord: + redis: diff --git a/docs/commands-guide.md b/docs/commands-guide.md index 1381ad2..5823280 100644 --- a/docs/commands-guide.md +++ b/docs/commands-guide.md @@ -78,8 +78,7 @@ This is a guide to all of the slash commands for the app. ``` /message-stream stream true ``` - > [!NOTE] - > This is a very slow progress on Discord because "spamming" changes within 5 seconds is not allowed. + **This is a very slow progress on Discord because "spamming" changes within 5 seconds is not allowed.** 3. Message Style This command allows a user to select whether to embed the app's response. diff --git a/docs/events-guide.md b/docs/events-guide.md index 2e5bc00..2e5f1f8 100644 --- a/docs/events-guide.md +++ b/docs/events-guide.md @@ -1,7 +1,9 @@ ## Events Guide This is a guide to all of the client events for the app. -> [!NOTE] Each of these is logged to the console for a developer to track. +> [!NOTE] +> * Each of these is logged to the console for a developer to track. +> * Possible interactions include commands, buttons, menus, etc. 1. ClientReady This event signifies that the Discord app is online. @@ -11,8 +13,6 @@ This is a guide to all of the client events for the app. This event signifies that a user interacted from Discord in some way. Here commands are selected from a knowledge bank and executed if found. - > [!NOTE] Possible interactions include commands, buttons, menus, etc. - 3. MessageCreate This event signifies that a message was sent. Here user questions and comments for the LLM are processed. @@ -24,4 +24,4 @@ This is a guide to all of the client events for the app. 4. ThreadDelete This event signifies that a Discord Thread was deleted. - Here any preferences set for interaction within the thread are cleared away. \ No newline at end of file + Here any preferences set for interaction within the thread are cleared away. diff --git a/package.json b/package.json index 4338419..e1fbf49 100644 --- a/package.json +++ b/package.json @@ -13,15 +13,16 @@ "client": "npm run build && npm run prod", "clean": "docker compose down && docker rmi $(docker images | grep kevinthedang | tr -s ' ' | cut -d ' ' -f 3) && docker rmi $(docker images --filter \"dangling=true\" -q --no-trunc)", "start": "docker compose build --no-cache && docker compose up -d", - "docker:clean": "docker rm -f discord && docker rm -f ollama && docker network prune -f && docker rmi $(docker images | grep kevinthedang | tr -s ' ' | cut -d ' ' -f 3) && docker rmi $(docker images --filter \"dangling=true\" -q --no-trunc)", + "docker:clean": "docker rm -f discord && docker rm -f ollama && docker rm -f redis && docker network prune -f && docker rmi $(docker images | grep kevinthedang | tr -s ' ' | cut -d ' ' -f 3) && docker rmi $(docker images --filter \"dangling=true\" -q --no-trunc)", "docker:network": "docker network create --subnet=172.18.0.0/16 ollama-net", "docker:build": "docker build --no-cache -t kevinthedang/discord-ollama:$(node -p \"require('./package.json').version\") .", "docker:build-latest": "docker build --no-cache -t kevinthedang/discord-ollama:latest .", "docker:client": "docker run -d -v discord:/src/app --name discord --network ollama-net --ip 172.18.0.3 kevinthedang/discord-ollama:$(node -p \"require('./package.json').version\")", + "docker:redis": "docker run -d -v redis:/root/.redis -p 6379:6379 --name redis --network ollama-net --ip 172.18.0.4 redis:latest", "docker:ollama": "docker run -d --gpus=all -v ollama:/root/.ollama -p 11434:11434 --name ollama --network ollama-net --ip 172.18.0.2 ollama/ollama:latest", "docker:ollama-cpu": "docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama --network ollama-net --ip 172.18.0.2 ollama/ollama:latest", - "docker:start": "docker network prune -f && npm run docker:network && npm run docker:build && npm run docker:client && npm run docker:ollama", - "docker:start-cpu": "docker network prune -f && npm run docker:network && npm run docker:build && npm run docker:client && npm run docker:ollama-cpu" + "docker:start": "docker network prune -f && npm run docker:network && npm run docker:build && npm run docker:redis && npm run docker:client && npm run docker:ollama", + "docker:start-cpu": "docker network prune -f && npm run docker:network && npm run docker:build && npm run docker:redis && npm run docker:client && npm run docker:ollama-cpu" }, "author": "Kevin Dang", "license": "ISC",