maziyarpanahi/openmed
Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android and browser runtimes. Apache-2.0 SDK.
OpenMed – on‑device clinical‑text AI
What it is – OpenMed is an open‑source SDK that lets you run medical‑text extraction and protected‑health‑information (PHI/PII) de‑identification locally, on the hardware you control. After you download the required model files (from Hugging Face or the OpenMed model catalog), the runtime works completely offline and returns structured entities, redacted text, or FHIR‑ready outputs.
Key capabilities
- Clinical NER – disease, drug, anatomy, gene, etc. (e.g.,
disease_detection_superclinical). - PII detection & de‑identification – 18 Safe‑Harbor categories, with multiple masking strategies (mask, replace, hash, date‑shift).
- Multilingual support – 35 model‑backed languages, 42 language codes.
- Multiple runtimes – CPU, CUDA, Apple‑Silicon MLX, Android ONNX Runtime Mobile, browser Transformers.js, and a REST service.
- Agent‑ready skill catalog – ready‑to‑use “Agent Skills” for Claude Code, OpenAI Codex, etc.
- Batch & streaming pipelines – process many documents efficiently, with smart entity merging to keep dates, IDs, etc. intact.
How you use it
from openmed import analyze_text
result = analyze_text(
"Patient started on imatinib for chronic myeloid leukemia.",
model_name="disease_detection_superclinical",
)
for e in result.entities:
print(e.label, e.text, f"{e.confidence:.2f}")
You can also call the CLI, run a FastAPI‑style service (python -m openmed.service.logging), or invoke the Kotlin/Swift libraries on mobile devices.
Supported platforms
- Python (pip install
openmed[hf], optional[mlx]for Apple Silicon acceleration). - Swift / iOS –
OpenMedKitvia Swift Package Manager; uses MLX for fast token‑classification. - Kotlin / Android – ONNX Runtime Mobile models packaged as a JitPack artifact.
- Web – ONNX export with Transformers.js, runnable in browsers with WebGPU.
- Containers / services – Docker images and a built‑in REST server.
Model catalog – The repo ships a curated list of specialized NER models (disease, pharma, anatomy, gene, PII) ranging from ~100 M to ~434 M parameters. Models are hosted on Hugging Face under the OpenMed/ namespace; the SDK can load them from a local directory for air‑gapped deployments.
Privacy stance – OpenMed does not provide any regulatory compliance guarantees. It supplies Safe‑Harbor‑aligned PII categories and configurable thresholds, but the deploying organization must perform its own validation and HIPAA/GDPR review.
License – Apache‑2.0 for the SDK source code. Model and dataset licenses vary and are displayed in the model catalog.
Quick‑start checklist
pip install "openmed[hf]"(oropenmed[mlx]for Apple Silicon).- Download a model (e.g.,
openmed download disease_detection_superclinical). - Call
analyze_text/extract_pii/deidentifyfrom Python, or use the mobile SDKs. - For production, wrap the SDK in the provided REST service or embed it in your iOS/Android app.
Bottom line – OpenMed is a genuine, open‑source platform for on‑device clinical text processing, offering both entity extraction and privacy‑preserving de‑identification across a wide range of hardware and languages.
Related
- Project
- Project
- Project
- Dispatch