Skip to content

jev-decision-gateway

Gateway that batches agent control questions through Jev and calls a generative LLM only when policy says generation is needed.

ServiceprototypeMIT

Overview

jev-decision-gateway sits in front of expensive generative models. Application and agent code send the small, bounded questions Jev handles well (which tool next, should the agent continue, does the output pass verification, which model tier) and a deterministic policy layer turns Jev's typed, confidence-scored answers into an execution plan. A real LLM is invoked only for the step that needs text.

The README contrasts a loop that makes four LLM calls per iteration, three of them for decisions, with one gateway.evaluate() call returning nextTool, shouldContinue, verifyOutput and modelTier, followed by a single generation call at the chosen tier. A flagship example (an agent runtime optimiser) and a benchmark scenario implement this shape. It uses the @typesafe-ai/sdk package.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich tool should the agent use next?—
Yes / noShould the agent keep going?—
Yes / noDoes this output pass verification?—
ChoiceWhich model tier should generate the final answer?—

How it works

  1. Agent loop calls gateway.evaluate() with current state
  2. Jev answers next tool, continue, verify and model tier in one call
  3. Policy layer converts answers and confidences into a plan
  4. Invoke the LLM once at the selected tier when generation is needed

Strengths

  • Replaces several decision-only LLM calls with one Jev call
  • No parsing of free text into enums
  • Deterministic policy keeps control of actions

Caveats

  • Benchmark scenario results not summarised in the excerpt
  • Requires a TypeSafe key plus an LLM provider

Getting started

See 'Run the flagship example and benchmark' in the README (examples/agent-runtime-optimizer and benchmark/ai-agent-scenario).

At a glance

Type
Service
Status
prototype
Language
TypeScript
Runtime
Node service
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • A gateway that asks Jev continue / tool / verify questions and invokes a generative LLM only when policy says generation is needed.

    logicrw/awesome-jev-projects

Frequently asked questions

What does Jev decide?

Next tool, whether to continue, whether output passes, and which model tier should generate.

How does it save cost?

Decision questions go to Jev in one batched call; the LLM runs only when text generation is needed.

Who owns the final action?

A deterministic policy layer converts Jev's answers into the execution plan.

Related projects

  • OpenCode orchestrator that keeps a cheap sticky parent model and escalates to strong child subagents only when Jev flags a hard turn.

    ProjectbetaTypeScript
  • Adaptive thinking-level router for Pi: Jev or local rules pick low/medium/high/xhigh at task start, on reasoning failures and when stable.

    ProjectbetaTypeScript
  • Runs Claude Code on Opus 5.5 with Jev re-picking reasoning effort after every tool batch, via per-message effort so the cache survives.

    ProxybetaTypeScript
  • Local-first routing engine for long-running agent tasks that uses a Jev decider to pick a model group per turn.

    PluginproductionRust, TypeScript
  • Open-source AI gateway for 100+ LLMs that can use Jev to classify requests for complexity routing and to compact tool results.

    ProxyproductionPython
  • Open-source workspace for running and reviewing AI coding agents across devices, with an optional Jev-based automatic model router.

    ProjectproductionTypeScript