GPT-3.5-turbo base template

This repo's purpose is to be a starting point for contextual based chat interactions with Open Ai's gpt-3.5-turbo API.

It is meant to be forked, cloned, and copied so folks can play around with the API. Please customize the styling, break things, and most of all, have fun!

Screen Shot 2023-03-19 at 10 54 56 PM

Getting started

  1. Clone or fork the repo
  2. Run npm i
  3. Create an .env file in root and add your Open AI API key to it (this file is not tracked)
OPENAI_API_KEY=superSecretAPIKey
  1. Run npm run dev
  2. Open in your browser http://localhost:3000/
  3. Start playing with the context you wish to add in /app/context/index.ts

Under the hood

This is build using Remix (a react based framework), Typescript, and uses Tailwind for CSS. Some key notes:

  • Pages can be found under /app/routes
  • Styling can be found in /app/stylesheets and can be added in the /app/root.tsx file in the links() function
  • Context for the chat interaction should be stored in /app/context/index.ts and should follow the data format for messages (role, content)

Deployment

This repo was set up to deploy to Vercel as the main deplopyment source but you can customize it if you wish to suit your needs.

Feedback

Would love to hear some feedback. Please feel free to open issues or hit me up on Twitter.