Back to prompt library
Setup Vercel AI SDK Router Route
Linked challenge: Real-Time Model Accelerator Selector API with Vercel AI SDK
Prompt source
implementation1 lines1 sectionsNo variables0 checklist items
import { createDataStreamResponse } from 'ai'; Define an Edge Route handler that inspects prompt metadata and selects the lowest-cost accelerator target before creating the response stream.