逆向工程 ChatGPT Web:OpenAI 如何为十亿用户打造
Reverse Engineering ChatGPT Web:How OpenAI Built for a Billion Users
逆向工程 ChatGPT Web:OpenAI 如何为十亿用户构建

Open a new tab, type chatgpt.com, and ask it something. No account, no sign in, no spinner. The page is interactive immediately, and the answer starts streaming a moment after you hit enter. That experience is served to roughly 1 billion people, making chatgpt.com a top website on the entire internet and one of the most used web apps in the world. On the surface it seems like a simple interface, but after digging in it's anything but. I spent days reverse engineering their web app by digging through the page source, bundled code, and network requests to understand how it was built.
打开一个新标签页,输入 chatgpt.com,然后问它一些问题。无需账户,无需登录,没有加载动画。页面立即变为可交互状态,在你按下回车键后片刻,答案就开始流式输出。这种体验服务于大约 10 亿人,使 chatgpt.com 成为整个互联网上的顶级网站,也是世界上使用最广泛的 Web 应用之一。表面上看,它似乎是一个简单的界面,但深入挖掘后却发现绝非如此。我花了几天时间逆向工程他们的 Web 应用,通过深入研究页面源代码、打包代码和网络请求来了解它是如何构建的。
What I'll dig into
我将深入探讨的内容
- Start with the constraints
- 从约束条件开始
- The migration from Next.js to React Router
- 从 Next.js 迁移到 React Router
- Fastest path to paint
- 最快的绘制路径
- CSS at billion-user scale
- 十亿用户规模下的 CSS
- Don't reinvent the wheel with components
- 不要在组件上重复造轮子
- Every answer is a render problem
- 每个回答都是一个渲染问题
- Can you type yet?
- 现在可以输入了吗?
- Feature flagging everything
- 对所有内容进行特性标记
- The fastest path to the first token
- 到达第一个 token 的最快路径
- Letting a billion strangers in
- 让十亿陌生人涌入
- The difference between ChatGPT and Claude
- ChatGPT 与 Claude 的区别
Before we start: I don't work at OpenAI and I've never seen their source code. What makes this piece different from my Linear and Conductor breakdowns is that OpenAI hasn't really published anything about ChatGPT web. This piece is a mixture of history, investigation, and technical insights. The whole story has been assembled from chatgpt.com itself (the HTML, JavaScript, CSS, and network requests) plus random talks, tweets, and their career page.
在开始之前:我不在 OpenAI 工作,也从未看过他们的源代码。这篇文章与我对 Linear 和 Conductor 的拆解分析不同之处在于,OpenAI 并没有真正发布过任何关于 ChatGPT 网页版的内容。这篇文章是历史、调查和技术见解的混合体。整个故事都是从 chatgpt.com 本身(HT...