aietheia/ChatHTML
GitHub: aietheia/ChatHTML
将 AI 模型的回复从纯 Markdown 转化为实时流式渲染的沙箱化交互 HTML 界面,支持可视化、互动和精美排版。
Stars: 455 | Forks: 21
ChatHTML
优美的 AI 回复,超越纯 Markdown。
将 prompt 转化为实时的流式交互界面,能够进行解释、可视化与互动。
## 什么是 ChatHTML? ChatHTML 将普通消息转化为实时流式的 HTML 响应。它会随着模型生成的进度逐步渲染出交互界面,因此回复可以是解释性的、视觉化的、交互式的,或者仅仅是排版极其精美的。 它专注于响应媒介本身,而非复刻 ChatGPT 风格的产品或应用构建工作流。聊天外壳的存在是为了让任何回答都能成为沙箱化的 UI artifact。 - **默认精美** — 采用响应式的 HTML、CSS、排版与动效,而非单纯的代码块。 - **交互性强** — 支持表单、控件、小型原生脚本,以及能延续对话的按钮。 - **私密且安全** — 服务端密钥仅保留在服务端;生成的 artifact 在受保护的沙箱中运行。 - **为迭代而生** — 支持对结果进行选择、编辑、重新生成、修复、复制或导出。
纯 Markdown 与 ChatHTML 对比
## 示例:纯 Markdown 与 ChatHTML 每一行都源自相同的请求;不同的是响应的媒介。左侧是将用户 prompt 直接发送给 OpenRouter 后,由同一配置模型返回的原始响应,渲染为没有任何产品外壳的纯 Markdown 文档。此过程未发送任何系统指令或响应格式指令。右侧是本仓库 `/api/chat` pipeline 的实际输出,由 ChatHTML runtime 渲染。提交的确切 prompt 存储在 [`scripts/readme-comparison-prompts.mjs`](scripts/readme-comparison-prompts.mjs) 中。 未使用任何 ChatGPT 截图或第三方产品 UI。外部图库照片来自 Wikimedia Commons,并在示例旁注明了出处。
| Plain Markdown | ChatHTML |
|---|---|
| Prompt 1 · Run a Pomodoro clock Build a working Pomodoro clock set to 25:00. Include Start/Pause, Reset, skip, Focus/Short Break/Long Break modes, four session progress dots, and a compact task field. Use a bold analog-inspired countdown with subtle motion and keyboard hints. Keep it polished and focused; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 2 · Curate an image gallery Create a compact editorial gallery titled “Evolution / I–X” celebrating the Mitsubishi Lancer Evolution. Keep the complete 2-by-2 gallery, filters, captions, and credits visible within a single viewport. Use the four provided Wikimedia Commons images and load every image eagerly. Show model generation, year, photographer, and license on each card, with filters for III, VI, IX, and X and a click-to-expand lightbox. Do not imply endorsement; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source Photos: III · Charles · CC BY 2.0 · VI · Motoring Weapon R · CC BY-SA 3.0 · IX · FotoSleuth · CC BY 2.0 · X · IFCAR · Public domain |
| Prompt 3 · Make it playable Build a playable 2048 mini-game with arrow-key and swipe controls, score and best counters, a new game button, and a clear visual hierarchy. The initial HTML itself must contain all 16 visible board cells and a plausible mid-game seed; JavaScript may take over for moves after load. Do not access browser storage; keep the best score only in memory for the current artifact. Keep it compact and polished; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 4 · Direct a visual Build an interactive typographic poster studio. Show a bold live poster preview with the editable headline “MOVE / WITH / INTENT”, controls for palette, type scale, grain, alignment, and a shuffle button. Use only CSS shapes and typography; no external assets. Make it editorial, expressive, and polished; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 5 · Explain it interactively Teach me how cubic Bezier curves work. Build an interactive playground with a large curve, adjustable control points, the formula, and three named easing presets. Keep it focused and polished; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 6 · Build a working utility Build a tip and split calculator for a EUR 186.50 dinner shared by 4 people. Include editable bill, tip, and party-size controls, update totals live, and show the calculation clearly. Keep it compact and polished; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 7 · Step through a process Explain what happens after I type https://example.com into a browser and press Enter. Make an annotated, animated-looking pipeline from DNS through TCP and TLS, HTTP, and rendering, with controls to step through each stage. No web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
| Prompt 8 · Explore live data Build an accessible color palette lab. Include HSL sliders, five live swatches with hex values, a foreground/background contrast checker, and AA/AAA status badges. Make it vivid, compact, and polished; no web search. |
|
![]() Markdown source |
![]() Live example · Generated source |
All user-facing content lives in this artifact.
标签:AI前端, HTML渲染, MITM代理, Web开发工具, 交互式UI, 前端可视化, 多模态安全, 大模型交互, 数据可视化, 自动化攻击















