Medical NLP that runs in a Swift app, not a $50k contract
OpenMed packages clinical entity extraction and HIPAA-grade de-identification into models small enough for Apple Silicon and impatient DevOps teams.
An open-source toolkit tries to solve healthcare’s unstructured-data problem by running specialized NER and de-identification models entirely on-device.

What it does
OpenMed is a Python toolkit and Swift package for extracting structured medical entities from clinical text. It bundles a registry of 12+ specialized transformer models—disease detection, drug identification, anatomy, genes, and PII—behind a single analyze_text() call. A FastAPI service and batch processor wrap the same models for backend use, while OpenMedKit ports the PII and privacy-filter workloads to MLX on macOS and iOS.
The interesting bit
The project treats “production-ready” as a feature, not a slogan. It ships configuration profiles (dev/prod/fast), request validation with unified error envelopes, and smart entity merging to fix tokenization fragmentation on dates and clinical IDs. The de-identification layer is unusually thorough: six masking strategies including Faker-backed locale-aware surrogates, cryptographic hashing, and deterministic replacement with per-document consistency.
Key highlights
- Runs fully offline with local model paths; explicitly blocks Hugging Face Hub calls when a local directory is supplied
- Apple Silicon acceleration via both Python MLX and Swift OpenMedKit; CoreML fallback for bundled models
- Privacy Filter family re-implements OpenAI’s sparse-MoE architecture (local attention, sink tokens, RoPE+YaRN) on three training sets: OpenAI’s own, NVIDIA Nemotron-PII, and a multilingual variant
- PII coverage claims all 18 HIPAA Safe Harbor identifiers with configurable confidence thresholds
- Apache 2.0 licensed; Docker image and Colab notebook provided
Caveats
- The broader OpenMed model-to-Swift conversion pipeline is still “active work,” so only PII, Privacy Filter, and experimental GLiNER tasks are currently portable to iOS
- README claims models “outperform proprietary solutions” but cites no benchmarks or comparison numbers
- Most models are in the 109M–434M range; the “12+” registry is real but the catalog table only shows five entries
Verdict Worth a look if you need clinical NER or de-identification without cloud lock-in, especially in Apple-ecosystem deployments. Skip if you require validated accuracy claims against commercial competitors or mature Android/Windows on-device support.
Frequently asked
- What is maziyarpanahi/openmed?
- OpenMed packages clinical entity extraction and HIPAA-grade de-identification into models small enough for Apple Silicon and impatient DevOps teams.
- Is openmed open source?
- Yes — maziyarpanahi/openmed is open source, released under the Apache-2.0 license.
- What language is openmed written in?
- maziyarpanahi/openmed is primarily written in Python.
- How popular is openmed?
- maziyarpanahi/openmed has 4.7k stars on GitHub and is currently cooling off.
- Where can I find openmed?
- maziyarpanahi/openmed is on GitHub at https://github.com/maziyarpanahi/openmed.