streaming
Streaming protocol implementation guide for custom AI backends and assistant-ui integration.
- Provides
createAssistantStreamResponsefor building custom streaming responses with text, tool calls, and structured event handling - Supports two integration paths: Vercel AI SDK (via
toUIMessageStreamResponse) or native assistant-stream for non-SDK backends - Includes
useLocalRuntimepattern for client-side streaming withChatModelRunResultchunks and content part yielding - Covers stream event types (part-start, text-delta, result, step-finish, error) and debugging via
AssistantStreamandDataStreamDecoder - Documents common issues: Content-Type headers, CORS errors, tool call registration, and text-delta event requirements
assistant-ui Streaming
Always consult assistant-ui.com/llms.txt for latest API.
The assistant-stream package handles streaming from AI backends.
References
- ./references/data-stream.md -- AI SDK data stream format
- ./references/assistant-transport.md -- Native assistant-ui format
- ./references/encoders.md -- Encoders and decoders
When to Use
Using Vercel AI SDK?
├─ Yes → toUIMessageStreamResponse() (no assistant-stream needed)
└─ No → assistant-stream for custom backends
More from assistant-ui/skills
assistant-ui
Guide for assistant-ui library - AI chat UI components. Use when asking about architecture, debugging, or understanding the codebase.
1.8Kprimitives
Guide for assistant-ui UI primitives - ThreadPrimitive, ComposerPrimitive, MessagePrimitive. Use when customizing chat UI components.
1.5Ktools
Guide for tool registration and tool UI in assistant-ui. Use when implementing LLM tools, tool call rendering, or human-in-the-loop patterns.
1.5Kruntime
Guide for assistant-ui runtime system and state management. Use when working with runtimes, accessing state, or managing thread/message data.
1.4Kthread-list
Guide for multi-thread management in assistant-ui. Use when implementing thread lists, switching threads, or managing conversation history.
1.4Ksetup
Setup and configure assistant-ui in a project. Use when installing packages, configuring runtimes, setting up chat UI, or troubleshooting setup issues.
1.4K