Skip to content

Article

Classify, Route, and Score with Jev and AI SDK

End-to-end guide to a ticket-routing workflow with confidence thresholds, zero-data-retention options, and mock-based tests that need no network call.
Format
Article
Reading time
2 min
Published by
Community
Last verified
Sep 2026

Highlights

  • Jev on AI Gateway: 64,000 tokens per request with 32,000 for state, no output token charge, $0.042 per 1M input tokens.
  • Choice confidence lives at result.providerMetadata.typesafe.confidence, keyed by question ID, and is not returned for boolean answers.
  • TypeSafe rounds probabilities and scores to two decimals, so a choice distribution may sum to 0.99 instead of exactly 1.
  • Experimental_EvaluationMockModelV4 from ai/test returns answers you supply, so threshold branches can be tested with no network call.
  • providerOptions.gateway.zeroDataRetention: true is supported per request, and evaluation calls appear in Gateway logs and budgets.

Quickstart

ts
import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({
  model: 'typesafe-ai/jev',
  state: 'Stripe sync broken on the pro plan.',
  questions: {
    department: {
      type: 'choice',
      instructions: 'Which team should handle this ticket?',
      criteria: { billing: 'Charges and refunds', technical: 'Bugs and outages' },
    },
  },
  providerOptions: { gateway: { zeroDataRetention: true } },
});

Watch out

Questions are evaluated independently so one answer never becomes context for another, and input tokens are the only thing billed, so keep the state focused.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

X: Vercel ships the AI SDK provider for Jev

Hacker News: Vercel's guide to classifying, routing, and scoring with Jev and the AI SDK.

flashbrew2 pointsHow to classify, route, and score with Jev and AI SDKRead the thread on Hacker News

Facebook: Intake Router keeps diagnosis out of the answer space at the front desk.

FacebookClinicnotes

X: OpenRouter Decision Model Rankings

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai