AI Gateway now supports TypeSafe clients and an HTTP API for Jev
Mirrored from Vercel — AI for archival readability. Support the source by reading on the original site.
You can now call Jev from TypeSafe AI through AI Gateway using an existing TypeSafe client or the HTTP API, in addition to the AI SDK.
TypeSafe client: Point an existing TypeSafe client at AI Gateway without changing its evaluation calls.
HTTP API: Call Jev directly from any language or framework.
AI SDK: Call Jev from a TypeScript application using AI SDK.
Jev is a probabilistic decision model for software. State goes in, and typed answers come out with probabilities attached, so there's no generated text to parse. Requests are billed through AI Gateway on all three paths, so they appear alongside your other model calls in usage and observability.
Copy link to headingMigrate an existing TypeSafe client
Change the base URL and API key. Your systemOne calls, noul questions, and response shapes stay exactly as they are.
import { TypeSafeClient } from '@typesafe-ai/sdk';
const client = new TypeSafeClient({ apiKey: process.env.AI_GATEWAY_API_KEY, baseURL: 'https://ai-gateway.vercel.sh/typesafe',Connect an existing TypeSafe client to AI Gateway without changing its evaluation calls.
Copy link to headingStart a new integration
New integrations name the model as typesafe-ai/jev and ask one of three question types: boolean returns a probability from 0 to 1, choice picks one option from a set you name, and score rates against a scale you define. This example asks whether an agent should keep working after fixing a bug and passing its tests.
With the HTTP API, POST to /v1/evaluate:
curl https://ai-gateway.vercel.sh/v1/evaluate \ -H "Authorization: Bearer $AI_GATEWAY_API_KEY" \ -H "Content-Type: application/json" \Ask Jev whether an agent should continue working through the native HTTP API.
With the AI SDK, run the same evaluation through evaluate:
import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({ model: 'typesafe-ai/jev', state: 'The agent fixed the checkout bug and all tests pass.', questions: { continueWorking: { type: 'boolean', instructions: 'Should the agent take another step?',Run the same evaluation in a TypeScript application with AI SDK.
You can also use Jev through eve, a framework for building and deploying durable agents with sandboxed compute, human approvals, and evaluations already built in. eve uses Jev as the default evaluation model for automatic model selection, typed evaluations, and automated tool approvals.
See the TypeSafe-compatible API guide to migrate a client, or the evaluation guide for the HTTP API or AI SDK.
Discussion (0)
Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.
Sign in →No comments yet. Sign in and be the first to say something.