How Flatiron Health Scaled LLM Extraction from 100,000 to 2.5 Million Patients with Three to Five Engineers
A Databricks co-authored engineering account describes how Flatiron Health moved from deep learning batch pipelines with a 100,000-patient ceiling to monthly LLM extraction covering 2.5 million patients across four oncology cohorts, using ephemeral clusters and Ray on Databricks to make compute provisioning part of application code.
In early 2025, Flatiron Health made a bet: its flagship Panoramic research datasets, which provide cancer-care histories down to the biomarker level, would be built on large language models rather than in-house deep learning. The team had experience running production workloads on Databricks, but LLMs were new. By February 2025, they were scoring a 1-million-patient breast cancer cohort each month. By 2026, LLM extraction covered nearly 2.5 million patients across four cancer types — Breast, Prostate, NSCLC, and Heme — within a broader 6 million-patient population. A team of three to five engineers made that shift happen.
The constraint before the shift was architectural, not algorithmic. From 2019 through 2022, Flatiron's unstructured data processing relied on in-house deep learning models running on large, relatively static batch pipelines on an ad hoc compute platform. Projects continued to reach a ceiling of around 100,000-patient cohorts. The existing batch architecture could not provide the workload isolation, elastic compute, and operational simplicity needed for substantially larger cohorts. Engineers could not scale without hand-optimizing every model on its way to production.
The mechanism that removed that ceiling was what the article calls compute as application code. By late 2023, the engineering team had transitioned from a shared compute model to cost-efficient, ephemeral clusters dedicated to individual jobs. Each pipeline defines and provisions its own compute in Python, via the Databricks SDK or Declarative Automation Bundles, without a separate Terraform change or an additional platform team in the loop. Engineers define the compute each pipeline needs in the same file as its application logic. For LLM workloads specifically, extracting a single variable can require generating up to one million large prompts, each averaging approximately 20,000 tokens, and an individual pipeline can run for days. With dozens of variables in flight, this only works if each pipeline provisions exactly the compute it needs and tears it down afterward.