Skip to content

Docs

TypeSafe Provider

@ai-sdk/typesafe-ai adds an evaluation model to the Vercel AI SDK: one experimental_evaluate call sends a state with choice, score, and boolean questions and returns typed answers, probabilities, confidence, and usage.
Format
Docs
Reading time
3 min
Published by
Community
Last verified
Sep 2026

Highlights

  • Install @ai-sdk/typesafe-ai, set TYPESAFE_AI_API_KEY, and evaluate with typeSafeAi.evaluationModel('jev-latest').
  • Choice takes 1-255 options, Score 2-10 ordered levels, and the SDK's boolean maps to TypeSafe's Noul as P(true).
  • Answers arrive rounded to two decimals; result.rounding reports the precision, so probability sums can miss exactly one.
  • Confidence for Choice and Score sits under result.providerMetadata.typesafe.confidence[questionId], apart from probabilities.
  • Failures raise APICallError; the SDK retries 429 and 529 up to maxRetries (default 2), with no provider-side retry loop.

Quickstart

ts
import { typeSafeAi } from '@ai-sdk/typesafe-ai';
import { experimental_evaluate } from 'ai';

const result = await experimental_evaluate({
  model: typeSafeAi.evaluationModel('jev-latest'),
  state: { message: 'I was charged twice. Please refund the duplicate.' },
  questions: {
    department: {
      type: 'choice',
      instructions: 'Which team should handle this?',
      criteria: { billing: ['Charges', 'Refunds'], technical: ['Bugs'], other: null },
    },
  },
});

console.log(result.answers.department.choice);

Watch out

Only the experimental evaluation API is supported - language, embedding, and image model factories throw NoSuchModelError - and the page is Vercel's, not TypeSafe's.

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

X: Jev lands on the Vercel AI Gateway

YouTube: Greg Isenberg and Ryan Vogel on the businesses Jev unlocks, and a path in through the Vercel AI Gateway.

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