Next.js Discord

Discord Forum

Streaming working locally but not on Vercel?

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
I'm using OpenAiStream, it works well locally. But not on vercel.
My API is running on EDGE, and it's a client component calling it. and consuming it.

Locally the response is streamed in as expected. but when running on vercel it doesn't.

Any ideas?

3 Replies

streaming works in Vercel Edge Runtime, which is Cloudflare Worker. My poc code could help.
https://github.com/tfutada/zenn-vercel-ai-sdk/blob/main/app/api-openai/route.ts
You no longer need openai-edge as openai 4.0.0 brought edge support