maziyarpanahi/openmed
Local-first clinical NLP SDK for entity extraction and de-identification
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
OpenMed is a clinical preprocessing SDK, not a retrieval engine. Its Python APIs separate clinical entity extraction (analyze_text), PII span detection (extract_pii), and text transformation (deidentify). The selected model and language route determine the inference path. Applications can call these operations in-process, process collections with BatchProcessor, or integrate through REST, CLI, or MCP; the MCP surface includes a typed tool registry.
The Python Hugging Face path supports CPU and CUDA. OpenMedKit provides a Swift/MLX path with CoreML fallback for supported token-classification artifacts, while Android uses Kotlin and ONNX Runtime Mobile. Compatible ONNX exports can also run on Python CPU or in the browser via Transformers.js. Kotlin parity tests check tokenizer offsets, span boundaries, and decoder outputs against Python, but do not imply that every registry model is portable across runtimes.
Key Capabilities & Differentiators
The registry contains 2,266 manifest entries. Its specialized checkpoints include a 434M disease model for DISEASE, CONDITION, and DIAGNOSIS, and a 109M anatomy model for ANATOMY, ORGAN, and BODY_PART. PII extraction supports 42 language routes, 35 of them model-backed. Russian currently uses a multilingual default-model placeholder; the optional Indic NER family requires explicitly configured weights and is neither bundled nor automatically selected.
Smart merging addresses PII spans split during tokenization. De-identification can mask or replace text, hash values, or shift dates. Beyond text, the mobile workflow supports local document intake and redaction review, including manual coverage of a handwritten signature and checking the exported PDF before sharing. The CPU clinical-brief demo illustrates evidence grounding and review handoff with synthetic NER/NLI test doubles; it does not validate trained-model performance or clinical fitness.
Trade-offs & Limitations
For one model on one backend, a direct Hugging Face or ONNX Runtime integration can be simpler. OpenMed earns its integration cost when a team needs both clinical NER and de-identification, or wants to share workflows across servers and devices. Compared with a managed API, local inference can keep payloads within infrastructure you control, but shifts artifact distribution, capacity planning, upgrade testing, and privacy validation to your team.
The Apache-2.0 SDK license does not settle the terms of individual weights or datasets, and catalog size does not establish accuracy for a given language or document type. A Safe Harbor-aligned configuration can target the 18 identifier categories, but it does not confer HIPAA compliance. Use representative data to check residual identifiers, clinically relevant text removed by mistake, and final exports. Size RAM and VRAM against the actual model set, input lengths, and concurrency rather than a single baseline.
Hardware & Deployment Guide
Start with Python 3.11+ and openmed[hf] for CPU or CUDA, or openmed[mlx] on Apple Silicon. Add the service extra to run python -m openmed.service.logging with /health, /analyze, /pii/extract, and /pii/deidentify. The root Dockerfile and Compose configuration provide a self-hosted path on port 8080; test the model preload list, resident-model cap, concurrency, and request-body timeouts under representative load.
For disconnected operation, stage compatible weights and tokenizer assets in advance and verify the full workflow without network access. Downloads, remote adapters, telemetry-enabled paths, and configured integrations can still use a network. The release sequence shows what has changed: v3.2.0 broadened language routing and local model integrations, v3.3.0 added workflows for documents, images, speech, and waveforms, and v4.0.0 advanced offline mobile document processing and redaction review.
.ort artifacts; Kotlin parity tests cover offsets, span boundaries, and decoder outputs.Teams that need to extract clinical entities and de-identify notes or documents on infrastructure they control, with a review step before indexing, analysis, or sharing.
You want a managed clinical service, an out-of-the-box compliance guarantee, or only need to run one checkpoint and already have a validated privacy pipeline.
Quick Start & Installation
npm install openmed @huggingface/transformersComparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| openmed ★ | 5.9k | +45 | Python | Apache-2.0 | Local-first clinical NLP SDK for entity extraction and de-identification |
| langextract | 39.5k | +85 | Python | Apache-2.0 | Python SDK for extracting structured data with traceable source spans |
| auto-ontology | 19.1k | +3.2k | Python | Apache-2.0 | An ontology framework that grounds agent-generated SQL in reviewed business defi |
| llama_index | 53.1k | +110 | Python | MIT | A modular Python SDK for document ingestion, indexing, and RAG |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/maziyarpanahi/openmed.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about openmed
How should I integrate OpenMed into a clinical document pipeline?
extract_pii when a reviewer needs to inspect detected spans, deidentify to produce transformed text, and analyze_text with a task-specific model to extract clinical entities. These operations can run in-process in Python or behind the corresponding REST endpoints. If redaction precedes extraction, test whether it removes context needed by the clinical model; preserve span mappings if downstream reviewers need to trace findings back to the source.Do I need a GPU, and how should I size RAM or VRAM?
Can I use OpenMed commercially, and does self-hosting make it HIPAA-compliant?
When should I choose OpenMed over a direct Hugging Face or ONNX Runtime integration?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy