Skip to content

Jev Integrations & Adapters

Decision gates in agent frameworks: what each integration ships

How Pydantic AI, Mastra, TanStack AI, DSPy, Spring AI, and LiteLLM expose Jev: where the typed decision sits in the loop, what each integration returns, and which big frameworks are only adjacent.
Published
Category
Jev Integrations & Adapters
Resources cited
12
Reading time
5 min
Tags#agents#frameworks#integrations#routing

Jev reaches agent frameworks in two shapes: a model you swap in, and a gate wrapped around work that already exists. The integrations differ less in the questions they ask than in where the typed decision-model call sits — a model class, a decorator, an input processor, or a proxy hook — and in what the framework does with the answer: branch, gate, label, or block. Several of the biggest names in the catalog, though, are adjacent to Jev rather than integrated with it.

A model class instead of a chat call

Pydantic AI is the clearest SDK-native path. Its TypeSafeModel turns every field of a Pydantic output type into a typed Jev question; all fields are answered in one request, each carrying its own confidence, read back from provider_details['confidence']. Tools can be offered as Choice options, the model is named typesafe:jev-latest or pinned as jev-1.13.0, and two caps are hard: 255 pick-one options and 10 rubric levels before the API returns a 400. Over-limit questions are refused with a UserError before the request is sent. Because jev-latest moves between releases, a tuned confidence threshold should pin its version — the usual discipline for a model alias.

TanStack AI's TypeSafe adapter is the slimmer version of the same idea: it covers evaluate only, talks to TypeSafe over fetch with no TypeSafe SDK in the stack, and wires jev-latest or a pinned jev-1.13.0 into decide(), where questions are built from choice, score, and boolean helpers. Answers return value, probability, confidence, and meta.usage; the key is read from TYPESAFE_API_KEY, and the decider posts to /v1/systemone. Mastra makes the pattern a first-class primitive: questions typed choice, score, or boolean, all evaluated against the same input, with each criteria key receiving a probability and the highest one becoming the choice a workflow branches on. Install is npm install @mastra/core @ai-sdk/typesafe-ai, and classifiers need @mastra/core 1.69.0 or newer — the feature landed in PR #24458.

Gates that wrap an existing pipeline

DSPy's typesafeify decorates signatures rather than replacing the model: a @typesafeify decorator routes bools, Literals, and configured score fields into a single Jev request while string fields stay with DSPy's LM. On three observed tickets the decorated run averaged 1.958s against 2.329s for plain DSPy — 15.9% faster — and modeled cost fell from $0.000377 to $0.000263 per ticket, a 30.1% reduction. Three tickets is a proof of concept: an MIT-licensed fork stripped down deliberately rather than a replacement for upstream DSPy, and it needs both OpenAI and TypeSafe keys.

Mastra's moderation processor puts the gate in front of the conversation: a one-file input processor screens the last user message with a typed yes/no question plus a log-only category label, in a single request. On one production assistant it blocked 9 of 9 hostile messages and 0 of 49 real ones over 58 Russian-language cases, at a 0.39–0.44 s median; the built-in Mastra processor on gpt-oss-120b took 1.97 s median at roughly four times the price, by the README's own numbers. It fails open by design: a 5-second timeout, an HTTP error, an unparsable answer, or three failures opening a 60-second breaker all let the message through with one log line. It only inspects the last 8,000 characters. LiteLLM pushes the same shape into infrastructure: TypeSafe guardrail hooks wired into the proxy and a Jev complexity classifier routing requests, with classifier settings surfaced in the dashboard. Jev is one optional path among the proxy's many providers and guardrails, and the repository's license reads as unasserted in GitHub metadata.

The JVM path

Spring AI's TypeSafe starter is the most complete survey inside a framework: seven Spring AI SPIs — judge, self-refine advisor, guardrail advisor, document filter, reranker, tool index, and evaluator — with 0.1.0 Maven artifacts auto-configuring a client from spring.ai.typesafe.api-key. The ticket example took a median 275 ms with one question and 310 ms with three, returning 73 output tokens in total, timed from the author's laptop. A live verdict shows the gating pattern: is_plausible FAILED at 0.02, is_grounded PASSED at 0.89, and helpfulness INCONCLUSIVE at 0.83 with 0.44 confidence, below the 0.5 confidence floor. The post is vendor-authored, and its 10x–125x speed and 22x–805x cost figures are TypeSafe's own cookbook benchmark, which the post itself says needs independent validation. The companion documentation site adds JevJudge, JevEvaluator, JevGuardrailAdvisor, document filters, and a confidence gate, but ships snapshot versions at 0.3.0-SNAPSHOT and requires Java 17+, Spring Boot 4.x, and Spring AI 2.0.1+.

Decisions next to tools

Composio wires the adapter from the other direction: alongside 1,000+ pre-authenticated toolkits, it ships @composio/typesafe for TypeScript and composio-typesafe for Python, with sessions scoped per user and session.session_id reused across turns. Passing mcp: true exposes a hosted MCP endpoint at session.mcp.url for any MCP client — the decision model and the tools meet behind one session.

The adjacency tier

Six of the largest entries here — LangChain, LangChain.js, the Vercel AI SDK, Effect, BAML, and Laravel's AI SDK — sit in the catalog through community lists, and nothing the digest reviewed in their documentation names Jev or TypeSafe. What they document is the shape a Jev integration would inherit: LangChain's uv add langchain quickstart and 147,862 GitHub stars, LangChain.js's Node 20/22/24-to-Bun runtime coverage, the Vercel AI SDK's unasserted license, Effect 4.x's three-year LTS window on TypeScript 5.9 or newer, BAML's Apache-2.0 DSL callable from five languages, and the Laravel AI SDK's single interface across OpenAI, Anthropic, and Gemini. The one bridge in the digest runs through an AI gateway: Mastra's competitor-monitor template can reach typesafe-ai/jev with JEV_ACCESS_MODE=vercel-gateway instead of a direct TypeSafe key.

What to weigh

Read maturity before features: snapshot artifacts, a stripped-down fork, an adapter that covers one pathway only, and licenses that are absent (TanStack) or unasserted (LiteLLM, the Vercel AI SDK). Then read what the answer controls — a branch, a blocked message, a confidence floor, a filed verdict. Batching semantics get their own treatment in One Request, Many Questions, threshold design in Confidence Gates in Production, and the routing half of this survey in Routing Models, Tools, and Skills with Jev.

From the Jev directory

The resources behind this article.

20.7kGitHub stars
Python agent framework whose TypeSafeModel class runs Jev as a decision model inside Pydantic AI agents: Pydantic output-type fields become typed Jev questions answered together in one request, each answer carrying its own confidence, and tools can be offered as Choice options.
Jev Integrations & Adapters#community#agents#framework
Mastra's classifier primitive defines choice, score, and boolean questions against an evaluation model such as jev-latest, returning a probability for each criteria key so workflow branch logic can act on the answer.
Jev Integrations & AdaptersArticle#community#typescript#mastra
Community
TanStack AI's TypeSafe adapter covers evaluate only and talks to TypeSafe over fetch, wiring jev-latest into decide() with choice, score, and boolean question helpers and a required TYPESAFE_API_KEY.
Jev Integrations & AdaptersDocs#community#tanstack#typescript
Community
Spring AI Community's TypeSafe starter puts Jev behind seven Spring AI SPIs: judge, self-refine advisor, guardrail advisor, document filter, reranker, tool index, and evaluator.
Jev Integrations & AdaptersArticle#community#java#spring
Community
61.5kGitHub stars
LiteLLM's proxy adds TypeSafe guardrail hooks and a Jev complexity classifier for policy judgments and request routing across 100+ model providers.
Jev Integrations & Adapters#community#python#gateway
A DSPy fork whose @typesafeify decorator routes decision-shaped signature fields to Jev, so bool, Literal, and scored outputs come back typed while freeform fields still use the LM.
Jev Repos & SDKs#community#python#sdk
One-file Mastra input processor that screens the last user message with Jev instead of an LLM verdict: a typed yes/no gate plus a log-only category label, in a single request that fails open behind a circuit breaker.
Jev Agents & MCP#community#jevbest#catalog-import
30.6kGitHub stars
Composio is an MIT-licensed SDK monorepo giving AI agents 1,000+ pre-authenticated toolkits with per-user sessions, authentication, triggers, and a sandbox, and it ships TypeScript and Python adapters including one for TypeSafe (Jev).
Jev Repos & SDKs#community#catalog-import#cobanov
The reference site for the community Spring AI integration: a Java client plus judges, guardrails, RAG filters, and tool search built on Jev.
Jev Repos & SDKsDocs#community#docs#java
An official Mastra template that checks pricing, changelog, and documentation pages against saved captures, has Jev classify each change with its evidence, and routes it to ignore, record, request review, or alert.
Jev Integrations & AdaptersDocs#community#typescript#mastra
Community
148kGitHub stars
LangChain is the agent engineering platform: an MIT-licensed Python framework from the LangChain team for building agents and LLM applications by chaining interoperable components with third-party model, tool, and vector-store integrations.
Jev Repos & SDKs#community#catalog-import#cobanov
27.4kGitHub stars
The AI Toolkit for TypeScript: Vercel's free, open-source AI SDK for building AI-powered applications and agents, with GitHub topics covering OpenAI, Anthropic, Gemini, React, Svelte, Vue, and Next.js.
Jev Repos & SDKs#community#catalog-import#logicrw
Back to all articles

More Jev articles

Tool menus can outgrow the context that reads them. The catalog's Jev-based routers and gates narrow the list: benchmarked tool search, per-tool scoring, fail-closed approvals, and WebMCP in the browser.
Jev Agents & MCP#mcp#tool-routing#agents
Read article
Jev's compaction tools keep or drop tool calls instead of summarizing them — the thresholds they fire at, the savings they report, and why 1.14's opt-in 262k context doesn't settle the choice.
Jev Practices & Patterns#compaction#long-context#coding-agents
Read article

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai