Jev uses AI SDK’s evaluation interface. It is not a chat-completions model, so use experimental_evaluate rather than generateText.
Install and authenticate
pnpm add ai@^7.0.105On Vercel, an OIDC token is available to the deployment automatically. After linking locally, vercel env pull .env.local supplies a short-lived token. A static AI_GATEWAY_API_KEY is optional outside Vercel.
Evaluate typed questions
import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({
model: 'typesafe-ai/jev',
state: { task: 'Draft a two-line release note' },
questions: {
route: {
type: 'choice',
instructions: 'Which bounded route fits this task?',
criteria: {
fast: 'Small direct text operation',
deep: 'Substantial analysis',
review: 'Needs authority or clarification',
},
},
consequential: {
type: 'boolean',
instructions: 'Does this request a consequential external action?',
},
},
maxRetries: 0,
providerOptions: { gateway: { zeroDataRetention: true } },
});Validate before policy
Choice and score probabilities may be optional at the SDK type level. Treat a missing distribution or missing provider confidence as a reason to pause, not as zero. Jev score indexes start at zero and may be fractional because the score is a probability-weighted rubric position.
Current references: Vercel’s Jev guide ↗ and model page ↗.