OpenMed is a local-first clinical natural language processing SDK. It reads clinical text and returns medical entities, personally identifiable information (PII) findings, and de-identified text, with the core runtime processing on hardware you control once the required model artifacts are present. Model downloads, optional remote-provider adapters, telemetry-enabled paths, and user-configured integrations are the only paths that use a network.
The model registry holds 2,266 manifest entries of specialized biomedical named-entity recognition (NER) models, including disease, drug, anatomy, gene and PII detectors, plus a Privacy Filter family built on the OpenAI Privacy Filter architecture: the baseline weights, a Nemotron-PII fine-tune, and a multilingual variant, each shipped as PyTorch, MLX and MLX 8-bit artifacts. On a host without Apple silicon an MLX model name is substituted with the matching PyTorch checkpoint. PII extraction and de-identification route through 42 language codes (35 model-backed), with validator-backed national-ID coverage for further ID-only locales.
The same ONNX token-classification exports run on Python CPU, in the browser through Transformers.js with WebGPU, and on Android through ONNX Runtime Mobile. On Apple hardware the OpenMedKit Swift package runs the pipeline on iPhone and Mac with MLX, with a CoreML fallback for supported artifacts. MLX inference for the Privacy Filter runs 24–33× faster than CPU PyTorch, and batch processing raises throughput up to 3.3× on CPU and 2.2× on MLX compared with one document at a time.
For agent builders, the repository ships Agent Skills for de-identification, clinical NER, FHIR export and evaluation that work in Claude Code, Codex, OpenCode and compatible agents, alongside an MCP server, a typed tool registry, a command-line interface and an llms.txt documentation index. Safe Harbor-aligned PII categories and configurable thresholds are implementation aids: expert deployment review remains required, and using the SDK does not by itself establish HIPAA compliance.
| Model | Specialization | Entity types | Size |
|---|---|---|---|
| disease_detection_superclinical | Disease and conditions | DISEASE, CONDITION, DIAGNOSIS | 434M |
| pharma_detection_superclinical | Drugs and medications | DRUG, MEDICATION, TREATMENT | 434M |
| pii_superclinical_large | PII and de-identification | NAME, DATE, SSN, PHONE, EMAIL, ADDRESS | 434M |
| anatomy_detection_electramed | Anatomy and body parts | ANATOMY, ORGAN, BODY_PART | 109M |
| gene_detection_genecorpus | Genes and proteins | GENE, PROTEIN | 109M |
Features
- Clinical NER: a single call extracts labeled entities with confidence scores and offsets from clinical text, using a registry model chosen by name
- PII extraction and de-identification: mask, replace, hash or shift-dates methods, smart entity merging that keeps dates and IDs whole, and Faker-backed obfuscation with clinical-ID providers (CPF, CNPJ, BSN, NIR, Codice Fiscale, NIE, Aadhaar, Steuer-ID, NPI)
- Policy-aware pipelines: HIPAA, GDPR and research profiles, calibrated thresholds, signed audit reports, redaction previews, and minimum-necessary action selection
- Multilingual PII: 42 supported language codes, 35 of them model-backed, with an optional user-configured Indic NER family for eleven Indic languages
- Privacy Filter family: OpenAI Privacy Filter, Nemotron-PII fine-tune and multilingual variants in PyTorch, MLX and MLX 8-bit, all behind the same extract_pii and deidentify API
- Apple silicon: the OpenMedKit Swift package and the MLX runtime for PII token classification, GLiNER-family zero-shot tasks and MLX-LM text generation, with a CoreML fallback
- Android and browser: a Kotlin library on ONNX Runtime Mobile with fp32, fp16 and INT8 exports, and Transformers.js bundles for in-browser WebGPU inference
- Batch and streaming: a batch processor for extraction or de-identification across many documents, plus incremental streaming helpers
- REST and gRPC service: a FastAPI service with request validation, API-key or JWT auth, no-PHI request logging, tracing, async jobs, webhooks, warm pools, dynamic batching, rate and concurrency limits, model unload and keep-alive controls, and opt-in metrics
- Agent access: Agent Skills for Claude Code, Codex and OpenCode, an MCP server, a typed tool registry, a CLI, and llms.txt and llms-full.txt documentation feeds
- Interoperability: FHIR export and HL7 v2 de-identification guides, an extension plugin SDK, and configuration profiles
- Offline operation: a model name can point at a local directory so no call reaches the Hugging Face Hub, for air-gapped deployments
