Skip to content

EHRGym

EHRGym addresses a core clinical-AI challenge: the long, friction-filled reality of EHR workflows that hinder practical use far beyond diagnosis and treatment.

Core trick

GRPO trains an RL agent on longitudinal EHR task environments, served as OpenEnv containers with reproducible HuggingFace Spaces benchmarks.

Tags

Description

EHRGym addresses a core clinical-AI challenge: the long, friction-filled reality of EHR workflows that hinder practical use far beyond diagnosis and treatment. It trains and evaluates reinforcement learning agents (e.g., GRPO) that act within longitudinal clinical tasks, with benchmarks and reproducible HuggingFace Spaces demos, enabling systematic training, testing, and deployment of AI agents that leave clerical work to agents and help make medicine more human again.
adtserapio/ehrgym★ 41 forksTypeScriptApache-2.0Created Mar 7, 2026 · last push Apr 3, 2026

README excerpt

---
title: EHRGym
emoji: 🏥
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
tags:
  - openenv
  - rl-environment
  - ehr
  - grpo
  - trl
  - clinical
  - computer-use
pinned: false
license: apache-2.0
---

# EHRGym

<p align="center">
  <img src="ehrgym_logo.png" alt="EHRGym Logo" width="50%">
</p>

<p align="center">
  <a href="https://huggingface.co/spaces/openenv-community/EHRGym"><img src="https://img.shields.io/badge/OpenEnv-EHRGym-blue?logo=huggingface" alt="OpenEnv"></a>
  <a href="https://huggingface.co/docs/trl/grpo_trainer"><img src="https://img.shields.io/badge/TRL-GRPO%20Training-orange?logo=huggingface" alt="TRL GRPO"></a>
  <a href="https://colab.research.google.com/github/adtserapio/EHRGym/blob/main/notebooks/ehrgym_grpo_training.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"></a>
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache%202.0-green.svg" alt="License"></a>
</p>

**EHRGym** is an [OpenEnv](https://huggingface.co/openenv-community)-compatible environment for training and evaluating computer-use agents in an Epic-like electronic health record (EHR) workflow. It integrates natively with [TRL](https://github.com/huggingface/trl)'s `GRPOTrainer` for GRPO fine-tuning.

<p align="center">
  <a href="https://huggingface.co/spaces/openenv-community/EHRGym">
    <img src="hf_spaces_ui_demo.png" alt="EHRGym UI Demo" width="90%">
  </a>
</p>

<p align="center">
  <a href="https://hugg

Team