npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ottrix/typesafe

v0.2.0

Published

TypeSafe AI / Jev integration for ottrix — fast typed decisions for evaluation, routing, and guardrails

Readme

@ottrix/typesafe

Part of Ottrix — TypeScript framework for production LLM agents.
Core: ottrix · All packages: docs/README.md

TypeSafe AI / Jev integration for ottrix. Adds fast, typed, probabilistic decisions to your agent — 100ms latency, calibrated confidence, ~300x cheaper than LLM calls for classification tasks.

What is Jev?

Jev is not an LLM. It's a "System One Model" — optimized for making typed decisions inside software. It can't generate text, but it classifies, scores, routes, and evaluates at ~100ms per call with calibrated confidence scores.

Installation

npm install @ottrix/typesafe ottrix @typesafe-ai/sdk

Set your API key:

export TYPESAFE_API_KEY=your_key_here

Use cases

1. Fast self-evaluation (replaces LLM evaluator)

import { createAgent } from 'ottrix';
import { JevEvaluatorStrategy } from '@ottrix/typesafe';

const agent = createAgent({
  provider: 'anthropic',
  systemPrompt: '...',
  evaluation: {
    enabled: true,
    strategy: new JevEvaluatorStrategy(), // ~100ms, ~$0.000004/eval
    maxRefinements: 2,
  },
});

2. Injection protection

import { JevInjectionGuardrail } from '@ottrix/typesafe';

const guard = new JevInjectionGuardrail({ mode: 'block' });
const detection = await guard.checkInput(userMessage);
if (guard.shouldBlock(detection)) {
  return { error: 'Request blocked' };
}

3. Agent routing

import { JevAgentRouter } from '@ottrix/typesafe';

const router = new JevAgentRouter({
  agents: {
    shopping: { description: 'Helps customers find and buy products' },
    support: { description: 'Handles order issues and complaints' },
    returns: { description: 'Processes returns and refunds' },
  },
  defaultAgent: 'support',
});

const agentName = await router.routeSimple(userMessage); // ~100ms

4. Fraud pre-screening

import { JevDecisionMaker } from '@ottrix/typesafe';

const jev = new JevDecisionMaker();
const { score, recommendation, shouldRunFullAgent } = await jev.scoreFraud({
  orderValue: 299.99,
  cardVelocity: 2,
  isFirstOrder: true,
  addressMatch: false,
});

if (!shouldRunFullAgent && recommendation.value === 'approve') {
  // Fast path — skip the full fraud agent
} else {
  // Confidence low or grey zone — run the full fraud agent
}

5. Generic decisions

const jev = new JevDecisionMaker();

// Boolean
const { value, confidence } = await jev.decide({
  state: { text: articleContent },
  question: 'Is this article suitable for a family audience?',
});

// Classification
const category = await jev.classify({
  state: { email: emailContent },
  question: 'What category is this customer email?',
  options: ['billing', 'technical', 'sales', 'other'],
});

// Score
const quality = await jev.scoreOn({
  state: { response: agentResponse, goal: userGoal },
  question: 'How well does this response address the user goal?',
  maxScore: 10,
});

Confidence thresholds

Every decision includes a calibrated confidence score (0-1). Use it to decide whether to act automatically or escalate:

const router = new JevAgentRouter({
  agents: {
    shopping: { description: 'Helps customers find and buy products' },
    support: { description: 'Handles order issues and complaints' },
  },
  defaultAgent: 'support',
  thresholds: {
    autoAct: 0.85, // act without LLM if confidence >= 0.85
    escalate: 0.5, // always escalate to LLM if confidence < 0.50
  },
});

Cost comparison

| Use case | LLM (Claude Haiku) | Jev | Savings | | --------------- | ------------------ | --------------- | ------- | | Self-evaluation | ~$0.003/call | ~$0.000004/call | ~750x | | Injection guard | ~$0.001/call | ~$0.000004/call | ~250x | | Agent routing | ~$0.001/call | ~$0.000004/call | ~250x | | Fraud scoring | ~$0.010/call | ~$0.000006/call | ~1600x |

Exports

| Export | Description | | ----------------------------------- | ----------------------------------------------------- | | JevClient, createJevClient | Typed wrapper around @typesafe-ai/sdk | | JevEvaluatorStrategy | Sufficiency evaluation via Jev | | JevInjectionGuardrail | Injection detection | | JevAgentRouter | Agent routing with a default fallback | | JevDecisionMaker | Fraud scoring, tool acceptance, and generic decisions | | TypeSafeError, mapTypeSafeError | Normalized API errors | | DEFAULT_THRESHOLDS | autoAct 0.85, escalate 0.50 |