Skip to content

decision-gate

npm library that rate-limits, spend-caps, caches and redacts every Jev request made in a loop.

Librarybeta

Overview

decision-gate is the single place code sends Jev requests through when asking many similar questions at volume, such as a go/no-go on every new job posting for each of fifty students. It waits for room under 80% of the account's rate limits, pauses every caller sharing the account across processes for the server's Retry-After delay on a 429, refuses requests that would exceed a per-key daily spend ceiling, and records what each call cost.

An opt-in cache stores answer probabilities under caller-chosen keys, scoped to the exact question wording, so repeated questions over the same state are not paid for twice. A redactor replaces emails, known secret formats and credentials before anything is sent or cached. It uses TypeSafe's own SDK, never calls a generative model, and never stores request text. It is pre-1.0 (0.2.0) and unofficial.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes this posting fit the student's skills and goals?yes · no
Yes / noCan the student apply, given the location and their graduation date?yes · no

How it works

  1. Open a gated Jev client for a tool
  2. Redact state and check the cache
  3. Wait for rate-limit room and check spend ceilings
  4. Send via the TypeSafe SDK and record cost; cache the answer

Strengths

  • Prevents 429 storms across processes
  • Hard daily and per-run spend ceilings
  • Answer cache avoids paying twice
  • Redaction before send

Caveats

  • Pre-1.0 interface
  • Unofficial, not affiliated with TypeSafe

Getting started

npm install decision-gate, export TYPESAFE_API_KEY, then import { openJev } from "decision-gate".

At a glance

Type
Library
Status
beta
Language
JavaScript
Runtime
Node library
Has code
yes

Use cases and integrations

How curated lists describe it

  • Cost and rate control: npm library that every Jev request in a loop goes through, which waits for room under 80% of the account's requests-per-minute and tokens-per-second limits, pauses every caller sharing the account, across processes, for the server's `Retry-After` delay when the service answers 429, refuses any request that would pass a per-key daily spend ceiling (USD 0.20 by default), and keeps an opt-in cache of answer probabilities under caller-chosen keys, so a repeated question over the same state is not paid for twice.

    yibie/awesome-jev

Frequently asked questions

What problem does it solve?

Rate-limit failures, duplicate spending and runaway costs when calling Jev in loops.

What is the default spend ceiling?

The list summary cites USD 0.20 per key per day; per run defaults to USD 0.02 in the README example.

Does it store my data?

It caches answer probabilities under keys you choose but never stores request text.

Related projects

  • Hack Club's lightweight LLM proxy, listed for adding a Jev forwarding endpoint behind its auth, limits and usage logging.

    MCP serverproductionTypeScript
  • Go gateway that pools multiple TypeSafe accounts behind the native System One API with user keys, quotas and failover.

    ServicebetaGo
  • Rust CLI for Jev that lints typed question sets offline, then sends them and prints probabilities, labels and scores as JSON.

    CLIbetaRust
  • Offline TypeScript token counter and request-cost estimator for Jev 1.13, a port of the reconstructed jevtok encoder.

    PluginbetaTypeScript
  • Task plugin for the new-api LLM gateway that adds a native /v1/systemone endpoint for Jev with auth, routing and token billing.

    PluginbetaJavaScript
  • Chinese-documented LLM gateway with virtual model routing, protocol conversion and a transparent Jev System One proxy.

    ServicebetaTypeScript