{"slug": "six-ways-to-integrate-jev-into-your-application", "title": "Six ways to integrate Jev into your application", "summary": "Vercel published six integration paths for Jev, TypeSafe's evaluation model, covering AI SDK, TanStack AI, Cloudflare, LangChain, eve, and TypeSafe's own SDKs and HTTP API. With AI SDK, developers call experimental_evaluate with the model ID 'typesafe-ai/jev' and can route requests through Vercel AI Gateway using AI_GATEWAY_API_KEY or Vercel OIDC authentication; with TanStack AI, developers call decide() with a TypeSafe adapter and set TYPESAFE_API_KEY. The examples ask Jev to select a support team for a customer reporting an unexpected invoice charge, and the AI SDK evaluation API is experimental, so its contract should be checked on upgrade.", "body_md": "You can integrate [Jev](https://vercel.com/i/what-is-jev) through AI SDK or TanStack AI, call it from Cloudflare, add it to LangChain or eve, or use TypeSafe's SDKs and HTTP API. Start with the tools your application already uses, then choose how requests reach Jev.\n\nYou can combine some of these options. Using AI SDK or TanStack AI, for example, still leaves you a choice of calling TypeSafe directly or sending requests through Vercel AI Gateway.\n\n## [Copy link to heading](#what-is-the-difference-between-a-library,-an-adapter,-and-a-gateway)What is the difference between a library, an adapter, and a gateway?\n\nYour application library defines the function you call and the answer shape you read. Its provider adapter translates that call into a request to a service. If you use a gateway, that service routes the request to the model provider.\n\nWith AI SDK, you call `experimental_evaluate` and select an evaluation model. With TanStack AI, you call `decide()` and supply an evaluation adapter. Both can reach Jev through [Vercel AI Gateway](https://vercel.com/docs/ai-gateway/modalities/evaluation).\n\nStart with the integration that fits your existing code:\n\nThe AI SDK, TanStack AI, and Cloudflare examples each ask Jev to choose the right support team for a customer reporting an unexpected invoice charge. Using the same request makes it easier to compare how each integration defines the question, calls Jev, and reads the answer. Your application can then use the selected team to route the ticket to the appropriate queue.\n\n## [Copy link to heading](#1.-use-jev-with-ai-sdk)1. Use Jev with AI SDK\n\nUse AI SDK when evaluation needs to sit alongside the model calls already in your TypeScript application. Its [evaluation API](https://ai-sdk.dev/docs/ai-sdk-core/evaluation) accepts shared state and named questions, then returns answers under those question names. The API is experimental, so check its contract when upgrading the SDK.\n\nWith AI SDK's default Gateway provider, a Gateway model ID sends the call through Vercel AI Gateway. Configure `AI_GATEWAY_API_KEY` or Vercel OIDC authentication on the server before calling it:\n\n``` js\nimport { experimental_evaluate as evaluate } from 'ai';\nconst result = await evaluate({  model: 'typesafe-ai/jev',  state: 'Our latest invoice includes an extra seat we never added.',  questions: {    team: {      type: 'choice',      instructions: 'Select the team responsible for resolving this request.',      criteria: {        billing: 'Questions about invoice amounts or charges',        account: 'Problems signing in or accessing an account',        other: 'Requests outside billing and account access',      },    },  },});\nconsole.log(result.answers.team.choice);\n```\n\nThe `typesafe-ai/jev` [evaluation model](https://vercel.com/docs/ai-gateway/modalities/evaluation) returns a selection your application can map to a support queue. The example supplies the categories; it doesn't send the ticket or modify a customer record.\n\nFor direct TypeSafe access, import `typeSafeAi` from `@ai-sdk/typesafe-ai` and supply `typeSafeAi.evaluationModel('jev-latest')` as the model, with TypeSafe credentials configured. The question definitions stay in AI SDK's format.\n\nThe [Jev and AI SDK guide](https://vercel.com/kb/guide/typesafe-jev-and-ai-sdk) extends this pattern with multiple questions and application logic for handling uncertain answers.\n\n## [Copy link to heading](#2.-use-jev-with-tanstack-ai)2. Use Jev with TanStack AI\n\nIf your application already uses TanStack AI, its [TypeSafe adapter](https://tanstack.com/ai/latest/docs/adapters/typesafe) lets you add Jev through `decide()`. Question helpers express the same decisions with different configuration names. For a choice question, TanStack AI uses `options` where AI SDK uses `criteria`.\n\nTo call Jev directly through TypeSafe, install TanStack AI (`@tanstack/ai`) and its TypeSafe adapter (`@tanstack/ai-typesafe`). Then set `TYPESAFE_API_KEY` to your TypeSafe API key in your server environment.\n\nThe following example uses `decide()` to select a team for a support ticket:\n\n``` js\nimport { decide, choice } from '@tanstack/ai';import { typesafeDecider } from '@tanstack/ai-typesafe';\nconst result = await decide({  adapter: typesafeDecider('jev-latest'),  state: 'Our latest invoice includes an extra seat we never added.',  questions: {    team: choice({      instructions: 'Select the team responsible for resolving this request.',      options: {        billing: 'Questions about invoice amounts or charges',        account: 'Problems signing in or accessing an account',        other: 'Requests outside billing and account access',      },    }),  },});\nconsole.log(result.team.value);\n```\n\nYou can also combine question types in one call. The [product-review moderation guide](https://vercel.com/kb/guide/moderate-product-reviews-jev-tanstack-ai) uses TanStack AI with Vercel AI Gateway to evaluate a review's topic and sentiment, then check for promotional content and personal information. It supplies the product name, review text, and customer's star rating as shared state.\n\nIn that workflow, `choice()` selects the topic, `score()` assesses sentiment against ordered descriptions, and two `boolean()` questions check the content flags. Answers appear directly under their question names, such as `result.topic.value` and `result.isPromotional.probability`. The sentiment score describes the text, so it can differ from the customer's star rating.\n\nApplication code then maps the answers to a publishing decision. The guide holds flagged reviews and unclear or off-topic submissions for a moderator. Reviews that pass its thresholds receive a publish decision, with requirements such as verified purchase checked separately. Keeping that policy in a function lets you test its branches with fixed answers before evaluating Jev on labeled reviews.\n\nTanStack AI also supports other services through evaluation adapters. You can keep the state and questions while changing the adapter and its credentials:\n\nInside a Worker, the [Cloudflare adapter accepts an AI binding](https://tanstack.com/ai/latest/docs/adapters/cloudflare#evaluate) through `createCloudflareDecider`. The [OpenRouter adapter](https://tanstack.com/ai/latest/docs/adapters/openrouter#evaluate) uses OpenRouter's decisions endpoint. These are evaluation-specific integrations, so choose the decider factory when configuring Jev.\n\n## [Copy link to heading](#3.-call-jev-through-cloudflare)3. Call Jev through Cloudflare\n\nFor a Worker that already has an AI binding, you can [call Jev with](https://developers.cloudflare.com/ai/models/typesafe/jev/) [`env.AI.run`](https://developers.cloudflare.com/ai/models/typesafe/jev/) without adding an application framework.\n\nWithin your Worker handler, the same classification looks like this:\n\n``` js\nconst result = await env.AI.run('typesafe/jev', {  state: 'Our latest invoice includes an extra seat we never added.',  questions: {    team: {      type: 'choice',      instructions: 'Select the team responsible for resolving this request.',      criteria: {        billing: 'Questions about invoice amounts or charges',        account: 'Problems signing in or accessing an account',        other: 'Requests outside billing and account access',      },    },  },});\nconsole.log(result.answers.team.choice);\n```\n\nYou can also call Jev over HTTP with a Cloudflare account ID and API token, as shown in [Cloudflare’s model documentation](https://developers.cloudflare.com/ai/models/typesafe/jev/). For choice questions, the binding returns the selected answer in `choice`, the answer distribution in `probabilities`, and a separate `confidence` value. Yes-or-no questions use TypeSafe’s `noul` format.\n\nIf the Worker already uses TanStack AI, its Cloudflare adapter gives you the `decide()` interface over the binding. Choose the interface that keeps the surrounding application consistent.\n\n## [Copy link to heading](#4.-add-jev-to-a-langchain-workflow)4. Add Jev to a LangChain workflow\n\nFor Python applications built with LangChain, [`TypeSafeClassifier`](https://docs.langchain.com/oss/python/integrations/providers/typesafe) exposes Jev as a Runnable. Install `langchain-typesafe`, configure `TYPESAFE_API_KEY`, and pass both `state` and `questions` to `.invoke()`.\n\nThe package supplies `Choice`, `Score`, and `Noul` question classes. For the support-routing example, define a `Choice` question named `team` and read the selected destination at `response.choices['team'].choice`. Answers are grouped by question type, so a Noul answer lives under `response.nouls`.\n\nThis integration is useful when the decision belongs inside an existing LangChain workflow. The classifier accepts LangChain messages, and its calls can appear in LangSmith traces. The package also provides experimental middleware for choosing an agent's response model or checking proposed tool calls. Those middleware integrations require the package's experimental extra.\n\n## [Copy link to heading](#5.-use-jev-with-eve)5. Use Jev with eve\n\nIn an eve agent, Jev can evaluate a request inside a tool or help decide what happens before the agent takes its next action. The `evaluate` function from `eve/ai` accepts AI SDK evaluation questions and defaults to `typesafe-ai/jev`. During local development, it can use the Gateway connection selected through `/login`, alongside the agent's language model.\n\nFor tool calls, eve's [automatic approval workflow](https://vercel.com/kb/guide/auto-approve-tool-calls-eve-jev) adds `approval: auto()` from `eve/tools/approval`. Jev reviews the proposed tool name and arguments against `clear` and `caution` criteria. Clear calls run automatically; caution calls pause for a person. Failed reviews also require human approval.\n\nThe guide applies this to shell commands so the policy can distinguish inspecting a file from changing or deleting it. The helper acts on the selected option. If you want a probability threshold as well, write a custom approval policy. Keep the tool's permissions enforced when it executes.\n\nJev can also [select the agent's response model](https://eve.dev/docs/guides/evaluate) through `auto` from `eve/models`. You define the allowed models and describe the work each should handle. eve evaluates recent conversation text before inference, keeps the selection through that turn's tool loop, and selects again on the next turn. This helper has a different import and purpose from the tool-approval helper.\n\nFor evaluation suites, `t.judge(...)` uses the same evaluation implementation to turn written criteria or typed questions into scored assertions. That lets you assess an agent's answers as well as use Jev for decisions during a run. The agent's generative model still writes its replies.\n\n## [Copy link to heading](#6.-use-typesafe's-sdk-or-http-api)6. Use TypeSafe's SDK or HTTP API\n\nUse [TypeSafe's client SDKs](https://docs.typesafe.ai/sdk) when you want typed access without adding an AI application framework. TypeSafe provides Python and JavaScript/TypeScript clients. For another language, its [HTTP evaluation endpoint](https://docs.typesafe.ai/api) accepts a model, shared state, and named questions at `POST https://api.typesafe.ai/v1/systemone`.\n\nExisting TypeSafe clients can also use [Vercel AI Gateway's TypeSafe-compatible API](https://vercel.com/docs/ai-gateway/sdks-and-apis/typesafe). Configure the base URL as `https://ai-gateway.vercel.sh/typesafe` and authenticate with an AI Gateway key or Vercel OIDC token. This path preserves TypeSafe's question and answer naming, including `noul`.\n\nFor a new HTTP integration using Gateway's evaluation format, use [`POST /v1/evaluate`](https://vercel.com/docs/ai-gateway/modalities/evaluation#http-api). That endpoint uses `boolean` and `probability`. Choose the format that matches the code consuming the answers.\n\n## [Copy link to heading](#what-changes-when-you-switch-integrations)What changes when you switch integrations?\n\nKeep the decision criteria explicit when moving between libraries. In the examples above, the invoice text and team descriptions are identical, but the function calls and answer fields differ.\n\nFor a question named `team`, the documented choice-result paths are:\n\nAI SDK keeps [TypeSafe's separate confidence statistic in provider metadata](https://ai-sdk.dev/docs/ai-sdk-core/evaluation#probabilities-and-confidence). Don't substitute a selected category's probability for that statistic when porting a routing rule.\n\nBoolean handling needs attention too. [TanStack AI returns a boolean](https://tanstack.com/ai/latest/docs/evaluate/evaluate#result-shape) [`value`](https://tanstack.com/ai/latest/docs/evaluate/evaluate#result-shape) using a probability cutoff of 0.5, alongside the underlying probability. AI SDK exposes the probability for your code to interpret. Native TypeSafe names that probability `noul`. If your application requires a stricter acceptance rule, preserve it explicitly when changing interfaces.\n\nModel identifiers also belong to the chosen service. The examples use `jev-latest` for direct TypeSafe access, `typesafe-ai/jev` for Vercel AI Gateway, and `typesafe/jev` for Cloudflare. Copy the identifier documented for the path you're using, and rerun your evaluation examples after a change.\n\n## [Copy link to heading](#what-does-an-adapter-leave-to-your-application)What does an adapter leave to your application?\n\nAn adapter connects your code to Jev and maps the response into its library's format. Your application still decides how a result affects the workflow, including what happens when evaluation fails or the answer needs review.\n\nJev [accepts text-based state and returns typed decisions](https://docs.typesafe.ai/concepts/system-one). Connecting it through a library that also supports image or text generation doesn't add those capabilities to Jev. Keep a generative model for writing customer replies.\n\nFor the invoice example, selecting `billing` can assign a queue. Refunding a charge requires a separate action with its own permission and account checks. Test the classification on past tickets before using it to control that action.\n\n## [Copy link to heading](#frequently-asked-questions)Frequently asked questions\n\n### [Copy link to heading](#do-i-need-ai-sdk-to-use-jev-through-vercel-ai-gateway)Do I need AI SDK to use Jev through Vercel AI Gateway?\n\nNo. Vercel AI Gateway supports an HTTP evaluation endpoint and a TypeSafe-compatible API. TanStack AI also provides a Gateway evaluation adapter, so you can use the interface that fits your application.\n\n### [Copy link to heading](#can-tanstack-ai-use-jev-through-cloudflare)Can TanStack AI use Jev through Cloudflare?\n\nYes. TanStack AI's Cloudflare evaluation adapter supports Jev through a Worker AI binding or HTTP credentials. You can keep the same question helpers while configuring the appropriate connection.\n\n### [Copy link to heading](#can-i-keep-the-typesafe-sdk-when-moving-requests-to-vercel-ai-gateway)Can I keep the TypeSafe SDK when moving requests to Vercel AI Gateway?\n\nYes. Vercel AI Gateway offers a TypeSafe-compatible base URL and accepts Gateway authentication. Your client can retain TypeSafe's request and response format, including Noul questions.\n\n### [Copy link to heading](#are-jev's-answer-fields-identical-across-integrations)Are Jev's answer fields identical across integrations?\n\nNo. Libraries map Jev's answers into their own types and property paths. For example, TanStack AI exposes a selected category as `value`, while AI SDK uses `choice`; check probability and confidence fields before reusing application logic.\n\n### [Copy link to heading](#should-i-change-frameworks-to-add-jev)Should I change frameworks to add Jev?\n\nStart with an integration for your existing application. AI SDK, TanStack AI, and LangChain have documented evaluation paths, while TypeSafe's SDKs and HTTP API provide options for applications that don't use those libraries.\n\n### [Copy link to heading](#does-eve-use-jev-to-write-the-agent's-replies)Does eve use Jev to write the agent's replies?\n\nNo. eve uses Jev for typed evaluations, including decisions about response-model selection and tool approvals. The selected language model generates the reply, while Jev can also judge outputs in evaluation suites.\n\n## [Copy link to heading](#next-steps)Next steps\n\n- Follow the [Jev and AI SDK guide](https://vercel.com/kb/guide/typesafe-jev-and-ai-sdk) to combine classification and scoring in a server route.\n- Build a [product-review moderation workflow with TanStack AI and Jev](https://vercel.com/kb/guide/moderate-product-reviews-jev-tanstack-ai) to combine typed questions with a publishing policy.\n- Configure [automatic tool approvals in eve](https://vercel.com/kb/guide/auto-approve-tool-calls-eve-jev) to run routine calls and pause others for human review.\n- Build a [form router with Jev and AI SDK](https://vercel.com/kb/guide/jev-ai-sdk-form-router) to assign submissions to defined destinations.\n- Explore [seven practical Jev use cases](https://vercel.com/i/jev-use-cases) to choose a decision to add to your application.\n- Learn how to [set decision thresholds for Jev](https://vercel.com/i/jev-probabilities-and-thresholds) before automating actions from its answers.", "url": "https://wpnews.pro/news/six-ways-to-integrate-jev-into-your-application", "canonical_source": "https://vercel.com/i/jev-integrations", "published_at": "2026-09-22 09:53:50+00:00", "updated_at": "2026-09-22 10:24:54.043493+00:00", "lang": "en", "topics": ["ai-products", "ai-tools", "ai-agents", "developer-tools", "ai-infrastructure"], "entities": ["Vercel", "Jev", "TypeSafe", "AI SDK", "TanStack AI", "Vercel AI Gateway", "Cloudflare", "LangChain"], "alternates": {"html": "https://wpnews.pro/news/six-ways-to-integrate-jev-into-your-application", "markdown": "https://wpnews.pro/news/six-ways-to-integrate-jev-into-your-application.md", "text": "https://wpnews.pro/news/six-ways-to-integrate-jev-into-your-application.txt", "jsonld": "https://wpnews.pro/news/six-ways-to-integrate-jev-into-your-application.jsonld"}}