cd /news/ai-products/is-odd-jev-check-if-a-number-is-odd-… · home topics ai-products article
[ARTICLE · art-133161] src=github.com ↗ pub= topic=ai-products verified=true sentiment=· neutral

Is-odd-jev – check if a number is odd, with a calibrated probability

Developer alxcrt published is-odd-jev, an npm package that determines whether a number is odd using the TypeSafe "jev-latest" model and returns a calibrated probability rather than a boolean, e.g. { odd: true, p: 0.999, ms: 71, output_tokens: 3 } for 5 and { odd: false, p: 0.002 } for 4. The package requires Node 18+, has zero dependencies, and can be called either with a waitlisted direct TYPESAFE_API_KEY or through the Vercel AI Gateway as typesafe-ai/jev, where probabilities come back rounded to about 2 decimal places and the free tier is rate-limited. Releases publish automatically from GitHub Actions via npm trusted publishing, requiring npm >= 11.5.1 for OIDC.

read3 min views3 publishedSep 17, 2026
Is-odd-jev – check if a number is odd, with a calibrated probability
Image: Michielbdejong (auto-discovered)

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

npm i is-odd-jev
js
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

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.

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

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 get0.99 , not0.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?' } },
});
{
  "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.

Releases publish themselves from GitHub Actions via npm trusted publishing: the workflow swaps its OIDC token for publish rights, so there is no npm token in the repo, no secret to rotate, and no OTP prompt.

npm version patch && git push --follow-tags
gh release create v1.1.1 --generate-notes

Publishing the release fires .github/workflows/publish.yml, which runs the tests and then npm publish. The workflow upgrades npm first — OIDC needs npm >= 11.5.1 and the runner image ships something older, which is the kind of thing that fails once and confuses you for an hour.

One-time setup, on npmjs.com: the package → Settings → Trusted Publisher → GitHub Actions, repo alxcrt/is-odd-jev, workflow publish.yml.

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

MIT

── more in #ai-products 4 stories · sorted by recency
── more on @is-odd-jev 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/is-odd-jev-check-if-…] indexed:0 read:3min 2026-09-17 ·