On this page
- Same question, different contract
- Where the token math differs
- Latency is a distribution, not a number
- Accuracy and calibration are different questions
- Failure modes are different
- The hybrid pattern that usually wins
- When to switch in either direction
- A decision checklist
- Where AI coding assistants get this wrong
- Checklist
- FAQ
- Related topics
- Sources
Jev vs an LLM Classifier: Cost, Latency, and When to Switch
A practical comparison of a decision model and an LLM classifier: contract, latency, token math, accuracy, calibration, and the hybrid pattern that works.
Quick answer
- An LLM classifier is a generation task with a schema; a decision model is a scoring task over options you define.
- Jev lists $0.042 per million input tokens with output free. A general LLM bills input and output and may need retries when the JSON is malformed.
- At short inputs the per-call difference is small. At high volume, parsing, retries, and p95 latency dominate the bill and the user experience.
- LLMs handle novel semantics and explanations better; decision models are cheaper and more consistent for a fixed branch.
- Measure accuracy, calibration, p95 latency, and cost per 1,000 decisions on your own labeled set before switching.
Same question, different contract
An LLM classifier usually works like this: put the input and a list of labels in a prompt, ask for JSON, parse the output, validate the label, and retry when the model returns prose, a code fence, or a label outside the list. The model is generating an answer in a format you hope it follows. A decision model inverts the contract: you declare the labels, and the model returns a probability for each one. There is no parsing step and no invalid label.
That difference is not just ergonomics. A generation model can explain, compare, and handle a label it has never seen by reasoning about the description. A decision model scores each option against the state and returns a distribution. The decision model is narrower, but the narrowness is what makes the call cheap and the output stable. The right choice depends on whether the branch is a fixed classification or a piece of open-ended reasoning.
Where the token math differs
Jev’s published price is $0.042 per million input tokens, and output tokens are free. An LLM classifier bills both input and output, and the output includes the JSON envelope, the label, and sometimes an explanation. The input also grows when you add few-shot examples to stabilize the format. Those differences are small per call but compound at volume.
Take an illustrative request with 400 input tokens and a 20-token output. At Jev’s rate, the input costs about $0.0000168. At an illustrative general-LLM rate of $0.10 per million input and $0.40 per million output, the same call costs about $0.000048, roughly 2.9 times as much. At 10,000 decisions, that is about $0.17 versus $0.48 before retries. The exact numbers depend on your vendor and prompt, but the arithmetic is the point: model the whole request, not the headline rate.
The gap widens when the LLM needs a longer prompt, a repair retry, or a second call to explain a low-confidence answer. It narrows when the decision is rare, when the LLM call is already needed for another part of the request, or when Jev’s question set requires a long state. A decision model is not automatically cheaper; it is cheaper for the shape of work it was built for.
Illustrative cost per 1,000 decisions
Assume 400 input tokens and 20 output tokens per call.
Jev 400 x $0.042 / 1M = $0.0000168
1,000 calls = $0.0168
General LLM 400 x $0.10 / 1M = $0.0000400
20 x $0.40 / 1M = $0.0000080
total per call = $0.0000480
1,000 calls = $0.0480
Add retries, longer prompts, and explanation tokens
on the LLM side. Add long states and extra questions on
the Jev side. Measure your own average request.Latency is a distribution, not a number
TypeSafe reports 70-500 ms end-to-end latency for Jev, with the range driven by model load, state size, and network path. A general LLM classifier has a wider distribution: time to first token, generation of the JSON, retries, and queueing under load all add variance. The median can look fine while the p95 is several times higher, which is what users experience when the system is busy.
Measure p50, p95, and p99 on your own network path, with your average state and question set. Include the time spent parsing and validating the LLM output, not just the API call. If the decision sits in a user-facing request, set a timeout and a fallback; a slow decision is often worse than a slightly less accurate one. If it runs in a background job, measure throughput rather than single-call latency.
Accuracy and calibration are different questions
On a fixed taxonomy with clear definitions, a decision model can match or beat a general LLM while being cheaper and more consistent. On a novel domain, a nuanced policy, or a label that needs world knowledge, the LLM may be more accurate zero-shot. Neither result is universal. The only useful comparison is a labeled set drawn from your own traffic, with the same state and the same label definitions for both systems.
Calibration matters as much as accuracy. If a system says 0.9, it should be right about 90% of the time on comparable inputs. A slightly less accurate but well-calibrated model is easier to gate, because the confidence threshold means something. Measure calibration by binning predicted probabilities and comparing them with observed accuracy. A model that is confident and wrong is more dangerous than one that knows when to defer.
Decision models return a distribution over your options, which makes calibration visible. An LLM classifier often returns only a label, or a confidence number that is not comparable across prompts. If you need a calibrated probability from an LLM, you have to ask for it, validate it, and measure it; that is extra work the decision model does by design.
Failure modes are different
Jev is literal, weaker on arithmetic and date comparison, and can be distracted by large amounts of irrelevant state. It cannot explain its answer or handle a label that is not in the schema. An LLM classifier can rationalize a wrong label, drift when the prompt changes, return malformed JSON, or invent a label that looks plausible. It can also be better at indirect references and tasks that need several steps of reasoning.
The operational failures differ too. A decision model’s main risks are question design, model-version drift, and an input distribution that no longer matches the evaluation set. An LLM’s risks include prompt injection through the input, format drift, latency spikes, and cost surprises when the prompt grows. Both need logging, a fallback, and a policy that does not grant authority to a probabilistic answer.
The hybrid pattern that usually wins
Use the decision model for the common, bounded branch and reserve the LLM for the cases the decision model is not confident about or for outputs that need language. This is a cascade, not a vote. The first call handles most traffic cheaply; the second call is slower and more expensive, so it should run only when the first result is below the action threshold or when the user explicitly asks for an explanation.
Do not call both on every request and compare. That doubles cost and latency and creates a reconciliation problem when the two disagree. Pick a primary based on the workload, define the escalation condition in code, and log which path handled each decision. Review the escalation rate; if it is high, the question set or the primary model is wrong, not the fallback.
def classify_ticket(ticket: str) -> str:
decision = jev_decision(ticket)
if decision.confidence >= 0.7:
return decision.choice
# The decision model is unsure. Pay for the slower path only here.
return llm_classify(ticket)
def jev_decision(ticket: str):
with TypeSafeClient() as client:
result = client.system_one(
model="jev-1.14.0",
state={"ticket": ticket},
questions={"queue": QUEUE_QUESTION},
)
return result.answers["queue"]
When to switch in either direction
Move from an LLM to a decision model when the branch is a fixed classification, the volume is high enough that per-call cost matters, the LLM needs a long prompt or retries to produce valid JSON, and a labeled set shows the decision model is at least as accurate on the cases that matter. Move from a decision model to an LLM when the taxonomy is open-ended, the input needs multi-step reasoning, the decision model’s low-confidence rate is too high, or users need an explanation that the decision model cannot produce.
Neither move should be all at once. Run the new path in shadow mode on production inputs, compare its answers with the current path, and measure the metrics that matter: accuracy, calibration, p95 latency, cost per 1,000 decisions, and the share of cases that need escalation. Ship behind a feature flag and keep the old path for a rollback.
A decision checklist
Write down the branch, the labels, and the action each label triggers. Estimate the average input size, the number of decisions per month, and the p95 latency budget. Build a labeled set from real inputs, including the ambiguous cases. Measure both systems on the same set, then calculate cost per 1,000 decisions with retries and fallbacks included.
If the decision model wins on the common branch, use it as the primary and keep the LLM for escalations. If the LLM wins because the task needs reasoning or explanation, keep it and use a decision model only for a separate, well-bounded guardrail. The mistake is choosing one tool for every judgment in the app; the efficient design usually uses both, each where its contract fits.
Where this bites vibecoders
A coding assistant will reach for the model it already has in the codebase, wrap the prompt in a JSON schema, and call it a classifier. That works for a prototype, but it hides the real cost: prompt tokens, retries, parsing, and a p95 that grows when the model is busy. If the branch is a fixed label, benchmark a decision model on the same inputs before you scale the prompt.
Where AI coding assistants get this wrong
- Comparing headline token prices without counting output tokens, retries, and prompt overhead.
- Assuming a decision model is always more accurate instead of measuring on labeled inputs.
- Calling both models on every request and reconciling their answers.
- Ignoring p95 latency because the median looks good.
- Using an LLM for a fixed branch and then parsing its JSON on every request.
- Granting an action based on a model answer without a policy check in code.
Checklist
- Write the branch and the action for each label.
- Build a labeled set from real inputs, including ambiguous cases.
- Measure accuracy and calibration for both systems on the same set.
- Measure p95 latency on your network path, including parsing.
- Calculate cost per 1,000 decisions with retries and fallbacks.
- Use a cascade with an explicit confidence threshold, not a vote.
- Log which path handled each decision and review the escalation rate.
- Roll out in shadow mode behind a feature flag with a rollback.
FAQ
Is Jev always cheaper than an LLM classifier?
No. At low volume, the engineering and evaluation cost can dominate the per-call savings. At short inputs, the per-call difference is small. Jev is usually cheaper for high-volume, fixed-label work because output tokens are free and there is no JSON repair loop, but the total cost includes your evaluation and maintenance time.
Which is more accurate?
It depends on the task. A decision model can be more consistent on a fixed taxonomy with clear definitions. An LLM can be better on novel domains, nuanced policies, and tasks that need world knowledge or multi-step reasoning. Compare both on a labeled set from your own traffic rather than relying on a general benchmark.
Can I use Jev for the common case and an LLM for the rest?
Yes. That is the cascade pattern. Use the decision model as the primary, send low-confidence cases to the LLM, and log the escalation rate. Do not call both on every request; that doubles cost and creates a disagreement you have to resolve.
Does Jev return JSON?
It returns typed answer objects keyed by your question IDs, with fields such as choice, score, noul, probabilities, and confidence. The response is structured, but you do not parse a generated JSON string. Your SDK or HTTP client gives you the fields directly.
Can Jev explain its decision?
No. It returns a label, a score, or a probability, not a rationale. If users need an explanation, generate one with an LLM from the state and the decision, or show the probability distribution and the rule that acted on it. Do not ask the decision model to justify itself.
Related topics
- Jev AI: The Complete Guide to TypeSafe’s Decision Model
- Jev Pricing: What a Decision Actually Costs
- Jev Use Cases: 15 Decisions Worth Replacing an LLM Call For
- How to Evaluate a Decision Model Before You Ship It
- How to Write Decision Questions for Jev and Laya
- Jev vs Laya vs Clef: Which Decision Model Should You Use?