MedJev
On-prem clinical note extraction: local noul, choice, and score variables on one GPU, built on Jared Palmer kev with Augmented Clinical Notes training data.
Overview
MedJev (github.com/JunMa11/MedJev) is Jun Ma's open Python project for ultra-fast clinical variable extraction from free-text notes. It fine-tunes Qwen3.5-0.8B-Base with LoRA and a pointer head adapted from Jared Palmer's kev decision architecture (github.com/jaredpalmer/kev). Training data ships at data/medjev-v1 from the Augmented Clinical Notes corpus on Hugging Face, with underlying notes traced to PMC-Patients. README advertises thousands of notes per hour on one consumer GPU with no per-use API fee when serving locally.
Problem: Clinical research pipelines still paste free-text notes into general chat models and manually transcribe answers into registries, which leaks PHI and yields inconsistent field wording.
Built for: Hospital and research engineers who need on-prem extraction of typed clinical variables with calibrated confidences on a single GPU.
First indexed on Jev Directory: 2026-10-04
Creator and team
- Name
- Jun Ma
- Handle
- @JunMa11
How Jev is used
- Role in the product flow
- Local System One-compatible noul, choice, and score heads over encoded clinical note state with one forward pass per question branch
- Primitives
- ChoiceScoreNoul
- State in
- Clinical note text materialized into kev-style records with per-field instructions and criteria (see medjev.records.materialize).
- Decision out
- Probability vectors per question: binaries as noul, enums as choice, ordered levels as score, with serving latency reported in evaluate JSON.
- Train with python -m medjev.train on Augmented Clinical Notes splits
- Select checkpoints on development; test split requires --allow-test
- Serve with load() and probs_and_prefix so state encodes once per record
- Optional serve_compare UI contrasts base Qwen, hosted Jev replays, and MedJev checkpoint
MedJev is a domain fine-tune, not a hosted gate you paste into agents. It inherits kev's question isolation and System One request format so each clinical field is a typed branch reading a shared encoded note state. That keeps answers inside clinician-defined option sets with explicit confidences for triage to human review. Hosted TypeSafe Jev appears only as an optional baseline replay in serve_compare (answers loaded from data/results/jev JSONL, not re-purchased per click). Contrast jaredpalmer-kev for general open weights, classifier.dev for HTTP zero-shot labels, or docjev for document splitting. Cite github.com/JunMa11/MedJev, github.com/jaredpalmer/kev, the Augmented Clinical Notes dataset, and the PMC-Patients paper linked in README acknowledgements.
Sourced performance claims
- README dataset counts: 23,719 train, 2,997 development, and 2,895 test records in data/medjev-v1 from Augmented Clinical Notes.Source: github.com/JunMa11/MedJev README Training
- medjev.evaluate reports micro accuracy, macro-F1, Brier, ECE, score level error, majority-class floors, and latency_ms_per_record on the serving path.Source: github.com/JunMa11/MedJev README Evaluation
- Public GitHub repo JunMa11/MedJev had about 111 stars when this listing was drafted.Source: GitHub star count October 2026
Features and stack
Features
- Train, evaluate, compare, bench_runtime, and serve_compare modules
- 11 default question specs in medjev.labels.QUESTIONS or custom schemas
- Single-GPU recipe with bf16 and gradient checkpointing documented
- Optional TYPESAFE_API_KEY for hosted Jev baseline experiments only
- On-prem inference: patient text stays on your hardware per README positioning
Stack
- Python 3.12
- PyTorch
- Qwen3.5-0.8B
- peft
- flash-linear-attention
- kev-derived model code
Pricing: Open source training and serving on your GPUs. Optional TypeSafe Jev baseline needs your API key; routine MedJev inference does not call TypeSafe when running local checkpoints.
Links
FAQ
- Does MedJev send notes to TypeSafe by default?
- README positions local serving so patient text stays on your network. serve_compare replays stored Jev baseline JSONL unless you configure a fresh hosted eval.
- What is the relationship to kev?
- README acknowledgements state medjev/model.py, api.py, records.py, and checkpoint.py adapt kev under Apache-2.0 with changes recorded in NOTICE.
- Can I add a new clinical field without retraining?
- README contrasts general LLMs (describe a field in prose) with MedJev (needs hundreds of labeled examples and a short fine-tune for reliable new option sets).
Related learn guides
Original Jev guidance that pairs with this product pattern.
- System One model
The model family behind Jev: parallel typed questions, one forward pass, probabilities you can threshold.
- Where to run Jev
Compare official TypeSafe, Vercel AI Gateway, OpenRouter, Cloudflare Workers AI, and classifier.dev with a fact table.
Related products
Hand-picked neighbors with rich profiles or overlapping tags.