Streaming Examples
Explore streaming on Vercel with code samples that work out of the box.Vercel supports streaming in Edge and Serverless functions with some limitations. This page provides examples of techniques for processing data from streams.
To learn how streaming on Vercel works, see Streaming Concepts. To start immediately, deploy a streaming template:
Shooketh – AI bot fine-tuned on Shakespeare
An AI bot built with the Vercel AI SDK, OpenAI gpt-4o mini, and fine-tuned on Shakespeare's literary works
AI Twitter Bio Generator
Generate your Twitter bio with OpenAI GPT-3 API (text-davinci-003) and Vercel Edge Functions with streaming.
AI Film Recommendation Generator
Get curated show and movie recommendations with OpenAI GPT-3 API (text-davinci-003) and Vercel Edge Functions with streaming.
-
To use these examples, you should know how to create a Function with your preferred framework, which you can learn in the Functions quickstart
-
You should also have a fundamental understanding of how streaming works on Vercel. To learn more see the Streaming overview and Streaming quickstart
-
You should be using Node.js 18 or later and the latest version of the Vercel CLI.
Streaming responses from LLMs
Explore streaming on Vercel with code samples that work out of the box.
Processing Data Chunks
Learn how to create an API endpoint that processes data chunks.
Handling Backpressure
Code on how to handle backpressure by pushing data into a stream as it's needed, rather than as it's ready
Was this helpful?