Skip to content

Commit

Permalink
A.I. - New Apps and Updates (#386)
Browse files Browse the repository at this point in the history
* Add AI section

Add ai-chat-app to run self-hosted chatgpt.

* Add stable diffusion and ai-chat-app update

* Update README and deploy.yaml on ai-chat-app and sd

* Add ChatGPT screenshots

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Initial commit serge

* Add daila

* Add alpaca and gpt4all

* Fix image name

* Fix alpaca.cpp

* README updates

* Fix StableDiffusion

* auto-gpt

* ChatChat

* Readme update

* Cleanup

* Update defaults for ChatChat

* babyagi

* Add babyagi-ui and updates

* add Terminal GPT

* README fixes

* Cleanup README

Cleanup README

* Update ChatChat README.md

* Update Wordpress deploy.yaml

Use default wordpress image and mariadb

* Update Wordpress README.md

Redis is optional for Wordpress and requires the user to install a plugin after install to activate.  Using standard practice Wordpress + DB per Wordpress docker-compose.yml.

* Update Wordpress deploy.yaml

Implement MYSQL_RANDOM_ROOT_PASSWORD

* Add weaviate vector db

* auto-gpt always up-to-date

* Update Serge to latest Dockerfile

* Update Serge

- Use latest Dockerfile
- Include version number in image
- Update README
- Update deploy.yaml with better instructions

* Update .env and entrypoint for auto-gpt

* Add Supabase

* Finalize auto-gpt updates

* Supabase not ready

* Add Flowise

* Add GPU support for Weaviate
  • Loading branch information
88plug authored Jun 2, 2023
1 parent 3f7ae24 commit 146e512
Show file tree
Hide file tree
Showing 11 changed files with 447 additions and 109 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ Also, follow [@akashnet\_](https://twitter.com/akashnet_) to stay in the loop wi
- [ChatChat](chatchat)
- [ChatGPT Self-Hosted Chat](ai-chat-app)
- [Daila](daila)
- [Flowise](flowise)
- [GPT4ALL](gpt4all)
- [Serge](serge)
- [Stable Diffusion](stable-diffusion-ui)
- [Terminal GPT](tgpt)
- [Weaviate](weaviate)

### Blogging

Expand Down
32 changes: 7 additions & 25 deletions auto-gpt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# 'dev' or 'release' container build
ARG BUILD_TYPE=dev

# Use an official Python base image from the Docker Hub
FROM python:3.10-slim AS autogpt-base
FROM python:3.10-slim

# Install browsers
RUN apt-get update && apt-get install -y \
Expand All @@ -12,33 +9,18 @@ RUN apt-get update && apt-get install -y \
# Install utilities
RUN apt-get install -y curl jq wget git

RUN wget https://github.com/yudai/gotty/releases/download/v2.0.0-alpha.3/gotty_2.0.0-alpha.3_linux_amd64.tar.gz
RUN tar -zxvf gotty_2.0.0-alpha.3_linux_amd64.tar.gz ; chmod +x gotty ; rm -rf gotty_2.0.0-alpha.3_linux_amd64.tar.gz ; mv gotty /usr/local/bin/

# Set environment variables
ENV PIP_NO_CACHE_DIR=yes \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1

# Install the required python packages globally
ENV PATH="$PATH:/root/.local/bin"
COPY requirements.txt .

# Set the entrypoint
#ENTRYPOINT ["python", "-m", "autogpt"]
RUN wget https://github.com/yudai/gotty/releases/download/v2.0.0-alpha.3/gotty_2.0.0-alpha.3_linux_amd64.tar.gz
RUN tar -zxvf gotty_2.0.0-alpha.3_linux_amd64.tar.gz ; chmod +x gotty ; rm -rf gotty_2.0.0-alpha.3_linux_amd64.tar.gz

ENTRYPOINT ["/gotty", "-w", "--random-url-length", "16", "python", "-m", "autogpt"]

# dev build -> include everything
FROM autogpt-base as autogpt-dev
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /app
ONBUILD COPY . ./

# release build -> include bare minimum
FROM autogpt-base as autogpt-release
RUN sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \
pip install --no-cache-dir -r requirements.txt
WORKDIR /app
ONBUILD COPY autogpt/ ./autogpt

FROM autogpt-${BUILD_TYPE} AS auto-gpt
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
35 changes: 12 additions & 23 deletions auto-gpt/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,41 @@ version: "2.0"

services:
auto-gpt:
image: cryptoandcoffee/akash-auto-gpt:1
image: cryptoandcoffee/akash-auto-gpt:3
expose:
- port: 8080
as: 80
proto: tcp
to:
- global: true
env:
# Full description of these options: https://github.com/Significant-Gravitas/Auto-GPT/blob/master/.env.template
- "EXECUTE_LOCAL_COMMANDS=True"
- "RESTRICT_TO_WORKSPACE=False"
- "USER_AGENT=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
#- "AI_SETTINGS_FILE=ai_settings.yaml"
# - "AI_SETTINGS_FILE=ai_settings.yaml"
# - "PROMPT_SETTINGS_FILE=prompt_settings.yaml"
- "AUTHORISE_COMMAND_KEY=y"
- "EXIT_KEY=n"
#- "DISABLED_COMMAND_CATEGORIES=autogpt.commands.analyze_code,autogpt.commands.execute_code,autogpt.commands.git_operations,autogpt.commands.improve_code,autogpt.commands.write_tests"
- "PLAIN_OUTPUT=True"
# - "DISABLED_COMMAND_CATEGORIES=autogpt.commands.analyze_code,autogpt.commands.execute_code,autogpt.commands.git_operations,autogpt.commands.improve_code,autogpt.commands.write_tests"
# - "DENY_COMMANDS=cd,nano,vim,vi,emacs,rm,sudo,top,ping,ssh,scp"
# - "ALLOW_COMMANDS=ls,git,cat,grep,find,echo,ps,curl,wget"
- "OPENAI_API_KEY=your-openai-api-key"
- "TEMPERATURE=0.5"
- "TEMPERATURE=0"
- "USE_AZURE=False"
# - "OPENAI_ORGANIZATION=your-openai-organization-key-if-applicable"
- "SMART_LLM_MODEL=gpt-4"
- "FAST_LLM_MODEL=gpt-3.5-turbo"
- "FAST_TOKEN_LIMIT=4000"
- "SMART_TOKEN_LIMIT=8000"
- "EMBEDDING_MODEL=text-embedding-ada-002"
- "EMBEDDING_TOKENIZER=cl100k_base"
- "EMBEDDING_TOKEN_LIMIT=8191"
- "MEMORY_BACKEND=local"
- "MEMORY_INDEX=auto-gpt"
- "PINECONE_API_KEY=your-pinecone-api-key"
- "PINECONE_ENV=your-pinecone-region"
- "MEMORY_BACKEND=json_file"
- "MEMORY_INDEX=auto-gpt-memory"
- "REDIS_HOST=localhost"
- "REDIS_PORT=6379"
- "REDIS_PASSWORD="
- "WIPE_REDIS_ON_START=True"
- "WEAVIATE_HOST=127.0.0.1"
- "WEAVIATE_PORT=8080"
- "WEAVIATE_PROTOCOL=http"
- "USE_WEAVIATE_EMBEDDED=False"
- "WEAVIATE_EMBEDDED_PATH=/home/me/.local/share/weaviate"
- "WEAVIATE_USERNAME="
- "WEAVIATE_PASSWORD="
- "WEAVIATE_API_KEY="
- "MILVUS_ADDR=localhost:19530"
- "MILVUS_USERNAME="
- "MILVUS_PASSWORD="
- "MILVUS_SECURE="
- "MILVUS_COLLECTION=autogpt"
- "IMAGE_PROVIDER=dalle"
- "IMAGE_SIZE=256"
- "HUGGINGFACE_IMAGE_MODEL=CompVis/stable-diffusion-v1-4"
Expand Down
16 changes: 16 additions & 0 deletions auto-gpt/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#Upgrade pip
pip install --upgrade pip

# Clone the Auto-GPT repository
git clone https://github.com/Significant-Gravitas/Auto-GPT.git /app

# Set the working directory
cd /app

git checkout stable

pip install --no-cache-dir -r requirements.txt

gotty -w --random-url-length 16 python -m autogpt
54 changes: 54 additions & 0 deletions flowise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Flowise - LangchainJS UI

<a href="https://github.com/FlowiseAI/Flowise">
<img width="100%" src="https://github.com/FlowiseAI/Flowise/blob/main/images/flowise.gif?raw=true"></a>

Drag & drop UI to build your customized LLM flow using [LangchainJS](https://github.com/hwchase17/langchainjs)

## ⚡Quick Start

Open URI in Cloudmos after deployment.

## 🔒 Authentication

To enable app level authentication, add `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `.env` file in `packages/server`:

```
FLOWISE_USERNAME=user
FLOWISE_PASSWORD=1234
```

## 📖 Documentation

[Flowise Docs](https://docs.flowiseai.com/)

## 🌐 Self Host

### [Railway](https://docs.flowiseai.com/deployment/railway)

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/YK7J0v)

### [Render](https://docs.flowiseai.com/deployment/render)

[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://docs.flowiseai.com/deployment/render)

### [AWS](https://docs.flowiseai.com/deployment/aws)

### [DigitalOcean](https://docs.flowiseai.com/deployment/digital-ocean)

## 💻 Cloud Hosted

Coming soon

## 🙋 Support

Feel free to ask any questions, raise problems, and request new features in [discussion](https://github.com/FlowiseAI/Flowise/discussions)

## 🙌 Contributing

See [contributing guide](CONTRIBUTING.md). Reach out to us at [Discord](https://discord.gg/jbaHfsRVBW) if you have any questions or issues.
[![Star History Chart](https://api.star-history.com/svg?repos=FlowiseAI/Flowise&type=Timeline)](https://star-history.com/#FlowiseAI/Flowise&Date)

## 📄 License

Source code in this repository is made available under the [MIT License](LICENSE.md).
58 changes: 58 additions & 0 deletions flowise/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: '2.0'
services:
flowise:
image: flowiseai/flowise
expose:
- port: 3000
as: 80
to:
- global: true
args:
- start
command:
- flowise
env:
#- "PORT=${PORT}"
#- "FLOWISE_USERNAME=${FLOWISE_USERNAME}"
#- "FLOWISE_PASSWORD=${FLOWISE_PASSWORD}"
params:
storage:
flowise:
mount: /root/.flowise
readOnly: false
profiles:
compute:
flowise:
resources:
cpu:
units: 4
memory:
size: 4Gi
storage:
- size: 1Gi
- name: flowise
size: 32Gi
attributes:
persistent: true
class: beta3
placement:
akash:
#######################################################
#Keep this section to deploy on trusted providers
signedBy:
anyOf:
- "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
- "akash18qa2a2ltfyvkyj0ggj3hkvuj6twzyumuaru9s4"
#######################################################
#Remove this section to deploy on untrusted providers
#Beware* You may have deployment, security, or other issues on untrusted providers
#https://docs.akash.network/providers/akash-audited-attributes
pricing:
flowise:
denom: uakt
amount: 10000
deployment:
flowise:
akash:
profile: flowise
count: 1
55 changes: 28 additions & 27 deletions serge/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
# ---------------------------------------
# Base image for node
FROM node:19 as node_base
FROM node:19-slim as node_base

WORKDIR /usr/src/app
# Install pip and requirements

# ---------------------------------------
# Base image for runtime
FROM ubuntu:22.04 as base

ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Amsterdam
FROM python:3.11-slim as base

ENV TZ=Etc/UTC
WORKDIR /usr/src/app

COPY scripts/compile.sh .

# Install MongoDB and necessary tools
RUN apt update && \
apt install -y curl wget gnupg python3-pip git && \
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add - && \
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list && \
apt-get update && \
apt-get install -y mongodb-org && \
git clone https://github.com/ggerganov/llama.cpp.git --branch master-5a5f8b1
# Install Redis
RUN apt-get update \
&& apt-get install -y curl wget gnupg cmake lsb-release build-essential \
&& curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list \
&& apt-get update \
&& apt-get install -y redis \
&& mkdir -p /etc/redis /var/redis \
&& pip install --upgrade pip

RUN pip install --upgrade pip
# Add redis config
COPY ./serge/config/redis.conf /etc/redis/redis.conf

# ---------------------------------------
# Dev environment
FROM base as dev
ENV NODE_ENV='development'

# Install Node.js and npm packages
COPY --from=node_base /usr/local /usr/local
COPY ./web/package*.json ./
COPY ./serge/web/package*.json ./
RUN npm ci

COPY scripts/dev.sh /usr/src/app/dev.sh
COPY --chmod=0755 scripts/dev.sh /usr/src/app/dev.sh
CMD ./dev.sh

# ---------------------------------------
# Build frontend
FROM node_base as frontend_builder

COPY ./web/package*.json ./
COPY ./serge/web/package*.json ./
RUN npm ci

COPY ./web /usr/src/app/web/
COPY ./serge/web /usr/src/app/web/
WORKDIR /usr/src/app/web/
RUN npm run build

# ---------------------------------------
# Runtime environment
FROM base as release

ENV NODE_ENV='production'
WORKDIR /usr/src/app

COPY --from=frontend_builder /usr/src/app/web/build /usr/src/app/api/static/
COPY ./api /usr/src/app/api

RUN pip install ./api
COPY ./serge/api /usr/src/app/api
COPY --chmod=0755 serge/scripts/deploy.sh /usr/src/app/deploy.sh

COPY scripts/deploy.sh /usr/src/app/deploy.sh
RUN chmod 755 /usr/src/app/deploy.sh
RUN pip install --no-cache-dir ./api

RUN mkdir -p /data/db
RUN mkdir -p /usr/src/app/weights/
RUN mkdir -p /usr/src/app/weights

EXPOSE 8008
CMD ./deploy.sh
Loading

0 comments on commit 146e512

Please sign in to comment.