Git Product home page Git Product logo

jcllobet / chatgpt-minimal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blrchen/chatgpt-minimal

0.0 0.0 0.0 806 KB

Lightweight chatgpt bot built using Next.js and the OpenAI Streaming API. 一个使用 Next.js 和 OpenAI Streaming API 创建的简易ChatGPT聊天机器人

Home Page: https://chatgpt-minimal.vercel.app

License: MIT License

JavaScript 2.78% TypeScript 67.52% CSS 1.96% Dockerfile 5.53% Less 22.21%

chatgpt-minimal's Introduction

ChatGPT Minimal

English | 简体中文

Demo

Visit ChatGPT Minimal Demo Site

Features

ChatGPT Minimal is a lightweight chatbot built using Next.js and the OpenAI Streaming API for the GPT-3.5 model. It supports both OpenAI and Azure OpenAI accounts.

Components:

  • Next.js v13
  • OpenAI Streaming API (GPT-3.5 model, gpt-3.5-turbo)
  • API Routes
  • Chatbot UI with React and Ant Design

demo

For a full-featured ChatGPT UI, visit ChatGPT Lite.

Prerequisites

You need an OpenAI or Azure OpenAI account.

Deployment

Refer to the Environment Variables section for required environment variables.

Deploy on Vercel

Click the button below to deploy on Vercel: Deploy with Vercel

Deploy with Docker

For OpenAI account users:

docker run -d -p 3000:3000 \
   -e OPENAI_API_KEY="<REPLACE-ME>" \
   blrchen/chatgpt-minimal

For Azure OpenAI account users:

docker run -d -p 3000:3000 \
   -e AZURE_OPENAI_API_BASE_URL="<REPLACE-ME>" \
   -e AZURE_OPENAI_API_KEY="<REPLACE-ME>" \
   -e AZURE_OPENAI_DEPLOYMENT="<REPLACE-ME>" \
   blrchen/chatgpt-minimal

Development

Running Locally

  1. Install NodeJS 18.
  2. Clone the repository.
  3. Install dependencies with npm install.
  4. Copy .env.example to .env.local and modify environment variables accordingly.
  5. Start the application using npm run dev.
  6. Visit http://localhost:3000 in your browser.

Running Locally with Docker

  1. Clone the repository and navigate to the root directory.
  2. Update the OPENAI_API_KEY environment variable in the docker-compose.yml file.
  3. Build the application using docker-compose build ..
  4. Start the application by running docker-compose up -d.

Environment Variables

Required environment variables:

For OpenAI account:

Name Description Default Value
OPENAI_API_BASE_URL Use if you intend to use a reverse proxy for api.openai.com. https://api.openai.com
OPENAI_API_KEY Secret key string obtained from the OpenAI API website.

For Azure OpenAI account:

Name Description
AZURE_OPENAI_API_BASE_URL Endpoint (e.g., https://xxx.openai.azure.com).
AZURE_OPENAI_API_KEY Key
AZURE_OPENAI_DEPLOYMENT Model deployment name

Contribution

We welcome PRs of all sizes.

chatgpt-minimal's People

Contributors

blrchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.