Open Source

Use HTML Instead of Markdown for LLM Chat to Create Interactive Content

LLM outputs piped into iframes enable real-time animated and interactive elements.

Deep Dive

A Reddit user has sparked discussion by advocating for HTML as the default output format in AI agent chats, arguing it enables far richer interactivity than traditional Markdown or diagramming tools. In a follow-up to an earlier post, sdfgeoff demonstrates LLMs building animated and interactive elements—such as clickable buttons, live charts, or simple games—inline with the conversation. The technical implementation is straightforward: each agent response is piped into a sandboxed iframe on the frontend, keeping generated code isolated from the main page. This avoids the security risks of raw HTML injection while allowing the model to create fully functional UI components.

The approach challenges the conventional wisdom that Markdown is a superset of HTML (it is, but rarely used by AI agents for rich interactivity) and echoes the concept of "disposable software"—small, one-off interfaces generated on demand. Running Qwen3.6-27B at roughly 70 tokens per second on dual RTX 3090s, the user notes the latency is already reasonable and expects faster models will make real-time interactive chat generation seamless. The idea could reshape how developers think about agent outputs, moving from static text to dynamic, user-controllable experiences.

Key Points
  • HTML outputs are piped into sandboxed iframes, eliminating injection risks while enabling interactive elements.
  • Qwen3.6-27B runs at 70 tokens/s on dual 3090s, showing current hardware can already handle the approach.
  • Disposable software philosophy: models generate one-off interactive UIs directly within the chat conversation.

Why It Matters

Interactive HTML in LLM chats could replace static diagrams and turn agents into real-time application builders.