Privacy-Preserving, Locally Hosted LLM Agent for Autonomous Radiotherapy Treatment Planning
Abstract
Purpose
Radiotherapy planning is time-intensive, iterative, and operator dependent. AI automates planning but is not transparent, and cloud-based models threaten privacy. We developed and evaluated SAGE (Secure Agent for Generative dose Expertise), a locally hosted, privacy-preserving LLM agent, for autonomous radiotherapy plan optimization. We further investigated the impact of model size (8B,70B) and Retrieval Augmented Generation (RAG) on plan quality.
Methods
SAGE utilizes Llama3.1 (8B,70B) models deployed locally that interface with Eclipse TPS to autonomously adjust optimization parameters based on clinical goals specified through plain text prompt. RAG allowed the agent to recall previous successful and failed optimization steps. SAGE was validated on 17 prostate cancer patients (PROFIT trial; 60Gy/20fx). We generated four plans per patient (varying model size and RAG) and compared them to physician-approved plans. Performance was quantified using DVH metrics and analyzed using paired Wilcoxon signed-rank tests with Benjamini-Hochberg correction.
Results
The 70B-RAG agent achieved PTV V58.5Gy coverage statistically equivalent to clinical plans (97.9%±3.3 vs. 98.2%±2.0, p>0.05). All SAGE variants met PROFIT dose constraints except for rectum and bladder V60Gy, which also failed in clinical plans. The 70B-RAG agent significantly improved penile bulb V22Gy sparing compared to human planners (39.9%±18.3 vs. 44.8%±19.6, p=0.014). Ablation studies revealed RAG as the driver of quality, yielding a statistically significant median reduction of 1.10% in penile bulb V22Gy compared to non-RAG variants, whereas increasing model size showed no significant improvement. Operational efficiency improved: the 70B-RAG agent completed 10 autonomous optimization loops in 43±14.2 minutes, compared to a corrected clinical turnaround of 960±787 minutes.
Conclusion
SAGE demonstrates that privacy-preserving LLM agents can facilitate expert-level dosimetry using straightforward, interpretable prompts, and mitigate risks associated with cloud-based models. RAG-enabled variants show that iterative-context outweighs model size in complex planning tasks. SAGE facilitates access to text-based explainable optimization, comparable to contemporary dosimetry practice.