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

is-odd-jev

v1.1.0

Published

Check whether a number is odd, using a System One model, with a calibrated probability.

Readme

is-odd-jev

Check whether a number is odd, using a System One model, with a calibrated probability.

npm i is-odd-jev
const isOdd = require('is-odd-jev');

await isOdd(5);
// { odd: true, p: 0.999, ms: 71, output_tokens: 3 }

await isOdd(4);
// { odd: false, p: 0.002, ms: 88, output_tokens: 3 }
npx is-odd-jev 5

Why

is-odd (2014) returns a boolean. It cannot tell you how sure it is.

is-odd-ai (2023) asks an LLM, which returns a string you then parse, and which will happily invent a confidence score if you ask it for one.

is-odd-jev returns p — the model's actual probability that n is odd, computed from the distribution rather than narrated. Jev's Noul primitive has no confidence field, because the probability is the answer. If you need a symmetric certainty:

const { odd, p } = await isOdd(n);
const confidence = Math.abs(p - 0.5) * 2;

Which lets you do the thing you could never do with an LLM:

if (confidence >= 0.95) ship(odd);
else escalateToHuman(n);

Pick that threshold by measuring it on a held-out set, not by intuition.

Setup

Node 18+. Zero dependencies.

| env | default | |---|---| | TYPESAFE_API_KEY | — | | AI_GATEWAY_API_KEY | — (fallback, see below) | | TYPESAFE_BASE_URL | https://api.typesafe.ai | | TYPESAFE_DEFAULT_MODEL | jev-latest |

Without a TypeSafe key

Direct TypeSafe keys are waitlisted. Vercel AI Gateway serves the same model as typesafe-ai/jev with no waitlist, so this works instead:

export AI_GATEWAY_API_KEY=...
npx is-odd-jev 5

TYPESAFE_API_KEY wins if both are set. Two things genuinely differ through the gateway:

  • Probabilities come back rounded, usually to 2dp — you get 0.99, not 0.999.
  • The free tier is rate-limited hard on this model. Fine for one number, not for a loop.

Under the hood the gateway calls a Noul a boolean and its answer probability, and takes the model in a header rather than the body. This package handles that; if you are calling it yourself, experimental_evaluate from ai@7 speaks it natively:

import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state: { n: 5 },
  questions: { odd: { type: 'boolean', instructions: 'Is n odd?' } },
});

What it sends

{
  "model": "jev-latest",
  "state": { "n": 5 },
  "questions": { "odd": { "type": "noul", "instructions": "Is n odd?" } }
}

It cannot chat. It cannot explain itself. It cannot hallucinate. It can only tell you, with a calibrated probability, that five is odd.

Prior art

  • is-odd — depends on is-number. is-even depends on is-odd.
  • is-odd-ai — asks GPT, parses the reply.
  • n % 2 === 1 — still correct, still 0 ms, still free.

MIT