A new study from Mass General Brigham researchers found that large language model artificial intelligence (AI) tools correctly flagged most patient messages physicians considered urgent. The study, published in npj Digital Medicine , found that models running on a hospital’s own servers performed as well as commercial models hosted in a protected cloud server environment.
The findings suggest AI could help clinicians triage patient portal messages by urgency while protecting patient privacy.
“Patients are increasingly directed to use the portal for routine messages. But a time-sensitive concern can sit in the same queue as a non-urgent one until a member of the clinical team opens and reads it,” said senior author Lidia Moura, MD, PhD, MPH, director of Population Health and a neurologist in the Neuroscience Institute at Mass General Brigham. “Managing these messages is a growing part of clinicians’ work, much of it invisible. We wanted to see whether AI could help find the messages that need attention first.”
Commercial large language models have been explored as solutions to help manage this workload, but their use can create privacy, contracting and cost concerns. Some health systems like Mass General Brigham run commercial AI models in its own protected cloud environment under strict institutional agreements to safeguard data and not allow it to leave the server and be accessed by physicians or vendors. However, many health systems lack such arrangements. The researchers therefore asked whether models running entirely on a hospital’s own hardware could perform just as well.
Researchers tested six large language models on 1,303 patient messages and compared their classifications with practicing physicians’ judgments using a predefined urgency standard. Messages came from primary care practices, an epilepsy clinic and public online platforms, the latter allowing the researchers to test performance beyond Mass General Brigham patients.
Researchers tested three OpenAI commercial models — GPT-4o, GPT-5 and GPT-5 Mini — in Mass General Brigham’s secure Microsoft Azure environment, alongside three open-weight models that hospitals could download and run locally: Meta’s Llama 4 Scout, Google’s Gemma 3 27B and OpenAI’s GPT-OSS 20B.
One model, GPT-5, missed none of the 134 urgent messages in the primary care group. Four of the six caught at least 97 of every 100 messages physicians had deemed urgent, and when those four cleared a message as routine, the models were right about 98 times out of 100. In comparison, a statistical method in use before large language models arrived caught fewer than half, missing 74 of 134 urgent messages. One top performer, Gemma 3 27B, runs on local hardware.
“We kept hearing that only the top commercial models could handle this kind of work and that local models weren’t good enough. We found a model we downloaded and ran on our own servers performed just as well,” said first and corresponding author and investigator Valdery Moura Junior, PhD, MBA, lead AI scientist at the Clinical Trials Network and Institute in the Department of Psychiatry at Mass General Brigham. “For health systems without enterprise cloud agreements, this can be the difference between using this AI technology or not.”
The models did over-flag routine messages as urgent; the best tool correctly cleared 73 of every 100 routine ones, meaning clinics would still have a number of messages to read, just a smaller queue in better order. Researchers audited 208 routine messages incorrectly flagged as urgent and traced each to a single cause, such as the models’ instructions being designed for a different clinical specialty. The best-performing model also varied by settings, which the authors read as a warning that a system validated at one hospital needs rechecking at another.
None of the models tested are in clinical use, and no patient care was affected. The research was part of “Luna Baker,” a multi-agent AI system for patient-portal messages that the group developed with support from the Baker Family Initiative in Patient Experience and Outcomes at Mass General Brigham. The system sorts portal messages, flags urgent ones, reviews the chart and drafts replies for clinicians to approve, using GPT-4o, one of the top performers in the study. This study will help inform Luna Backer’s urgency screening; the system is not currently in clinical use.
Authorship: In addition to Valdery Moura Junior and Lidia MVR Moura, Mass General Brigham authors include Lara Basovic, Majed Alomar, Jason C. You, Lipika Samal, Elyse R. Park, Louisa G. Sylvia, Gaurdia Banister, Jacob S. Riegler, Peter Hadar, and Shawn Murphy. Additional authors include Susanna Gallani.
Disclosures: None.
Funding: This study was supported by the Baker Family Foundation and the Harvard Business School AI Associates Program.
Paper cited: Moura Junior V, Gallani S, Basovic L, et al. “Cloud vs. on-premise large language models for urgent patient-portal message screening: a comparative evaluation.” npj Digital Medicine . DOI: 10.1038/s41746-026-03477-6
###
About Mass General Brigham
Mass General Brigham is an integrated academic health care system, uniting great minds to solve the hardest problems in medicine for our communities and the world. Mass General Brigham connects a full continuum of care across a system of academic medical centers, community and specialty hospitals, a health insurance plan, physician networks, community health centers, home care, and long-term care services. Mass General Brigham is a nonprofit organization committed to patient care, research, teaching, and service to the community. In addition, Mass General Brigham is one of the nation’s leading biomedical research organizations with several Harvard Medical School teaching hospitals. For more information, please visit massgeneralbrigham.org.
npj Digital Medicine
Computational simulation/modeling
People
Cloud vs. on-premise large language models for urgent patient-portal message screening: a comparative evaluation
20-Nov-2026
None