cd /news/ai-products/jev-and-ai-sdk-template-by-vercel-la… · home topics ai-products article
[ARTICLE · art-135696] src=github.com ↗ pub= topic=ai-products verified=true sentiment=· neutral

Jev and AI SDK Template by Vercel Labs

Vercel Labs released the Jev and AI SDK Template, an open-source Next.js 16 and React 19 form-routing starter that uses the typesafe-ai/jev model to route submissions and falls back to openai/gpt-5.6-luna-fast when Jev's confidence is below 95% or its evaluation fails. The template ships three example forms — /leads, /contact, and /issues — built on AI SDK 7, the Vercel AI Gateway, shadcn/ui, Base UI, Tailwind CSS 4, React Email, and Resend, and requires Node.js 22+ and pnpm. Routing a submission makes live model calls requiring AI Gateway access to both models, via an AI_GATEWAY_API_KEY or Vercel OIDC authentication.

read4 min views1 publishedSep 21, 2026
Jev and AI SDK Template by Vercel Labs
Image: Michielbdejong (auto-discovered)

Three forms use Jev to route submissions by context, with openai/gpt-5.6-luna-fast handling uncertain or failed evaluations. Includes editable samples, routing details, and optional email delivery.

Technology Purpose
Next.js 16 and React 19 App Router, shared form UI, and Server Actions
AI SDK 7 and Vercel AI Gateway Typed model calls and provider access
shadcn/ui, Base UI, and Tailwind CSS 4 Components and styling
React Email and Resend Email previews and optional delivery
  • Node.js 22+
  • pnpm package manager
git clone https://github.com/vercel-labs/jev-ai-sdk-form-router.git
cd jev-ai-sdk-form-router
pnpm install

Routing a submission, including a sample, makes live model calls and requires AI Gateway access to both typesafe-ai/jev and openai/gpt-5.6-luna-fast. Choose one of the authentication options below, or skip this step to explore the forms and load sample inputs without generating routing results.

API Key

Copy the environment example:

cp .env.example .env.local

Create a Vercel AI Gateway key and set AI_GATEWAY_API_KEY in .env.local.

Vercel OIDC

Vercel deployments use automatic OIDC authentication through the SDK, without an API key. To use OIDC locally, install the Vercel CLI if needed, then link the project and pull its environment variables:

npm install --global vercel
vercel link
vercel env pull .env.local
pnpm dev

Open localhost:3000. The home page redirects to /leads.

Example Route Routes to
Lead /leads Startup, growth, enterprise, or sales teams
Contact /contact Billing, support, or general inquiries
Issue Report /issues Frontend, platform, infrastructure, identity, or engineering teams
  1. Zod validates the submission against the fields in lib/examples.ts .
  2. Jev evaluates the complete submission using AI SDK’s experimental_evaluate and selects an allowed team/specialty combination.
  3. The app accepts Jev’s choice when its confidence is at least 95% .
  4. If confidence is lower, missing, or invalid, or Jev fails, openai/gpt-5.6-luna-fast independently evaluates the same submission and criteria usinggenerateText andOutput.object . Its choice becomes final.
  5. The result includes the destination, deciding model, Jev statistics, model timings, and an email preview.

Confidence and selected-option probability are separate metrics. The threshold uses the unrounded value of providerMetadata.typesafe.confidence.destination. Jev’s displayed statistics remain attached to its original evaluation when the fallback model makes the final decision.

Provider calls have bounded timeouts and one transient retry. If both models fail, the app returns a retryable error and sends no email.

Optional email delivery #

Set up Resend through Vercel Marketplace

The Resend Marketplace integration creates a Resend account and connects it to your Vercel project. During setup, you can select an existing Vercel domain or purchase one.

If you haven't already, install the Vercel CLI and link the project:

npm install --global vercel
vercel link

Start the integration setup:

vercel i resend

Select an existing domain or purchase one through Vercel, then choose a plan and connect your project. Complete onboarding in Resend, choose Auto configure to add the DNS records, and wait for domain verification. 4. Pull the integration's environment variables for local development:

vercel env pull .env.local

Confirm RESEND_API_KEY is present and setRESEND_FROM in.env.local to a sender address on your verified domain.

If you already have a Resend account, you can instead set RESEND_API_KEY and RESEND_FROM directly using your existing API key and a verified domain.

Configure receiving inboxes

In lib/recipients.ts, replace null with a valid inbox for every destination on the form you want to enable. Multiple destinations can share an inbox.

An unchecked Email the receiving team checkbox appears on configured forms.

Recipient keys are derived from the destination registry and checked by TypeScript. Addresses stay server-side. The validated submitter email becomes replyTo. Forms with unconfigured inboxes continue to provide previews.

Email failures preserve the routing result. Resend acceptance does not confirm inbox delivery. If a connection drops after an opted-in submission, check Resend before resubmitting.

File What to change
lib/examples.ts Form fields, samples, destinations, and routing criteria
lib/router.ts Models, confidence threshold, timeouts, and fallback policy
lib/recipients.ts Receiving inboxes
lib/submission.ts Validation, email rendering, and delivery workflow
components/router-form.tsx andcomponents/routing-result.tsx Shared form and result UI
emails/routed-submission.tsx Email design

Keep the experimental AI SDK version pinned and rerun the checks when upgrading it.

pnpm fix       # Format and apply lint fixes
pnpm validate  # Lint, type check, Knip, and tests
pnpm build     # Production build

Tests mock the model providers and Resend. They make no external calls. Coverage includes confidence thresholds, fallback decisions, validation, recipient configuration, and delivery retries.

── more in #ai-products 4 stories · sorted by recency
── more on @vercel labs 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/jev-and-ai-sdk-templ…] indexed:0 read:4min 2026-09-21 ·