Article
CommunityJev Guides & Articles
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.
The Gateway token does. Running vercel env pull writes a VERCEL_OIDC_TOKEN into your environment file, and locally that token expires after 12 hours, so a 401 means pulling it again. Deployments on Vercel receive the token automatically, which is the version to prefer for anything long-lived.
Yes. Experimental_EvaluationMockModelV4 from ai/test returns the answers you supply, so confidence branches can be exercised with no network call at all. Only the real evaluate call spends anything, and the mock exists so the routing logic can be tested in isolation from the model.
Not necessarily. TypeSafe rounds probabilities and scores to two decimals, so a choice distribution can sum to 0.99 instead of exactly 1. Assert on the selected option and the returned values rather than on exact arithmetic across the distribution.
No. The guide stresses that questions are evaluated independently, so one answer never becomes context for another and adding a question does not shift the rest. The pricing follows from the same model: only input tokens are billed, so keep the state focused.
The guide budgets 64,000 tokens per request, with 32,000 for state, at $0.042 per 1M input tokens and no output token charge. Only input tokens are billed, so keep the state focused rather than padding it.
It is at result.providerMetadata.typesafe.confidence, keyed by question ID. The guide notes it is returned for Choice answers and is not returned for boolean answers, whose probability always means P(true) instead.
providerOptions.gateway.zeroDataRetention: true is supported per request. The guide also notes that evaluation calls still appear in Gateway logs and budgets, so retention and logging are separate settings to weigh.
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 NewsFacebook: 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.