Build ChatGPT – Frontend System Design Guide

We’ll walk through the frontend system design for building a ChatGPT-style web application. Our goal is to design an interface that lets users enter prompts, stream responses word by word, maintains a conversation history, and optionally supports model switching (for example, toggling between GPT-3.5 and GPT-4). We’ll focus on building a frontend that’s fast, scalable, and production-ready, capable of serving millions of users with smooth, real-time experiences. You’ll see estimates for scale, functional requirements, and the key non-functional criteria that make for a robust, user-friendly AI chat app.
Requirements

- Prompt input: User enters a prompt.
- Streaming response: Chat response streams words word by word, similar to ChatGPT.
- Conversation history: Threads of past chats per user.
- Model switching (optional): Choose between GPT-3.5, GPT-4, etc.
Scalability Estimates
... premium content.
