📦maziyarpanahi / 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
⚖️ Apache-2.0#healthcare#llm#on-device#on-premise#sovereign-ai🌐 openmed.life📅 创建于 2025-10-04🔄 更新于 2026-10-28
🔗 GitHub Python

📄 仓库 README

在 GitHub 查看 ↗
来自 GitHub 仓库自述文件 · 版权归原作者所有
OpenMed README banner with the cat mascot, lowercase wordmark, Open Cross, and the text Open-source healthcare AI, 340M+ downloads, and 10M+ installs

Your Data. Your Model. Your Hardware.

Turn clinical text into structured, de-identified insight on hardware you control.
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.

PyPI package · Python 3.10+ · Model catalog · Research paper · Apache-2.0 SDK source

OpenMedKit · Apple Silicon / MLX · Android / ONNX Runtime Mobile · Browser / Transformers.js · Documentation

2,266 manifest entries  ·  35 model-backed PII languages  ·  Apache-2.0 SDK

English · 简体中文 · Español · Français · Deutsch · Italiano · Português · Nederlands · العربية · हिन्दी · తెలుగు · 日本語 · Türkçe · فارسی · Kiswahili


See it in action

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

OpenMed Scan on iPhone · on-device PII de-identification and clinical extraction via OpenMedKit
On iPhone via OpenMedKit: scan a clinical note, de-identify it, and extract clinical signals with Apple MLX processing locally in this configuration.


OpenMed redacting PII from a clinical discharge document in real time
Real-time PII de-identification: in this configured local workflow, the Nemotron Privacy Filter redacts names, addresses, IDs, and billing data from a synthetic clinical discharge packet. (All values shown are synthetic.)

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.


Clinical brief in 30 seconds

From a source checkout, run the CPU-only synthetic contract demonstration:

python examples/v30_clinical_brief.py
# Optional: --model mlx, with the pinned model already cached on Apple silicon.

It de-identifies an embedded note, extracts and grounds a finding, then prints a cited brief, verdicts and a value-free review packet. NER/NLI providers are explicit synthetic test doubles, not trained-model or clinical validation. No external note input is accepted. The MLX option may refuse unsupported output; it never bypasses the guards. See the brief guide and demo script for the boundaries and local setup.


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: "3.1.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

MLX vs CPU latency on Apple Silicon: 24 to 33 times faster
MLX on Apple Silicon: 24–33× faster than CPU PyTorch for the Privacy Filter: median latency per inference step, lower is better.

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 v3.1.0 release:

dependencies {
    implementation("com.github.maziyarpanahi:openmed:v3.1.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](https://github.com/maz

📈 近 7 天 Star 趋势

每日新增 Star(柱)与累计 Star(线)· 数据来自 GitHub

🏆 排名变化趋势

在各榜单中的排名历史(数字越小越靠前)

📋 历史上榜记录

每次快照的详细数据
日期 榜单 排名 周期新增 总 STAR