Streaming working locally but not on Vercel?
Unanswered
Barbary Lion posted this in #help-forum
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?
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
https://github.com/tfutada/zenn-vercel-ai-sdk/blob/main/app/api-openai/route.ts
@Barbary Lion 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?
European sprat
Ensure your dependencies for openai and ai are updated
You no longer need openai-edge as openai 4.0.0 brought edge support