SkillAgentSearch skills...

Openmed

Local-first healthcare AI: clinical NER & HIPAA PII de-identification that runs 100% on-device. 2,200+ medical models, 21 languages, Apple MLX + Python, no cloud, no patient data leaving your network. Apache-2.0

Install / Use

npx skills add maziyarpanahi/openmed

Installs into whichever agent you are using.

README

<div align="center"> <img src="docs/brand/openmed-readme-banner.png" alt="OpenMed README banner with the cat mascot, lowercase wordmark, Open Cross, and the text Open-source healthcare AI, 340M+ downloads, and 10M+ installs" width="1280" /> <h2>Your Data. Your Model. Your Hardware.</h2> <p><b>Turn clinical text into structured, de-identified insight on hardware you control.</b><br/> OpenMed's core local runtime performs extraction and de-identification after required model artifacts are available. Model downloads, remote-provider adapters, telemetry-enabled paths, and user-configured integrations may use a network; review each model and dataset's terms.</p> <p> <a href="https://pypi.org/project/openmed/">PyPI package</a> · <a href="https://www.python.org/downloads/">Python 3.10+</a> · <a href="https://huggingface.co/OpenMed">Model catalog</a> · <a href="https://arxiv.org/abs/2508.01630">Research paper</a> · <a href="LICENSE">Apache-2.0 SDK source</a> </p> <p> <a href="swift/OpenMedKit">OpenMedKit</a> · <a href="docs/mlx-backend.md">Apple Silicon / MLX</a> · <a href="docs/export-onnx-android.md">Android / ONNX Runtime Mobile</a> · <a href="docs/export-transformersjs.md">Browser / Transformers.js</a> · <a href="https://openmed.life/docs">Documentation</a> </p> <p> <b>Local-first runtime</b> &nbsp;·&nbsp; <b>34 model-backed PII languages</b> &nbsp;·&nbsp; <b>Apache-2.0 SDK</b> </p> <p> <b>English</b> · <a href="README.zh-CN.md">简体中文</a> · <a href="README.es.md">Español</a> · <a href="README.fr.md">Français</a> · <a href="README.de.md">Deutsch</a> · <a href="README.it.md">Italiano</a> · <a href="README.pt.md">Português</a> · <a href="README.nl.md">Nederlands</a> · <a href="README.ar.md">العربية</a> · <a href="README.hi.md">हिन्दी</a> · <a href="README.te.md">తెలుగు</a> · <a href="README.ja.md">日本語</a> · <a href="README.tr.md">Türkçe</a> · <a href="README.fa.md">فارسی</a> · <a href="README.sw.md">Kiswahili</a> </p> </div>

See it in action

This iPhone example uses OpenMed's local runtime after the required model artifacts are available:

<div align="center"> <img src="docs/brand/openmed-ios-scan.png" alt="OpenMed Scan on iPhone · on-device PII de-identification and clinical extraction via OpenMedKit" width="840" /> <br/> <sub><b>On iPhone via <a href="swift/OpenMedKit">OpenMedKit</a></b>: scan a clinical note, de-identify it, and extract clinical signals with Apple MLX processing locally in this configuration.</sub> </div> <br/> <div align="center"> <img src="docs/brand/openmed-pii-demo.gif" alt="OpenMed redacting PII from a clinical discharge document in real time" width="760" /> <br/> <sub><b>Real-time PII de-identification</b>: in this configured local workflow, the Nemotron Privacy Filter redacts names, addresses, IDs, and billing data from a synthetic clinical discharge packet. <i>(All values shown are synthetic.)</i></sub> </div>

30-second example

from openmed import analyze_text

result = analyze_text(
    "Patient started on imatinib for chronic myeloid leukemia.",
    model_name="disease_detection_superclinical",
)

for entity in result.entities:
    print(f"{entity.label:<12} {entity.text:<28} {entity.confidence:.2f}")
# DISEASE      chronic myeloid leukemia     0.98
# DRUG         imatinib                     0.95

A clinical NER model using the local runtime after its required artifacts are available.


Building with an agent?

Start with the consumer agent-usage guide, or load the curated llms.txt documentation index. For callable local interfaces, use the MCP server, the typed tool registry, or the command-line interface. Ready-made cross-tool procedures live in the repository skills catalog.


Why OpenMed?

| Deployment consideration | OpenMed SDK boundary | | --- | --- | | Core runtime | Processes locally after required artifacts are available | | Optional network paths | Downloads, remote adapters, telemetry-enabled paths, and user integrations may use a network | | Validation | Deployment owners validate model and dataset terms, privacy behavior, and clinical fitness | | Interfaces | Python, Swift, Android, browser, and service surfaces where supported |

  • Curated model catalog: validate each model, license, and dataset for your use case.
  • Safe Harbor-aligned configuration: can target the 18 identifier categories; expert deployment review remains required, and use of the SDK does not itself establish HIPAA compliance.
  • Supported execution paths: CPU, CUDA, MLX, mobile, service, and browser adapters vary by environment and artifact.
  • Deployment interfaces: Python, containers, services, and batch workflows require configuration and validation.
  • SDK source: released under the Apache-2.0 License; model and dataset terms vary.

On-device on Apple: Swift, MLX & iOS

On supported Apple hardware, OpenMed can use MLX and OpenMedKit for local processing after required artifacts are available. Model acquisition and any user-configured remote integrations remain separate network boundaries.

// Add OpenMedKit to your app
dependencies: [
    .package(url: "https://github.com/maziyarpanahi/openmed.git", from: "2.0.0"),
]

Expected result: Swift Package Manager resolves OpenMedKit and makes import OpenMedKit available to your app target.

  • MLX runtime for PII token classification, the Privacy Filter family, experimental GLiNER-family zero-shot tasks, and Python MLX-LM text generation with Laneformer; includes a CoreML fallback path for supported token-classification artifacts.
  • Portable model naming where supported: an MLX model name can fall back to a matching PyTorch checkpoint when that mapping and artifact are available on non-Apple hardware.
  • Python on Apple Silicon too: pip install --upgrade "openmed[mlx]".

Guides: MLX backend · OpenMedKit (Swift) · CoreML export

<div align="center"> <img src="docs/brand/openmed-mlx-speedup.png" alt="MLX vs CPU latency on Apple Silicon: 24 to 33 times faster" width="840" /> <br/> <sub><b>MLX on Apple Silicon: 24–33× faster than CPU PyTorch</b> for the Privacy Filter: median latency per inference step, lower is better.</sub> </div>

On-device on Android — Kotlin & ONNX Runtime Mobile

OpenMedKit also ships as a native Android/Kotlin library for local document intake, OCR handoff, PII redaction, and token-classification inference through ONNX Runtime Mobile. Mobile model repositories include stable tensor names, dynamic sequence axes, tokenizer files, labels, and Android-ready fp32, fp16, INT8, and optional .ort outputs.

Add the scoped JitPack repository in settings.gradle.kts:

dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://jitpack.io")
            content { includeGroup("com.github.maziyarpanahi") }
        }
    }
}

Then use the immutable OpenMed v2.0.0 release:

dependencies {
    implementation("com.github.maziyarpanahi:openmed:v2.0.0")
}

See the Android installation guide for local builds and publishing details.

val model = OpenMedKit.fromDirectory(modelDir)
val entities = model.analyzeText("Patient Alice Nguyen was seen in cardiology.")
  • Android ONNX profile emits model.onnx, model_fp16.onnx, model_int8.onnx, tokenizer assets, labels, and openmed-onnx.json.
  • ORT Mobile support records the minimal-build operator configuration when ONNX Runtime conversion tooling is installed.
  • Kotlin parity tests keep tokenizer offsets, span boundaries, and decoder output aligned with the Python runtime.

Guides: Android ONNX export · Android span parity · OpenMedKit Android

The same ONNX model on Python CPU

from openmed import OnnxModel

model = OnnxModel.from_pretrained(
    "OpenMed/OpenMed-PII-ClinicalE5-Small-33M-v1-onnx-android"
)
entities = model("Patient Alice Nguyen was seen in cardiology.")

The same ONNX model in the browser

npm install openmed @huggingface/transformers
import { loadOnnxModel } from "openmed";

const model = await loadOnnxModel(
  "OpenMed/OpenMed-PII-ClinicalE5-Small-33M-v1-onnx-android",
);
const entities = await model("Patient Alice Nguyen was seen in cardiology.");

How it works

flowchart LR
    A["Clinical text"] --> B["OpenMed<br/>(local-first)"]
    B --> C["Medical entities"]
    B --> D["PII detected"]
    B --> E["De-identified text"]
    style B fill:#0D6E6E,stroke:#0A5656,stroke-width:2px,color:#ffffff
    style C fill:#D6EBEB,stroke:#0D6E6E,color:#0E1116
    style D fill:#F7DCD8,stroke:#C5453A,color:#0E1116
    style E fill:#F5E27A,stroke:#A9A088,color:#0E1116

Rendered result: a local clinical-text pipeline that returns medical entities, PII findings, and de-identified text without sending data to a cloud API.


Agent Skills — build with OpenMed from your coding agent

The skills/ catalog ships portable Agent Skills for on-device de-identification, clinical NER, FHIR export, evaluation, and the healthcare workflows around them. The same SKILL.md folders work in Claude Code, OpenAI Codex, OpenCode, and compatible agents; the installer uses each client's skills directory plus the cross-client ~/.agents/skills convention.

git clone https://github.com/maziyarpanahi/openmed && cd openmed
./install-skills.sh          # installs for Claude Code, Codex

Related Skills

View on GitHub
GitHub Stars4.9k
CategoryHealthcare
Updated2m ago
Forks616

Languages

Python

Security Score

100/100

Audited on Aug 8, 2026

No findings