We built a Custom Transport for Vercel's AI SDK Ably built a custom transport for the Vercel AI SDK that replaces the default HTTP-based streaming transport with Ably's realtime pub/sub platform. The new transport enables multi-device and multi-user chat, resumable streams, human handoff, history compaction, and barge-in interruption — features the default SSE transport cannot support. This integration aims to solve open issues in the AI SDK, such as losing partial messages on stream errors and failing to resume streams mid-response. Ably is a realtime messaging platform, it's a pub/sub product where you can publish messages to channels and clients subscribed to those channels will receive those messages in realtime. It turns out that the Ably realtime platform is really well suited to being the transport that sits between your AI models and the clients receiving the generated responses. We're trying to meet developers where they currently are, and one of those places is the Vercel AI SDK. So we built a custom transport for the Vercel AI SDK that uses Ably as the transport layer. We want to expose all the features the Ably AI Transport supports to the AI SDK; multi-device, multi-user, resumable streams, human handoff, history compaction, barge-in and interruption, and more. So this post covers what we managed to support when building against the AI SDK. It was an exercise in trying to make a library do something it wasn't originally designed for. AI SDK or AI UI SDK? So the Vercel AI SDK comes in two flavors, the AI SDK to run on the server and the AI UI SDK to run on the client. The UI SDK provides a bunch of react hooks and is where we'd focus most of our efforts. The main react hook that you need to know about is useChat ... const { messages, sendMessage, status } = useChat { transport: ablyChatTransport, } ; return