OpenMed turns clinical text into structured, de-identified data on hardware you control. Its core runtime processes locally once the required model artifacts are present, so extraction and redaction do not send patient text to a cloud API; model downloads, remote-provider adapters, telemetry-enabled paths, and user-configured integrations are the separate network boundaries.
Two task families sit behind one Python API. Clinical named-entity recognition (analyzetext) tags diseases, drugs, anatomy, genes, and related entities with confidences; personally identifiable information (PII) extraction and de-identification (extractpii, deidentify) find names, dates, identifiers, phone numbers, and addresses, then mask, replace, hash, or date-shift them. Smart merging keeps a value such as 01/15/1970 whole instead of fragmenting it at token boundaries, and policy profiles for HIPAA, the General Data Protection Regulation (GDPR), and research add calibrated thresholds, signed audit reports, and redaction previews. Safe Harbor-aligned categories are configurable implementation aids; deployment owners still validate model terms, privacy behaviour, and clinical fitness.
The same models run across several execution paths: CPU and CUDA through PyTorch, Apple Silicon through MLX and the OpenMedKit Swift package, Android through OpenMedKit for Kotlin on ONNX Runtime Mobile, and the browser through Transformers.js with WebGPU. A FastAPI service exposes /analyze, /pii/extract, /pii/deidentify, and /health, with model-lifecycle controls, API-key or JWT authentication, no-PHI request logging, tracing, gRPC, async jobs, webhooks, dynamic batching, and rate limits. Pointing model_id at a local directory keeps an air-gapped deployment off the Hugging Face Hub entirely.
Reported measurements: MLX on Apple Silicon runs 24-33 times faster than CPU PyTorch on the Privacy Filter median latency per inference step, and batch processing reaches up to 3.3 times higher throughput on CPU and 2.2 times on MLX compared with one document at a time.
Multilingual PII covers 35 language codes, 33 of them backed by a registry model, with an optional user-configured Indic model family adding Gujarati, Kannada, Malayalam, and Punjabi routes, plus validator-backed national-identifier coverage for several ID-only locales. Portable agent skills ship in the repository for de-identification, clinical NER, FHIR export, and evaluation.
Features
- Clinical NER: registry models for diseases, drugs, anatomy, genes and proteins, ranging from 109M to 434M parameters
- PII de-identification: mask, replace, hash, or date-shift methods, with Faker-backed obfuscation and clinical identifier providers such as CPF, BSN, and Aadhaar
- Privacy Filter family: three model families on a shared architecture - an OpenAI baseline, a Nemotron-PII fine-tune, and an OpenMed multilingual variant - selected by changing model_name
- Local execution: CPU, CUDA, MLX, ONNX Runtime Mobile, and WebGPU backends, with a local-directory model path for air-gapped hosts
- Apple and Android kits: OpenMedKit ships as a Swift package and as a Kotlin library with parity tests against the Python runtime
- Browser inference: ONNX token-classification exports packaged for Transformers.js
- REST service: FastAPI endpoints for analysis, PII extraction, and de-identification, with auth, tracing, warm pools, and dynamic batching
- Batch and streaming: BatchProcessor and incremental helpers run extraction or de-identification across many documents
- Multilingual coverage: 35 PII language routes, 33 model-backed, plus optional Indic models and national-ID validators
- Agent skills and MCP: installable skills, a typed tool registry, an MCP server, and a command-line interface for agent-driven pipelines
- Policy profiles: HIPAA, GDPR, and research profiles with calibrated thresholds, audit reports, and minimum-necessary action selection
