Skip to content

Commit

Permalink
A.I. - New Applications (akash-network#382)
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
  • Loading branch information
88plug authored May 17, 2023
1 parent 92ad44a commit 1f2867b
Show file tree
Hide file tree
Showing 20 changed files with 1,062 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ Also, follow [@akashnet\_](https://twitter.com/akashnet_) to stay in the loop wi
### AI

- [Alpaca.cpp](alpaca-cpp)
- [Auto-GPT](auto-gpt)
- [BabyAGI](babyagi)
- [BabyAGI-UI](babyagi-ui)
- [ChatChat](chatchat)
- [ChatGPT Self-Hosted Chat](ai-chat-app)
- [Daila](daila)
- [GPT4ALL](gpt4all)
- [Serge](serge)
- [Stable Diffusion](stable-diffusion-ui)
- [Terminal GPT](tgpt)

### Blogging

Expand Down
44 changes: 44 additions & 0 deletions auto-gpt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# '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

# Install browsers
RUN apt-get update && apt-get install -y \
chromium-driver firefox-esr \
ca-certificates

# Install utilities
RUN apt-get install -y curl jq wget git

# 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
153 changes: 153 additions & 0 deletions auto-gpt/README.md

Large diffs are not rendered by default.

109 changes: 109 additions & 0 deletions auto-gpt/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
version: "2.0"

services:
auto-gpt:
image: cryptoandcoffee/akash-auto-gpt:1
expose:
- port: 8080
as: 80
proto: tcp
to:
- global: true
env:
- "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"
- "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"
- "OPENAI_API_KEY=your-openai-api-key"
- "TEMPERATURE=0.5"
- "USE_AZURE=False"
- "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"
- "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"
- "HUGGINGFACE_API_TOKEN=your-huggingface-api-token"
- "SD_WEBUI_AUTH="
- "SD_WEBUI_URL=http://127.0.0.1:7860"
- "HUGGINGFACE_AUDIO_TO_TEXT_MODEL=facebook/wav2vec2-base-960h"
- "GITHUB_API_KEY=github_pat_123"
- "GITHUB_USERNAME=your-github-username"
- "HEADLESS_BROWSER=True"
- "USE_WEB_BROWSER=chrome"
- "BROWSE_CHUNK_MAX_LENGTH=3000"
- "BROWSE_SPACY_LANGUAGE_MODEL=en_core_web_sm"
- "GOOGLE_API_KEY=your-google-api-key"
- "CUSTOM_SEARCH_ENGINE_ID=your-custom-search-engine-id"
- "USE_MAC_OS_TTS=False"
- "USE_BRIAN_TTS=False"
- "ELEVENLABS_API_KEY=your-elevenlabs-api-key"
- "ELEVENLABS_VOICE_1_ID=your-voice-id-1"
- "ELEVENLABS_VOICE_2_ID=your-voice-id-2"
- "TW_CONSUMER_KEY="
- "TW_CONSUMER_SECRET="
- "TW_ACCESS_TOKEN="
- "TW_ACCESS_TOKEN_SECRET="
- "ALLOWLISTED_PLUGINS="
- "DENYLISTED_PLUGINS="
- "CHAT_MESSAGES_ENABLED=False"
profiles:
compute:
auto-gpt:
resources:
cpu:
units: 4
memory:
size: 4.75Gi #Increase this for larger local memory, can be lower if used external vector for memory.
storage:
size: 16Gi
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:
auto-gpt:
denom: uakt
amount: 10000 #Keep high to show all bids
deployment:
auto-gpt:
akash:
profile: auto-gpt
count: 1
22 changes: 22 additions & 0 deletions babyagi-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:19

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm ci

COPY . .

RUN npm run build

ENV OPENAI_API_KEY=""
ENV PINECONE_API_KEY=""
ENV PINECONE_ENVIRONMENT=""
ENV NEXT_PUBLIC_TABLE_NAME="baby-agi-test-table"
ENV NEXT_PUBLIC_USE_USER_API_KEY="false"
ENV SEARP_API_KEY=""

EXPOSE 3000

ENTRYPOINT [ "npm", "start" ]
75 changes: 75 additions & 0 deletions babyagi-ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# BabyAGI UI 👶🤖🖥️

BabyAGI UI is designed to make it easier to run and develop with [babyagi](https://github.com/yoheinakajima/babyagi) in a web app, like a ChatGPT.
This is a port of [babyagi](https://github.com/yoheinakajima/babyagi) with [Langchain.js](https://github.com/hwchase17/langchainjs) and build a user interface.

[Demo](https://twitter.com/miiura/status/1653026609606320130)

## 🧰 Stack

- [Next.js](https://nextjs.org/)
- [Pinecone](https://www.pinecone.io/)
- [LangChain.js](https://github.com/hwchase17/langchainjs)
- [Tailwind CSS](https://tailwindcss.com/)
- [Radix UI](https://www.radix-ui.com/)

## 🚗 Roadmap

- [x] The BabyAGI can search and scrape the web. ([🐝 BabyBeeAGI](https://twitter.com/yoheinakajima/status/1652732735344246784))
- [x] Exporting Execution Results
- [x] Execution history
- [x] Faster speeds and fewer errors. ([😺 BabyCatAGI](https://twitter.com/yoheinakajima/status/1657448504112091136))
- [ ] Display the current task and task list
- [ ] i18n support
- [ ] User feedback
- [ ] Other LLM models support

and more ...

## 👉 Getting Started

1. Clone the repository

```sh
git clone https://github.com/miurla/babyagi-ui
```

2. Go to the project holder

```sh
cd babyagi-ui
```

3. Install packages with npm

```sh
npm install
```

4. Setup your .env file. And set the variables.
- You need to create an index in advance with [Pinecone](https://www.pinecone.io/).
- [Reference setting](./public/pinecone-setup.png)
- Set your SerpAPI Key, if you want to use the search tool with BabyBeeAGI.

```sh
cp .env.example .env
```

5. Run the project

```sh
npm run dev
```

## ⚠️ Warning

This script is designed to be run continuously as part of a task management system. Running this script continuously can result in high API usage, so please use it responsibly. Additionally, the script requires the OpenAI API to be set up correctly, so make sure you have set up the API before running the script.

[original](https://github.com/yoheinakajima/babyagi#warning)

## Credit

### BabyAGI

- Github: https://github.com/yoheinakajima/babyagi
- Author: [@yoheinakajima](https://github.com/yoheinakajima)
50 changes: 50 additions & 0 deletions babyagi-ui/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
version: "2.0"

services:
babyagi-ui:
image: cryptoandcoffee/akash-babyagi-ui:1
expose:
- port: 3000
as: 80
proto: tcp
to:
- global: true
env:
- "OPENAI_API_KEY="
- "PINECONE_API_KEY="
- "PINECONE_ENVIRONMENT="
- "NEXT_PUBLIC_TABLE_NAME=baby-agi-test-table"
- "NEXT_PUBLIC_USE_USER_API_KEY=false"
- "SEARP_API_KEY="
profiles:
compute:
babyagi-ui:
resources:
cpu:
units: 8
memory:
size: 4.75Gi #Increase this for larger local memory, can be lower if used external vector for memory.
storage:
size: 16Gi
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:
babyagi-ui:
denom: uakt
amount: 10000 #Keep high to show all bids
deployment:
babyagi-ui:
akash:
profile: babyagi-ui
count: 1
13 changes: 13 additions & 0 deletions babyagi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.11-slim

ENV PIP_NO_CACHE_DIR=true
WORKDIR /app
RUN apt-get update && apt-get install build-essential wget curl git -y

COPY entrypoint.sh .
EXPOSE 8080

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

ENTRYPOINT ["bash", "/app/entrypoint.sh"]
Loading

0 comments on commit 1f2867b

Please sign in to comment.