Skip to content

Latest commit

 

History

History
134 lines (108 loc) · 3.17 KB

README.md

File metadata and controls

134 lines (108 loc) · 3.17 KB

Nev's Awesome ChatGPT

This is my private thing that I use everyday, deployed at www.nevdelap.com/chat (behind auth), because it does exactly what I want and nothing else.

Screenshot of Nev's Awesome ChatGPT

Another screenshot of Nev's Awesome ChatGPT

Prerequisites

paru -Sy unzip

From Scratch

# Install micromamba using the package manager.
mkdir -p ~/reflex &&
cd ~/reflex &&
git clone [email protected]:nevdelap/droplet.git &&
git clone [email protected]:nevdelap/nevschat.git &&
cd nevschat &&
git submodule init &&
git submodule update &&
scripts/install_dev &&
micromamba activate nevschat

Run The App In Dev

cd app &&
reflex run # Test at http://localhost:3000/

Update Reflex

cd reflex &&
git fetch &&
git checkout v0.4.6 &&
cd .. &&
git add reflex &&
git commit -m 'Update reflex.' &&
pip install -e reflex

Release On DigitalOcean

This shows scripts/lint being run manually though it can be run automatically with scripts/install_hooks.

git add . &&
git commit -m 'whatever' &&
scripts/lint &&
git push --force origin HEAD:master --no-verify &&
git tag --force latest &&
git push --force origin latest --no-verify &&
ssh_droplet "cd ~/nevschat && scripts/deploy && sleep 30 && scripts/logs"

Quick Release

This is used as lpd - lint, push, deploy.

#!/bin/bash
current_dir="$(basename "$(pwd)")"
if [[ "$current_dir" == "droplet" ]]; then
    echo 'Pushing droplet.'
    git push --force origin HEAD:master
    git push --tags
    ssh_droplet "
        cd ~/droplet &&
        git fetch &&
        git checkout origin/master &&
        chmod 0700 /etc/monit/monitrc &&
        monit reload
    "
elif [[ "$current_dir" == "nevschat" ]]; then
    echo 'Linting, pushing, and deploying nevschat.'
    scripts/lint &&
    git push --force origin HEAD:master --no-verify &&
    git tag --force latest &&
    git push --force origin latest --no-verify &&
    ssh_droplet "
        cd ~/droplet &&
        git fetch &&
        git checkout origin/master &&
        monit reload &&
        cd ~/nevschat &&
        scripts/deploy &&
        sleep 30 &&
        scripts/logs
    "
fi

General Info

Documentation

OpenAI

The OpenAI key is supplied in the OPENAI_API_KEY environment variable. It should be configured with a monthly budget and email notification when it is exceeded.

Google TTS

The Google TTS API key is supplied in the GOOGLE_TTS_KEY environment variable. It should be restricted to be usable only for the Cloud Text-to-Speech API, and only from the production and development IP addresses.

DeepL

The DeepL auth key is supplied in the DEEPL_AUTH_KEY environment variable. So far I'm on the free tier so I haven't configured any restrictions on it yet.