TL;DR
We built a new document classification prototype using Imajev-4B, an open-source Jev-style decision model, on a single DGX Spark (GB10) against Grooper’s LLM classification using Qwen3.8-27B on two H200s, across 258 healthcare documents. At a 20% confidence score threshold it classified 241 and disagreed with Qwen on only 5, but it finished 10-20% slower. It also couldn’t flag multi-document files, because a Choice question assumes there’s one right answer.
Key takeaways:
- At the default 60% confidence score threshold, only 129 of 258 documents classified, even though many rejected top picks were correct.
- At 20% confidence score threshold, Imajev classified 241 documents and disagreed with the Qwen3.8-27B model on just 5 toss-ups.
- The H200 rig won on speed (8m 46s vs. 11m 30s), but the Spark has a tiny fraction of the raw power of an H200 and proved that it could handle some moderate production workloads.
- Structural judgments like “is this more than one document?” need their own question, not an added instruction.
When TypeSafe released Jev, we wanted to know how it could make decisions at such low latency, and whether that approach would work for document processing. Within days, Hugging Face and GitHub filled up with open-source Jev alternatives. I picked one, Imajev-4B, put it on a DGX Spark, and built a custom Grooper classification method around it. Then I ran it head to head against Grooper’s native LLM classification using Qwen3.8-27B on two H200 GPUs.
The short version: on the documents it chose to classify, the 4B decision model agreed with the 27B model about 98% of the time, and it ran on far cheaper hardware. It was not faster, and it failed in one specific, informative way. This article covers what we built, what we measured, and what we’d tell anyone trying to apply Jev-style models to document classification.
What is a Jev-style decision model?
A Jev-style decision model takes evidence (the “state”) plus a typed question, and returns a probability for each allowed answer instead of generating text. It can’t write prose, so it can’t produce a malformed answer. It can still pick the wrong one, but it tells you how sure it is.
TypeSafe AI released Jev on September 15, 2026 as what it calls the first “System One model,” a model that answers typed questions about text or JSON and returns only structured values. It has three question types: Choice picks one option and returns a probability for every option, Score places the input on a scale, and Noul returns the probability that a yes/no question is true. TypeSafe reports 70 to 500 ms latency and $0.042 per million input tokens with free output, though these figures are self-reported and haven’t been independently reproduced.
There are two reasons we didn’t use Jev itself. First, access is hosted and waitlisted, with no open weights and no on-premises option. For regulated document collections, sending content to a third-party endpoint is often a non-starter. Second, Jev is text-only, and document processing eventually means images.
Imajev addresses both. (Big shoutout to Mohit Garg for his work here). The 4B model is a LoRA adapter on Qwen3.5-4B with a decision readout, and it uses Jev’s request/response contract (POST /v1/systemone) with images, an unknown_probability, and an abstained signal added. It ran comfortably on a DGX Spark, with plenty of memory left on the box for separate embedding and reranker models served via in vLLM.
Why document classification is a decision problem
Classification shouldn’t need LLM-style language generation. The question is: given this evidence, which of these N labels fits? Asking a generative model to write an answer with “structured output” and then parsing a type name out of it adds failure modes that have nothing to do with the judgment itself. In production, we’ve seen malformed replies that force a secondary attempt, null-input exceptions, and provider timeouts with LLM-based classification.
A decision model also gives you something an LLM classifier usually doesn’t: a calibrated probability for every candidate type, plus an explicit “can’t tell.” That’s exactly what a threshold-based workflow needs.
How we built a prototype in Grooper
We built a custom classification method, ImajevClassifier, that extends the same base class Grooper’s native LLM classifier uses. It runs inside the stock Classify activity. There are no pipeline changes; the Content Model just gets a different provider.
For each document, the method sends the OCR text as state and asks one Choice question, with the in-scope document types as options. The returned distribution becomes Grooper similarity scores. By default it uses what we call Calibrated Product scoring:
similarity = p_option x (1 - unknown_probability)
This pulls every score down when the model thinks the document is outside what it knows. A Raw Probability mode (similarity = p_option) is available for A/B testing. If the model abstains, every candidate scores zero and the document goes to the normal not-classified path.
The method never assigns a type itself. Grooper’s standard Min Similarity and Min Difference thresholds make the final call, the same as for any other classification method. Model judgment and workflow policy stay cleanly separated. There are two modes:
- Single-pass asks one Choice question over all eligible document types.
- Cascade first asks which content category the document belongs to, then asks a second Choice question limited to the document types under the winning categories. This is for large type sets. Jev itself supports up to 255 options per choice and uses a slower two-stage approach above that, but smaller option sets generally score better, so narrowing helps well before you hit the cap.
The test
- Corpus: 258 real-world healthcare records documents prepared for a regulatory audit, totaling 5,191 pages.
- Content model: 50 document types nested under 7 categories.
- Scope: classification looked at the first 30 pages of each document; anything beyond that was truncated before reaching either engine.
- Imajev-4B: one DGX Spark.
- Baseline: Grooper’s native LLM classification with Qwen3.8-27B on two H200 GPUs.
Results
Speed
| Configuration | Hardware | Batch Wall Time |
|---|---|---|
| Imajev-4B, single-pass | 1x DGX Spark (GB10) | 11m 30s |
| Imajev-4B, cascade | 1x DGX Spark (GB10) | 11m 57s |
| Qwen3.8-27B | 2x H200 | 8m 46s* |
The H200 rig won by about 2m 44s. That works out to roughly 2.7 seconds per document for Imajev versus about 2.0 for Qwen. Our Imajev deployment served requests one at a time, while vLLM on the H200s was batching across many requests, so the gap is a concurrency difference as much as a model difference. The more relevant comparison is that a desk-side box costing a small fraction of two H200s came within a few minutes on a full batch.
On the cascade number: with 50 types and our option cap set to 60, every type fit in a single question, so the cascade had little reason to engage. Don’t read the extra 27 seconds as the cost of a category pass. We’ll test the cascade properly with a tighter option cap.
*Note, with a few additional test rounds on the same document set, the Qwen wall time varied. The 8m 46s time was the shortest of the runs, other runs were in the low-11m range.
Accuracy and thresholds
At the default 60% minimum confidence score, Imajev classified 129 of 258 documents and left the rest unclassified. When I looked at the rejected ones, the top candidate was often still the correct type. The model was right, just modestly confident. That’s expected. A calibrated distribution spread across 50 options, several of them close siblings, rarely puts 60% on one answer, and Calibrated Product scoring lowers it further.
At 20% minimum confidence score, a deliberately loose setting for the experiment, Imajev classified 241 of 258. Only 5 of those 241 decisions disagreed with Qwen’s choice. On those 5, I could easily argue a case either way. Even a human reviewer would find them toss-ups.
Two caveats. Agreement with Qwen isn’t accuracy, since Qwen isn’t ground truth. Also, 20% isn’t a production recommendation. The right threshold comes from a coverage-versus-precision curve on labeled documents, and thresholds should be set from labeled examples of your actual workload, since different decisions carry different error costs. And even for this collection, we’d likely want to run more testing as part of these experiments.
What the decision model gives you here is the probability trail. A document scoring 52% for one type and 35% for a related type is telling you it sits between the two. The LLM baseline never surfaces that.
Where it broke: multi-document files
Some of the “documents” in this corpus were actually several documents combined into one file being classified, so really a packet of documents. This is a common classification situations in the world of unstructured document processing that we know all too well. Both classifiers were instructed to detect that scenario and choose a special type, Not Defined – Multi Document Detected.
Qwen followed the instruction well. Imajev didn’t, even with the same instruction in its question. It scored more than one real document type highly, because the content of each embedded document was a strong match for its own type.
I don’t think this is a prompt-tuning problem. A Choice question asks “which one of these is it?” over mutually exclusive options. A file containing an encounter note and an explanation of benefits genuinely matches both, so splitting probability between them is an honest answer to the question that was asked. The multi-document option is a different kind of label from the other 49. It describes the file’s structure, not its content, and nothing in the text resembles “multi.” A generative model can reason its way to a meta-label because instructions steer what it writes. A calibrated decision model’s distribution is driven by evidence, and instructions move it much less.
The lesson is to ask one question per judgment. “What type is this?” and “Is this more than one document?” are two separate decisions, and a decision model should get them as two questions. Conveniently, questions in a single call are evaluated against one shared read of the state, so adding another question costs tokens but little extra time.
Advice for applying Jev-style models to document processing
Don’t inherit default thresholds. A 60% floor that makes sense for an LLM classifier or a rules-based method can throw away half of a decision model’s correct answers. Sweep thresholds against labeled data before judging accuracy.
Keep option sets small. Probability spreads across options, so 50 candidates means lower top scores than 10. Category-first narrowing helps if your content model has well-separated categories.
Keep the model out of policy decisions. Let the model report probabilities and let the workflow decide what’s confident enough. Changing the threshold shouldn’t mean changing the model.
Use calibration files. Imajev’s own model card notes it’s over-confident without its calibration file, and it’s English only. Check this for whichever open model you pick.
Ask structural questions separately. Anything about the file rather than its content (multiple documents, blank pages, wrong orientation) belongs in its own Noul or Score question, not in the instructions for a Choice question.
Remember that a valid answer can still be wrong. Constraining outputs eliminates malformed answers, not mistaken judgments. Keep a review path for low-confidence results.
What’s next
In the next experiment, I’m adding multi-document detection logic to the classifier and measuring it against Qwen’s instruction-following baseline. Candidates include a dedicated yes/no question in the same request, using the distribution’s shape as a signal (two strong candidates from different categories versus two from the same one), and comparing decisions across page windows. Part 2 will cover what worked, what it cost in latency, and how close it gets to the 27B model. We are also working on some data extraction experiments relying on this model for decisioning. Stay tuned.
Frequently Asked Questions (FAQ)
Can Jev be used for document classification?
Yes. Document classification maps directly to Jev’s Choice question: OCR text goes in as state, document types are the options, and the model returns a probability for each. In our test, a Jev-style 4B model agreed with a 27B LLM on about 98% of the documents it classified. It struggled with structural judgments like detecting multiple documents in one file.
What are open-source alternatives to Jev?
Several open models copy Jev’s typed-decision interface. DataCamp’s roundup covers Laya, Nimble, Kev, SemIf, Rizzo Flow, Von, and NanoJev, and Imajev adds image input on top of a Qwen base. They take different approaches: some use small bidirectional models, some adapt Qwen with specialized decision heads, and others read probabilities directly from existing language models.
Can you run a Jev-style model on-premises?
Jev itself can’t be self-hosted: it runs only on TypeSafe’s infrastructure, with no open weights. Open alternatives like Imajev can run on local hardware. We ran Imajev-4B on a single DGX Spark with room left for embedding and reranker models, which keeps regulated document content inside your own environment.
How should I set a confidence threshold for a Jev-style classifier?
Use labeled documents from your real workload and measure coverage against precision at several thresholds. Don’t reuse defaults built for other methods. In our test, a 60% floor classified only 129 of 258 documents even though many rejected top picks were correct, because probability spreads across many similar document types.
Why can’t a Jev-style model detect multiple documents in one file?
A Choice question assumes one correct answer. A multi-document file honestly matches several types, so the model splits probability among them instead of choosing a “multiple documents” label. That label describes structure, not content, so evidence-driven scoring rarely selects it. Asking a separate yes/no question about multiple documents is the better design.
References
Huggingface: imajev-4b model
https://huggingface.co/mohit67890/imajev-4b
What is Jev? A Guide to TypeSafe AI’s System One Model
https://developer.tenten.co/what-is-jev-a-guide-to-typesafe-ai-s-system-one-model
Introducing System One Models & Jev
https://typesafe.ai/blog/introducing-system-one-models-and-jev