clinical-symptom-triage-slm-int8
compact symptom urgency classifier
2 min read
The model determines the urgency level of seeking medical care based on a text description of symptoms in English. It is based on a small transformer encoder (approximately 30 million parameters), quantized to 29 MB in INT8 ONNX format, combined with a layer of deterministic rules to detect critical red flags. The output system distributes the request into 4 urgency levels (Emergency, Urgent, Routine, Self-care) without diagnosing or generating arbitrary medical advice. The solution is useful for developers of telemedicine services, primary assessment chatbots, and mobile or browser applications with local execution without a GPU.
Key features
- Ultra-compact size: the model weighs 29.0 MB thanks to INT8 quantization.
- High speed: latency on a single CPU core is 1.31 ms with a throughput of 725.4 requests per second.
- Two-tier architecture: the model is complemented by a deterministic safety layer to track dangerous conditions.
- Universal execution: the ONNX format allows running the model on servers, smartphones, and in the browser via WebAssembly.
What you can do
- Integrate into a chatbot or initial patient questionnaire form in English to route requests by urgency.
- Run locally on mobile devices or directly in the browser via WebAssembly without sending data to a server.
- Use as a fast safety filter before larger medical assistants to instantly detect emergency cases.
Example
import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("artifacts/triage-bert-small")
session = ort.InferenceSession("artifacts/triage-bert-small/model.int8.onnx", providers=["CPUExecutionProvider"])
inputs = tokenizer("Severe crushing chest pain radiating to my left arm with cold sweats", return_tensors="np")
outputs = session.run(["logits"], {"input_ids": inputs["input_ids"].astype(np.int64), "attention_mask": inputs["attention_mask"].astype(np.int64)})Read more
DetailsBMJ 2015 benchmark (45 clinical scenarios): emergency recall is 100.0% (15/15), under-triage rate is 2.2% (1/45), overall triage accuracy is 55.6%.
Requirements: runs on a single CPU core without a GPU, file size is 29.0 MB.
Limitations: supports English only; the model does not diagnose, prescribe treatment, and classifies text strictly into 4 urgency categories.
License: Apache 2.0.










Comments