Jev on Cloudflare
Unlike platforms where Jev is only reachable over plain HTTP, Cloudflare exposes it as a native partner model on Workers AI. Call env.AI.run('typesafe/jev', …) from a Worker and you get a typed answer — one of your options, a probability, a confidence — in a single parallel pass. No waitlist, no separate SDK, and the decision happens at the edge, right where your request already is.
Jev is TypeSafe AI's System One decision model: it reads state plus a set of typed questions and returns typed values with calibrated confidence in roughly 70–500ms, never free text. On Cloudflare that shape maps straight onto the Workers AI run() call, so a Worker can decide — route a ticket, gate a tool call, score a signup — inline in the same request it's already handling, without a round trip to a distant API.
Is Jev on Cloudflare Workers AI?
- Yes — as a partner model with the id typesafe/jev, called through the standard Workers AI binding (env.AI.run).
- No waitlist on Cloudflare: while the direct typesafe.ai API has sat behind a waitlist, Workers AI (and the Vercel AI Gateway) expose Jev without one.
- It's a third-party model Cloudflare hosts access to — not a model Cloudflare built or trained. The weights and calibration are TypeSafe's.
- Same primitives as everywhere else: choice (pick one of your options), score (a ranked number), and noul (a calibrated yes/no).
Call Jev from a Worker
Bind Workers AI in your wrangler config, then call the model by id. There's no SDK to install — env.AI is already there.
# wrangler.toml — bind Workers AI into your Worker
[ai]
binding = "AI" # exposes env.AI.run(...)// src/index.js — decide which queue a ticket goes to, at the edge
export default {
async fetch(request, env) {
const ticket = await request.text();
const response = await env.AI.run('typesafe/jev', {
state: ticket,
questions: {
queue: {
type: 'choice',
instructions: 'Which queue should this ticket go to?',
criteria: {
billing: 'payments, refunds, invoices',
technical: 'bugs, errors, how-to',
abuse: 'spam, fraud, policy violations',
sales: 'pricing, upgrades, new purchases',
},
},
},
});
// response.answers.queue.choice is locked to one of your four keys,
// with a calibrated confidence you can threshold for a safe fallback.
return Response.json(response);
},
};The answer for each question comes back as one of the criteria keys you defined — never a made-up label — plus a confidence value. Threshold on that confidence to fall back to a safe default when Jev isn't sure, and pin a model version so the number stays stable as models update. The whole decision is sub-cent and runs in ~70–500ms, cheap enough to put in front of every request.
Two ways to reach Jev on Cloudflare
The Workers AI binding is the zero-setup path and bills through your Cloudflare Workers AI usage like any other partner model. If you'd rather keep decisions on your own TypeSafe account — or you're calling from outside Workers AI — any Worker can also POST the hosted endpoint directly with a jv_live_ key, and you can put a Cloudflare AI Gateway in front of that call for caching, rate-limiting and analytics.
| Workers AI binding | fetch + jv_live_ (optionally via AI Gateway) | |
|---|---|---|
| How | env.AI.run('typesafe/jev', …) | fetch('https://jevtypesafeai.com/api/v1/decide', …) |
| Setup | Just the [ai] binding | A jv_live_ key in a secret |
| Billed to | Your Workers AI usage | Your TypeSafe / Jev account |
| Caching & analytics | Workers AI defaults | Add an AI Gateway in front |
// Any Worker, no Workers AI binding — call the hosted API directly.
// Put a Cloudflare AI Gateway in front of this URL to cache + observe it.
const r = await fetch('https://jevtypesafeai.com/api/v1/decide', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${env.JEV_API_KEY}`, // jv_live_... stored as a secret
},
body: JSON.stringify({ state: ticket, questions: { /* same shape as above */ } }),
});
const { answers } = await r.json();
const queue = answers.queue.choice; // one of your criteria keys
const conf = answers.queue.confidence; // threshold thisA cacheable decision API at the edge
Decisions are often repeated — the same spammy comment, the same routing question — so caching them at the edge is a real win. A good community example is jev-worker: a Worker that exposes Jev as a small HTTP decision API, validates requests and model responses, routes answers by confidence, and caches successful inference in Workers KV, with a few editable presets (form-spam, comment moderation, lead quality, support routing). It's an independent, MIT-licensed project — not TypeSafe and not us — but it's a clean blueprint for a cached edge decision service.
Why decide at the edge
| Call a frontier LLM | Jev on Workers AI | |
|---|---|---|
| Job | Generate text / reason | Pick one option, score, or judge |
| Output | Tokens to parse | One typed value + confidence |
| Where | A distant API round trip | At the edge, in-request |
| Latency | The model's (often seconds) | ~70–500ms |
| Reliability | May drift / hallucinate | 0% structured-output error |
| Cost per step | Frontier-model tokens | Under a cent per decision |
Sources
- Cloudflare docs — typesafe/jev on Workers AI — Official model page: the typesafe/jev id, the env.AI.run binding, and the Noul / Choice / Score question types.
- Cloudflare AI Gateway — Put caching, rate-limiting and analytics in front of a direct Jev fetch.
- jev-worker (community, MIT) — A Worker that exposes Jev as a cacheable HTTP decision API, routing by confidence with KV caching. Not official TypeSafe.
- TypeSafe AI — introducing System One models & Jev — What Jev is and why its request shape is a typed decision, not a chat completion.
FAQ
Is Jev available on Cloudflare Workers AI?
Yes. Jev is a partner model on Workers AI with the id typesafe/jev — you call it with the standard env.AI.run() binding, no waitlist. It's a third-party model Cloudflare hosts access to, not one Cloudflare built; the weights and calibration are TypeSafe's.
How do I call Jev from a Cloudflare Worker?
Add an [ai] binding in wrangler.toml, then call env.AI.run('typesafe/jev', { state, questions }). Each question comes back as one typed answer — a choice, score, or noul — plus a calibrated confidence. No SDK to install; env.AI is already available in the Worker.
Do I need a TypeSafe (jv_live_) API key to use Jev on Cloudflare?
Not for the Workers AI binding — that bills through your Cloudflare Workers AI usage. You only need a jv_live_ key if you call the hosted TypeSafe endpoint directly with fetch (for example to keep billing on your own TypeSafe account, or from outside Workers AI).
Can I cache Jev decisions on Cloudflare?
Yes. Repeated decisions cache well: you can store successful results in Workers KV yourself (the community jev-worker does exactly this), or put a Cloudflare AI Gateway in front of a direct fetch to add caching, rate-limiting and analytics.
What does a Jev decision cost on Cloudflare?
A single decision is well under a cent and runs in ~70–500ms. The Workers AI binding bills through your Cloudflare usage; a direct fetch bills to your TypeSafe account, where we charge per input token on a sliding scale (larger top-ups are cheaper) with output free. Exact numbers live on the pricing page.
See also: Cloudflare docs: typesafe/jev · Jev on AWS Bedrock · Jev over MCP · How to use the Jev API · Pricing
Put a typed decision at the edge
Call typesafe/jev from a Worker, or grab a jv_live_ key and POST the hosted endpoint from anywhere. One sub-cent call, one calibrated answer back.