Skip to content

Kody is live

Watch the launch video — what Kody is, and why it exists.

← Public packages

@kentcdodds/jev

Call TypeSafe Jev evaluations via Cloudflare AI Gateway (same token/gateway as @kentcdodds/ai).

  • Integrations
  • jev
  • typesafe
  • evaluation
  • cloudflare
  • ai-gateway
  • noul
  • choice
  • score
Version
1.0.0
License
Published
September 19, 2026
Pinned commit
89fdcda
Rating
No ratings yet
Forks
1
Adaptation effort

@kentcdodds/jev

Intent

Call TypeSafe Jev (typesafe/jev) — a System One evaluation model — through Cloudflare AI Gateway, so other Kody packages can ask typed noul / choice / score questions and get calibrated answers. Reuses the same cloudflareApiToken and account/gateway setup as @kentcdodds/ai when local Jev storage is empty. Success means a tiny evaluate returns { ok, answers } without anyone pasting tokens into chat.

What it does

  • Evaluate shared state against named questions (noul, choice, score)
  • Return parsed answers, model, and usage
  • Escape-hatch raw /ai/run for progressive disclosure
  • Package storage for account/gateway ids, with fallback read from @kentcdodds/ai/settings

Prerequisites / setup

  1. Save user secret cloudflareApiToken (do not paste the value in chat) with Workers AI access and host api.cloudflare.com (optional also gateway.ai.cloudflare.com if you already use @kentcdodds/ai):

    Create / update cloudflareApiToken

  2. Set Cloudflare account id (and optionally gateway id) via this package's ./settings export — stored in package storage, no republish. If you already configured @kentcdodds/ai/settings, leave Jev storage empty: reads fall back to those values. Gateway defaults to kody.

  3. Confirm readiness:

import overview from 'kody:@kentcdodds/jev'

export default async function main() {
  return await overview()
}
  1. Smoke (live, cheap):
import smokeTest from 'kody:@kentcdodds/jev/smoke-test'

export default async function main() {
  return await smokeTest({ live: true })
}

Evaluate example

import evaluate from 'kody:@kentcdodds/jev/evaluate'

export default async function main() {
  return await evaluate({
    state: 'Help! My payouts have been failing for 3 days.',
    questions: {
      is_urgent: {
        type: 'noul',
        instructions: 'Does this convey urgency?',
        criteria: {
          true: 'Explicitly time-sensitive',
          false: 'No urgency expressed',
        },
      },
    },
  })
}

Auth / settings vs @kentcdodds/ai

ConcernShared?Where
SecretYes — same namecloudflareApiToken (user scope)
Account idPrefer one setupJev ./settings → else @kentcdodds/ai/settings
Gateway idPrefer one setupSame fallback chain; default kody
ModelSeparateJev defaults to typesafe/jev

Do not invent a second Cloudflare token secret for this package.

Alternate: Vercel AI Gateway

Vercel also exposes typesafe-ai/jev via AI SDK 7 experimental_evaluate. This package implements the Cloudflare path first to match @kentcdodds/ai. Prefer Cloudflare unless you already standardize on Vercel.

Docs: Cloudflare Jev · TypeSafe · Package

Done when

  • cloudflareApiToken is saved with api.cloudflare.com host approval
  • Account (and optional gateway) resolve via ./settings or @kentcdodds/ai
  • ./smoke-test with { live: true } returns ok: true and a noul answer
Report this listing

Log in to report this listing.