Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

blrchen/chatgpt-minimal

Repository files navigation

English |简体中文

Demo

Visit theChatGPT 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 codebase, visitChatGPT Lite.

Prerequisites

You need an OpenAI or Azure OpenAI account.

Deployment

Refer to theEnvironment 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 20.
  2. Clone the repository.
  3. Install dependencies withnpm install.
  4. Copy.env.example to.env.local and modify environment variables as needed.
  5. Start the application usingnpm run dev.
  6. Openhttp://localhost:3000 in your browser.

Running Locally with Docker

  1. Clone the repository and go to the root directory.
  2. Update theOPENAI_API_KEY environment variable in thedocker-compose.yml file.
  3. Build the application usingdocker-compose build ..
  4. Start the application by runningdocker-compose up -d.

Environment Variables

Required environment variables:

For OpenAI account:

NameDescriptionDefault Value
OPENAI_API_BASE_URLUse if you intend to use a reverse proxy forapi.openai.com.https://api.openai.com
OPENAI_API_KEYSecret key string obtained from theOpenAI API website.

For Azure OpenAI account:

NameDescription
AZURE_OPENAI_API_BASE_URLEndpoint (e.g.,https://xxx.openai.azure.com).
AZURE_OPENAI_API_KEYKey
AZURE_OPENAI_DEPLOYMENTModel deployment name

Contribution

We welcome PRs of all sizes.

About

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

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp