Edge Runtime
Overview
The Edge Runtime is assistant-ui's native runtime with the most built-in features. It is the recommended runtime for new projects.
The edge runtime can connect to a variety of backends, including:
- Edge Runtime backends
- Vercel AI SDK backends (using Data Stream protocol)
Getting Started
Define a MyRuntimeProvider
component
Update the MyModelAdapter
below to integrate with your own custom API.
Streaming
Declare the run
function as an AsyncGenerator
(async *run
). This allows you to yield
the results as they are generated.