Skip to content

Instantly share code, notes, and snippets.

@ajcwebdev
Created April 8, 2024 16:56
Show Gist options
  • Save ajcwebdev/1e962d7f944a6c7f35572bcef2623c17 to your computer and use it in GitHub Desktop.
Save ajcwebdev/1e962d7f944a6c7f35572bcef2623c17 to your computer and use it in GitHub Desktop.
Nick Taylor | AI Frontends

Create Project

Create a LlamaIndex.TS project.

Load Data

Download previous show descriptions.

curl "https://ajc.pics/nickyt.pdf" > nickyt.pdf

Set API Key

Set OpenAI API key to an environment variable.

export OPENAI_API_KEY="YOUR_API_KEY"

Generate Project

Generate project with the following options.

npx create-llama@latest nickyt \
  --template streaming \
  --framework nextjs \
  --observability none \
  --open-ai-key $OPENAI_API_KEY \
  --model gpt-4-turbo-preview \
  --files $HOME/nickyt.pdf \
  --use-llama-parse false \
  --vector-db none \
  --tools none \
  --post-install-action dependencies

Process Data

cd nickyt
npm run generate

Start Development Server

npm run dev

Deploy

git init
git add .
git commit -m "init"
gh repo create nickyt \
  --public \
  --push \
  --source=. \
  --description="Nickyt stream." \
  --remote=upstream

Vercel

vercel --env OPENAI_API_KEY=$OPENAI_API_KEY --prod --yes

Netlify

netlify init
netlify env:import .env.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment