Introduction
This is the final post in the 14-post series. The first 13 posts were about “how to make LLM run right, stably, and affordably in the backend” — but LLM apps still ultimately need to be seen by users.
LLM isn’t just “add a chat box”. It’s redefining UI:
- Button → Prompt button (“help me write a resignation letter”)
- Form → Generative form (user says one sentence, form auto-fills)
- Static page → Agent workspace (user drags data, agent processes)
- Nav bar → Intent router (user says “show me last week’s financial report”, jumps directly)
This post isn’t about code details — it’s about UI design paradigms:
- From commands to conversation: chat box isn’t a universal solution
- Generative UI: LLM generates UI itself
- Agent-first: UI designed for agent workflows
- 3 production UI patterns
- Near-future trends
1. From Commands to Conversation: Chat Box Isn’t Universal
Many teams’ first version of an LLM app is “add a chat box”. This is the biggest mistake.
Scenarios that don’t fit chat boxes
- Clear task operations: user wants “book a cab to the airport at 8am tomorrow” — button + form is 10x more efficient than chat
- Heavy data browsing: user wants “compare Q3 product sales” — charts are 100x more intuitive than text
- High-frequency repetitive tasks: user needs to “export yesterday’s sales report” daily — automated cron is more reasonable than asking the agent every day
Scenarios that fit chat boxes
- Open-ended exploration: “help me plan a Tokyo trip next week” → chat is natural
- Multi-step complex decisions: “analyze this quarter’s data and give me next year’s plan” → Agent + chat collaboration
- Natural-language exclusive: “translate this contract to English” → no UI is more direct than chat
Core principle: LLM is a new tool, but UI shouldn’t be a new paradigm. Good UI = the most natural form of the task, not necessarily chat.
2. Generative UI: LLM Generates UI Itself
The most important UI trend of 2026 — LLMs don’t just generate text, they generate complete UI components.
Case 1: Claude Artifacts
Anthropic’s Artifacts feature lets LLM generate interactive React components:
User: Help me draw an SVG showing the past 7 days of weather
Claude: [generates complete React component with 7 bar charts]
[users can click, hover, zoom]
Not the LLM telling you the answer — the LLM giving you an app.
Case 2: Vercel AI SDK Generative UI
Vercel AI SDK supports streaming custom UI components via useChat hook + message parts:
import { useChat } from '@ai-sdk/react';
import { DefaultChatTransport } from 'ai';
function Chat() {
// AI SDK v4+: api endpoint is configured via transport
const { messages, sendMessage } = useChat({
transport: new DefaultChatTransport({ api: '/api/chat' }),
});
const [input, setInput] = useState('');
return (
<>
{messages.map((m) => (
<Message key={m.id} message={m} />
))}
<form
onSubmit={(e) => {
e.preventDefault();
sendMessage({ text: input });
setInput('');
}}
>
<input value={input} onChange={(e) => setInput(e.target.value)} />
</form>
</>
);
}
function Message({ message }) {
// message.parts contains multiple parts streamed back from LLM (v4+ new structure)
// parts include type='text', type='reasoning', type='tool-<toolName>', etc.
return message.parts.map((part, i) => {
if (part.type === 'text') return <p key={i}>{part.text}</p>;
if (part.type === 'tool-weather') return <WeatherCard key={i} data={part.output} />;
if (part.type === 'tool-chart') return <Chart key={i} data={part.output} />;
});
}
LLM returns JSON schema; frontend renders the corresponding component. Note: message.toolInvocations was replaced by message.parts in v4+ (each tool call is an independent part).
Case 3: Chart-as-Answer
// LLM output: user asks "compare Q3 product sales"
// 1. LLM calls tool to query database
// 2. Tool returns structured data
// 3. LLM decides to use chart component
// 4. Frontend renders <Chart data={...} />
const result = streamText({
model: openai('gpt-4o'),
tools: {
querySales: tool({ /* ... */ }),
renderChart: tool({
description: 'Render data chart',
inputSchema: z.object({
type: z.enum(['bar', 'line', 'pie']),
data: z.array(z.any()),
title: z.string(),
}),
execute: async (input) => {
// Return structured data, frontend renders
return { type: input.type, data: input.data };
},
}),
},
prompt: userQuery,
});
Users no longer read text — they see charts.
3. Agent-First: UI Designed for Agent Workflows
When LLM apps upgrade to Agents, UI must upgrade too:
Old UI: user clicks button → backend executes
[User clicks "Export Report"] → [Button disabled] → [Loading spinner] → [Download link]
New UI: agent running → user sees real-time progress
User input: "Analyze Q3 sales data"
↓
UI shows agent's thinking process:
"🤔 Thinking: need to query 3 data sources..."
"🔧 Calling tool: query_database('sales_q3')"
"✓ Tool result: 1247 records"
"🔧 Calling tool: render_chart({ type: 'bar' })"
"✓ Tool result: chart generated"
"💬 Final answer: [chart + text explanation]"
Vercel AI SDK’s useChat supports tool call UI (v4+ uses message.parts instead of toolInvocations):
function Message({ message }) {
// Filter for tool-type parts
const toolParts = message.parts.filter((p) => p.type.startsWith('tool-'));
const textParts = message.parts.filter((p) => p.type === 'text');
return (
<>
{toolParts.map((part) => (
<ToolCallCard
key={part.toolCallId}
toolName={part.type.replace('tool-', '')}
input={part.input}
output={part.output}
state={part.state} // 'input-streaming' | 'input-available' | 'output-available' | 'output-error'
/>
))}
{textParts.map((part, i) => <p key={i}>{part.text}</p>)}
</>
);
}
3 Essentials for Agent UI
- Thinking flow visualization: user sees what agent is thinking/doing (trust building)
- Tool call panel: each tool call’s input/output/latency expandable
- Human-in-the-loop points: confirmation modal before dangerous tool calls
Cases: Cursor / Devin / v0’s Agent UI
- Cursor: chat on left + code diff on right, user watches agent modify code throughout
- Devin: chat left + browser sandbox center + terminal right — agent’s entire operation is on screen
- v0 (Vercel): user says one sentence, generates complete React app in real-time, UI updates synchronously
These aren’t “chat boxes” — they’re Agent Workspaces — UI designed for agents, not humans.
4. 3 Production UI Patterns
Pattern 1: Hybrid (Mixed)
Traditional UI + LLM assistant button. Don’t disrupt existing UI, enhance gradually:
[Product list page]
[Traditional table + filter]
+ [✨ AI Assistant] (button, opens chat drawer)
→ "Help me find products whose sales dropped 30%"
Best for: traditional Web apps adding LLM capability, lowest risk.
Pattern 2: Copilot (Co-pilot)
LLM as assistant, main UI is still traditional:
[Code editor] + [Right-side Copilot panel]
→ User writes code, Copilot suggests in real-time
→ User asks "what does this code do", Copilot explains
Best for: writing / coding / design tools. GitHub Copilot / Cursor / Notion AI all use this.
Pattern 3: Agent Workspace
UI completely designed for agents, user mainly does “instruction + supervision + intervention”:
[Chat] [Files] [Browser] [Terminal] [Settings]
↕ ↕ ↕ ↕ ↕
[User input] [all resources agent uses]
Best for: Devin / Cursor Agent Mode / automated testing platforms. User role shifts from “operator” to “commander”.
5. Near-Future Trends
Clear trends for LLM UI in 2026-2028:
Trend 1: Conversation → Intent (Conversational → Intentional)
Future UI doesn’t require typing:
- Voice-first: Whisper / real-time speech models + Agent direct execution
- Gestures / gaze: multi-modal input on VR / AR devices
- Environment awareness: agent observes user behavior (which page opened, how long stayed), proactively engages rather than passively responding
Trend 2: UI = Agent Output (UI-as-Output)
UI is no longer “developer designs + user uses” — LLM generates UI in real-time:
- User says “show me flights from Beijing to Shanghai” → LLM renders flight list UI in real-time
- User says “analyze this CSV” → LLM renders chart + data pivot UI in real-time
Every query = a new UI. The fixed-UI era ends.
Trend 3: Agentic Economy
Agents call each other, collaborate:
- User’s agent calls “booking agent” → booking agent calls “payment agent” → payment agent calls “bank agent”
- Each agent has its own UI, user sees the full flow from the top-level agent
Like Taobao is a market for merchants and consumers, the future is a market for agents.
Trend 4: Personalized UI’s Demise
By 2026, all Web app UIs look increasingly similar (Vercel / shadcn / Tailwind templates). Personalized UI is no longer needed in the LLM era — each query gives users UI customized for them, fixed templates lose meaning.
6. 5 Principles for Designing LLM UI
Regardless of pattern, 5 principles apply universally:
- Transparent: What agent is doing, what tools used, how much cost, user can see
- Controllable: Dangerous operations require user-approval, never auto-execute
- Interruptible: User can pause / cancel / change direction at any time
- Reversible: All agent operations can be undone
- Predictable: Agent’s capability bounds clearly told to user, don’t give illusion of “AI does everything”
7. Impact on Frontend Engineers
LLM apps are changing frontend engineer requirements:
| Before | Now |
|---|---|
| Write React components | Design component schemas (LLM renders) |
| Handle user input | Handle LLM output (streaming JSON) |
| Call APIs | Design tool schemas (LLM calls) |
| Write loading states | Design agent thinking flow UI |
| Write tests | Write eval sets + end-to-end traces |
Not replaced by LLMs, but coding target shifts from “browser DOM” to “LLM output”.
Summary
Five takeaways:
- Chat box ≠ universal UI: task UI / charts / automated triggers are better in many scenarios.
- Generative UI is the trend: LLM generates UI itself (Artifacts / charts / forms), every query gets a new UI.
- Agent-first UI: thinking flow + tool panel + intervention points, user shifts from operator to commander.
- 3 production patterns: Hybrid (gradual enhancement) / Copilot (co-pilot) / Agent Workspace (workspace).
- Frontend engineer transition: from writing DOM to designing LLM output schema + streaming UI + agent thinking flow.
Series Complete 🎉
14 posts cover the full stack of LLM application engineering:
| Batch | Topic | Posts |
|---|---|---|
| 1 | LLM Fundamentals | 3 |
| 2 | RAG Core | 2 |
| 3 | Agent Core | 2 |
| 4 | Engineering Trio | 3 (Memory + Observability + Evaluation) |
| 5 | Production Wrap-up + AI UI | 4 (Cost Optimization + Guardrails + Production Engineering + AI UI) |
| Total | 14 posts (28 .mdx files) |
If you read this whole series, you should be able to:
- Design and implement a production-grade RAG system
- Build multi-agent collaboration workflows
- Continuously improve quality with observability + eval
- Control cost with caching + routing
- Defend against security threats with guardrails
- Design LLM-native UI experiences
Next: build a project. Reading theory without practicing is the same as not reading.
References
- Vercel AI SDK — UI Overview — useChat hook, message parts, generative UI, tool UI rendering
- Vercel AI SDK — Chatbot — streaming chat UI implementation
- Vercel AI SDK — Generative UI — pattern for LLM generating UI components
// Related Posts
Agent Architecture: ReAct, Plan-and-Execute & Multi-Agent
From single-tool calls to a full agent reasoning loop — three mainstream architectures and their production trade-offs.
Embedding Models & Vector Database Selection in Practice
How to pick RAG's two core dependencies — BGE / OpenAI / Cohere / Voyage? Pinecone / Milvus / pgvector / Qdrant / Weaviate?
LLM Cost & Performance Optimization: Caching, Streaming & Model Routing
How to fix runaway token bills — prompt cache, semantic cache, streaming optimization, model routing, automatic fallback (5 optimization levers).