Jev directory
CommunityJev Repos & SDKs
TypeSafe Gates
TypeScript library that wraps Jev in typed decision gates for LLM pipelines. Each gate declares its questions, state, interpret function, and a fail-open or fail-closed policy, returning probability tables your own code thresholds.
- Stars
- 0
- Reading time
- 2 min
- Published by
- Community
- Added
- Oct 2026
Highlights
- Gates declare questions, state, an interpret function, and a fail-open or fail-closed policy.
- createJudge sends one request per item, runs 8 concurrently by default, and answers in input order.
- All-or-nothing: if any request fails, the rest abort and the invocation returns unavailable.
- budgetMs aborts in-flight requests and returns over_budget for request-path gates.
- Ships reference gates including relevanceGate, sourceRelevanceGate, candidateGate, and localityGate.
Questions about this entry
Short answers drawn from the linked project or page.
Run npm install typesafe-gates @typesafe-ai/sdk. The SDK is a peer dependency at version 0.6 or later.
Set TYPESAFE_API_KEY, or pass your own client to createJudge. With the key unset the judge returns no_client and never decides what that means for a gate.
questions (SDK builders such as score, choice, and noul), state (the evidence for one item), interpret (a pure function from one answer set to your verdict), and policy (fail-open or fail-closed).
It sends one request per item, concurrently with a default of 8, and returns answers in input order. Items are never batched into one state, because that lets them bleed into each other's judgments.
The behavior is all-or-nothing: the remaining requests are aborted and the whole invocation returns status unavailable, with reason one of no_client, request_failed, over_budget, or aborted.
thresholdFromEnv and probabilityThreshold read a number from an environment variable with a validated fallback. Garbage, out-of-range values, a non-integer where an integer is required, or a probability of exactly 0 all fall back to the default.
recordUsage receives one record per invocation with tokens, request count, estimated cost, task name, model, and a failed flag. It is called even when the invocation failed, and a throwing recorder is logged and swallowed.
Reactions & coverage
Posts, threads, and videos about this entry from around the web.
X: Agent Handoff Gate: agents verify what they hand off
X: Jev as an LLM guardrail inside Agentgateway
X: Vercel's fx safety reviewer, measured at 18× faster
Reddit: Early experiments wiring Jev into Pi as a safety layer and model router.
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.