Try it
Copy the code ↓- Data source
- Decision schema
- Model inference
- Structured result
2 Decision schema 4 typed questions
actionchoicecreatereschedulecancellookupothertargetchoiceappointmentorderaccountunknownurgencyscorewhenevertodaywithin_hourright_nowneeds_clarificationnoulprobability 0–1
3 Model inference typesafe/jev-1.13
Waiting for a run.
4 Structured result
Raw JSON
Run the demo to see the JSON answers, the highlighted pick and the final action.
FLATKEY_API_KEY and run.curl -sS https://router.flatkey.ai/api/alpha/decisions \
-H "Authorization: Bearer $FLATKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"state": "Hey, can you move my 3pm dentist appointment to Thursday morning? If Thursday'\''s full just cancel it. I need to know within the hour.",
"questions": {
"action": {
"type": "choice",
"instructions": "What does the user want the system to do?",
"criteria": {
"create": "Make something new: book, schedule, add or open",
"reschedule": "Move or change something that already exists",
"cancel": "Stop, remove or cancel something that exists",
"lookup": "Get information or status without changing anything",
"other": "None of the above, or not a request"
}
},
"target": {
"type": "choice",
"instructions": "Which resource is the request about?",
"criteria": {
"appointment": "A booking, meeting or calendar slot",
"order": "A purchase, delivery or return",
"account": "Login, profile, plan or payment method",
"unknown": "Not stated or not one of these"
}
},
"urgency": {
"type": "score",
"instructions": "How soon does the user need this handled?",
"criteria": [
"whenever",
"today",
"within_hour",
"right_now"
]
},
"needs_clarification": {
"type": "noul",
"instructions": "The request is ambiguous or contains a condition the handler cannot resolve without asking the user."
}
}
}'// Node.js 18+ (built-in fetch). Run: FLATKEY_API_KEY=... node jev.mjs
const body = {
"model": "typesafe/jev-1.13",
"state": "Hey, can you move my 3pm dentist appointment to Thursday morning? If Thursday's full just cancel it. I need to know within the hour.",
"questions": {
"action": {
"type": "choice",
"instructions": "What does the user want the system to do?",
"criteria": {
"create": "Make something new: book, schedule, add or open",
"reschedule": "Move or change something that already exists",
"cancel": "Stop, remove or cancel something that exists",
"lookup": "Get information or status without changing anything",
"other": "None of the above, or not a request"
}
},
"target": {
"type": "choice",
"instructions": "Which resource is the request about?",
"criteria": {
"appointment": "A booking, meeting or calendar slot",
"order": "A purchase, delivery or return",
"account": "Login, profile, plan or payment method",
"unknown": "Not stated or not one of these"
}
},
"urgency": {
"type": "score",
"instructions": "How soon does the user need this handled?",
"criteria": [
"whenever",
"today",
"within_hour",
"right_now"
]
},
"needs_clarification": {
"type": "noul",
"instructions": "The request is ambiguous or contains a condition the handler cannot resolve without asking the user."
}
}
};
const res = await fetch("https://router.flatkey.ai/api/alpha/decisions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FLATKEY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(`Jev request failed: ${res.status} ${await res.text()}`);
const { answers, usage } = await res.json();
console.log(JSON.stringify(answers, null, 2), usage);# Python 3.8+ (pip install requests). Run: FLATKEY_API_KEY=... python jev.py
import json, os, requests
body = json.loads(r"""{
"model": "typesafe/jev-1.13",
"state": "Hey, can you move my 3pm dentist appointment to Thursday morning? If Thursday's full just cancel it. I need to know within the hour.",
"questions": {
"action": {
"type": "choice",
"instructions": "What does the user want the system to do?",
"criteria": {
"create": "Make something new: book, schedule, add or open",
"reschedule": "Move or change something that already exists",
"cancel": "Stop, remove or cancel something that exists",
"lookup": "Get information or status without changing anything",
"other": "None of the above, or not a request"
}
},
"target": {
"type": "choice",
"instructions": "Which resource is the request about?",
"criteria": {
"appointment": "A booking, meeting or calendar slot",
"order": "A purchase, delivery or return",
"account": "Login, profile, plan or payment method",
"unknown": "Not stated or not one of these"
}
},
"urgency": {
"type": "score",
"instructions": "How soon does the user need this handled?",
"criteria": [
"whenever",
"today",
"within_hour",
"right_now"
]
},
"needs_clarification": {
"type": "noul",
"instructions": "The request is ambiguous or contains a condition the handler cannot resolve without asking the user."
}
}
}""")
res = requests.post(
"https://router.flatkey.ai/api/alpha/decisions",
headers={"Authorization": f"Bearer {os.environ['FLATKEY_API_KEY']}"},
json=body,
timeout=60,
)
res.raise_for_status()
data = res.json()
print(json.dumps(data["answers"], indent=2), data.get("usage"))
No Flatkey key yet? Get one for Jev 1.13 →
About this use case

Who / when
Audience
- backend engineers whose request path waits on an LLM just to parse intent
- assistant and voice-app teams that route requests to deterministic handlers
- platform teams doing admission control and scheduling for AI workloads
Triggers
- every chat or voice request currently starts with an LLM call to figure out what the user wants
- you need to admit, queue or reject requests before spending on a large model
- a handler needs typed fields (action, target, urgency) rather than prose
- latency at the front door matters more than a perfect paraphrase
The workflow
- 01Request stateRaw user text plus session contextInput
- 02Choiceaction and target fieldsJev
- 03Score + NoulUrgency and needs-clarificationJev
- 04Code gateValidate, admit, schedule or fall backYour code
Question shape
{
"action": {
"type": "choice",
"instructions": "What does the user want the system to do?",
"criteria": {
"create": "Make something new: book, schedule, add or open",
"reschedule": "Move or change something that already exists",
"cancel": "Stop, remove or cancel something that exists",
"lookup": "Get information or status without changing anything",
"other": "None of the above, or not a request"
}
},
"target": {
"type": "choice",
"instructions": "Which resource is the request about?",
"criteria": {
"appointment": "A booking, meeting or calendar slot",
"order": "A purchase, delivery or return",
"account": "Login, profile, plan or payment method",
"unknown": "Not stated or not one of these"
}
},
"urgency": {
"type": "score",
"instructions": "How soon does the user need this handled?",
"criteria": [
"whenever",
"today",
"within_hour",
"right_now"
]
},
"needs_clarification": {
"type": "noul",
"instructions": "The request is ambiguous or contains a condition the handler cannot resolve without asking the user."
}
}Gate policy
≥ 0.90
Admit and schedule straight to the matching handler; no LLM on the hot path.
0.65–0.90
Admit, then ask one clarifying question or confirm.
< 0.65
Fall back to the full LLM parser or a human agent.
Failure modes
Pre-launch checks before you trust auto-routing:
- Compound requests ("move it, and if that fails cancel it") that carry two actions;
- Requests that name no resource, or refer to "it" from an earlier turn;
- Urgency words used casually ("ASAP-ish", "no rush but today");
- Prompt injection that tries to pick a privileged action or target;
- Stability when you add a new action or target option;
FAQ
What does "at the edge" mean here?
The first hop that sees a request, before any expensive model runs. Instead of waiting on an LLM to paraphrase what the user wants, one Jev call fills a few typed fields and ordinary code validates, admits and schedules. The large model is only called when the gate falls through.
Is there evidence this is faster or cheaper?
Dark Factor's summary of four production papers (post below) describes exactly this step: four bounded intent fields, then validation, admission and scheduling in ordinary code, reporting latency down 15.9–26.5% and the fee per correct answer down 69–71%. Measure on your own traffic before relying on those figures.
Why not have an LLM return JSON with these fields?
It can, but it generates tokens, may invent values outside your enum and gives you no probability to gate on. Jev can only answer with your options and returns a distribution, so low-confidence requests fall back automatically.
Can I bring my own API key?
Yes. Try the free demo above without signing in. To run it live on your own text, sign in with Google and connect a Flatkey or OpenRouter key (a quick test call runs when you save it). Manage or delete it anytime under Dashboard → BYOK. Keys are stored encrypted on the server, used only for runs you trigger, and never sent back to the browser. Need a Flatkey key? Get one for Jev 1.13 on Flatkey.
Is this the official TypeSafe Jev product page?
No. jev-llm.com is an independent research and practice site. Verify pricing, models and terms at the original TypeSafe sources.
Sources
4 papers just showed how to use Jev in 4 completely different production systems … this is a 7-step blueprint on how to move judgment off the LLM and make any AI system faster, cheaper and easier to audit … step 3 → replace the waiting LLM call at the edge: four bounded intent fields, then validation, admission and scheduling in ordinary code. latency drops 15.9–26.5% and the fee per correct answer drops 69–71%
— @DarkFactorr View the post on X →
Wire this gate with your own key
Bring your own key through Flatkey / OpenRouter. Keep exact checks in code.