How to Use Jev for Support Ticket Routing (Fewer Misroutes)
TL;DR: Ticket routing is a choice question — “which queue does this belong to?” Jev, the System One judgment model from TypeSafe AI, answers it directly with a structured
{answer, confidence, rationale}response. Send low-confidence results (below ~0.85) to a human queue and misroutes drop sharply. This page shows the input/output contract, an architecture sketch, and a minimal end-to-end implementation under 50 lines.
What the routing decision looks like
Define the task narrowly before writing any code:
- Input: the ticket subject plus a truncated body (enough to classify, not the whole thread).
- Task type:
choice— exactly one queue out of a fixed list, e.g.billing,technical,account,other. - Output: a structured response, not prose. Example fixture:
{"answer":"billing","confidence":0.94,"rationale":"Customer reports a duplicate charge and requests a refund."}
The answer field drives the branch, confidence drives automation, and rationale is what your agents read when they pick the ticket up.
Why a judgment model fits
Chat models are optimized for open-ended generation, so routing with them means parsing free text and hoping the format holds. Jev is built for exactly this shape of work.
| Aspect | Chat model | Jev (choice call) |
|---|---|---|
| Output | Free-form text you must parse | Structured answer / confidence / rationale |
| Task framing | Prompt engineering to suppress chatter | Native choice question |
| Automation signal | None by default | confidence for thresholds |
| Explainability | Varies | rationale attached to every decision |
| Failure mode | Off-format replies, rambling | Low-confidence result you can route to a human |
Architecture
Ticket arrives (subject + body)
|
v
Preprocess (truncate, strip PII, join subject + body)
|
v
Jev choice call via OpenRouter (typesafe/jev-1.13)
|
v
Parse structured result {answer, confidence, rationale}
|
+--> confidence >= 0.85 --> auto-route to the chosen queue
|
+--> confidence < 0.85 --> human queue, rationale shown to agent
No functions or frameworks in the diagram on purpose — the whole pipeline is four logical steps plus one threshold branch.
Minimal end-to-end implementation
import os, json, requests
URL = "https://openrouter.ai/api/v1/chat/completions"
# Confirm the exact model slug on the OpenRouter model page.
MODEL = "typesafe/jev-1.13"
QUEUES = ["billing", "technical", "account", "other"]
SYSTEM = ("You are a ticket router. Choose exactly one queue from: "
+ ", ".join(QUEUES) + ".")
def route(subject: str, body: str) -> dict:
resp = requests.post(
URL,
headers={"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"},
json={
"model": MODEL,
"messages": [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": f"Subject: {subject}\n\n{body[:4000]}"},
],
"temperature": 0,
},
timeout=30,
)
resp.raise_for_status()
# example fixture:
# {"answer":"billing","confidence":0.94,"rationale":"..."}
return json.loads(resp.json()["choices"][0]["message"]["content"])
result = route("Refund not received", "I was charged twice this month...")
if result["confidence"] < 0.85 or result["answer"] not in QUEUES:
print("ACTION=human-review", result)
else:
print("ACTION=route queue=", result["answer"], "conf=", result["confidence"])
That is the whole loop: call, parse, branch. Anything the OpenAI-compatible SDK calls (JavaScript, Go, etc.) works the same way — only the HTTP client changes.
Parameters and thresholds
| Setting | Recommendation | Why |
|---|---|---|
| Task type | choice | Routing is a pick-one decision, not a yes/no or a score |
| Auto-route threshold | confidence >= 0.85 | Conservative default; tune against your own misroute samples |
| Low-confidence path | Human queue + rationale | Agents see why the model hesitated |
| Unknown label | Treat as low confidence | Any answer outside your queue list goes to the human queue |
| Body truncation | ~4,000 characters | Enough signal, keeps latency predictable |
For deeper background on the three task types, see the guide on Jev’s three primitives, and for threshold design see confidence and fallback patterns. The case study on email routing across three teams shows this exact setup running in production.
Applies to Jev 1.13.
FAQ
- Why use Jev instead of a chat model for ticket routing? Routing is a choice question, not a conversation. Jev is a System One judgment model built for judgment, choice, and scoring tasks, so it returns a structured answer with confidence instead of free-form text you have to parse.
- What confidence threshold should I use before auto-routing? A practical starting point is 0.85 — auto-route at or above it, send everything below to a human queue with the rationale attached.
- Which model id should I call on OpenRouter? This guide uses
typesafe/jev-1.13onhttps://openrouter.ai/api/v1/chat/completions. Confirm the exact slug on the OpenRouter model page before shipping.