cookbook · vertical · intake-triage
Recipe · vertical

Patient intake, routed in one second.

A local .kolm file that classifies a patient intake form into (urgent, routine, deferred) with a structured rationale. Trained on the clinic's own held-out triage outcomes; verifier rejects any output that doesn't trace its rationale to specific intake fields. Runs offline on the front-desk tablet.

base modelqwen2.5-7b-instruct
gold pairs800 (560 train / 240 eval)
k-score floor0.80
artifact size91 MB
compile time~38 min (in your VPC)
spec sourceclassifier + grounded

What this recipe does

Front-desk staff don't have time to wait on a cloud round-trip when a patient hands them a 6-page intake. This recipe compiles a small classifier into a single signed .kolm that runs on the tablet locally. Output is one of three urgency bands plus a 2–3 sentence rationale that cites specific fields from the intake form. The grounded verifier rejects any rationale that references a finding not in the input.

The training corpus is pairs of (intake form, attending's actual triage decision) drawn from the clinic's last 12 months. Held-out is a separate cohort the model never sees. PHI is stripped before training using the same regex bundle as hipaa-summarizer.

The spec

{
  "output_kind": "json",
  "schema": {
    "required": ["band", "rationale", "cited_fields"],
    "properties": {
      "band": { "enum": ["urgent", "routine", "deferred"] },
      "rationale": { "type": "string", "maxLength": 400 },
      "cited_fields": { "type": "array", "items": {"type":"string"}, "minItems": 1 }
    }
  },
  "verifier": {
    "rationale_must_cite_input_fields": true,
    "redact_before_train": true,
    "redact_pattern_file": "hipaa-18.regex"
  }
}

Compile

kolm compile "front-desk intake triage classifier with grounded rationale" \
  --base qwen2.5-7b-instruct \
  --pairs ./triage-gold/*.jsonl \
  --verifier rationale-grounded,no-phi-in-output \
  --k-floor 0.80 \
  --output intake-triage.kolm

ok wrote intake-triage.kolm
   k_score=0.82  signature=hmac-sha256
   band-accuracy 0.86 · rationale-grounded 100%

K-score gate

K-score 0.82 held-out 240 forms · band-accuracy 86% · grounded-rationale 100% · attending-agreement 84%

Attending agreement: a panel of 3 attendings re-triaged 80 held-out forms. The model agreed with majority on 84% of cases, dissented on 16%, and was never the only one to flag urgent.

Run-time profile

Front-desk tablet
820ms
RTX 5090
110ms
Mac mini
680ms
CPU x86
1.4s

Deploy

# Front-desk tablet — runs against intake form submissions:
on_intake_submit = (form) => {
  const out = kolm.run('intake-triage.kolm', form.json);
  ehr.flag(form.id, out.band, { rationale: out.rationale, cited: out.cited_fields });
  audit.log({ artifact: 'intake-triage.kolm', form_id: form.id, k_score: out.receipt.k_score });
};