All Pipeline Nodes support Vercel Edge Functions out of the box 🎉
You can define them manually and invoke them as usual or use the built-in helpers.
Aigur Client has built-in helpers for invoking Pipeline on Vercel Edge Functions.
Create an object that holds references to your Pipelines where the key is their id.
Next, create a generic Vercel Edge Function that will invoke the Pipeline based on the request path. You can now invoke any Pipeline and it will automatically run on Vercel Edge Functions (see below how).
The Generic Edge Function must be defined at /api/pipelines/[id].ts
We use the
vercel.invoke helper function to invoke the Pipeline. Behind the scenes it will access our generic Edge Function, invoke the Pipeline and return the result.
For streaming using the
vercel.invokeStream helper function:
If you don't want to use the helper function, you can define your Pipeline Edge Functions manually: