Agent skill

Running Openmed Ondevice

by maziyarpanahi in maziyarpanahi/openmed

Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Running Openmed Ondevice

skills CLI
$ npx skills add maziyarpanahi/openmed --skill running-openmed-ondevice -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install maziyarpanahi/openmed running-openmed-ondevice --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/maziyarpanahi/openmed.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/running-openmed-ondevice .claude/skills/running-openmed-ondevice && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
running-openmed-ondevice
GitHub stars
5.5k
Token cost
~2k tokens
SKILL.md length
601 words
Files
1
Skills in repo
74
Repo updated
First seen
Licence
Apache-2.0

At a glance

Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows.

  • Works in 5 steps: Pick the backend for the target (table… → Convert the HF/OpenMed model with the… → Quantize if size/latency demands it (MLX… → …
  • The user wants to deploy OpenMed at the edge
  • SKILL.md covers When to use this skill, Pick a backend, Quick start — MLX (Apple… and Quick start — CoreML (iOS/macOS), plus 5 more sections
  • Calls python and pip

What it does

Running Openmed Ondevice is an agent skill from maziyarpanahi/openmed. Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows. Use when the user wants to deploy OpenMed at the edge, run NER/de-id on Apple Silicon, target iPhone/iPad/Mac, export to ONNX or WebGPU, quantize a clinical model to int8/4-bit, run with no network, or pick between MLX/CoreML/ONNX. Covers the mlx/coreml/onnx extras, the convert() functions and python -m convert CLIs, quantization, loading…

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM inference and serving. It works with ONNX, iOS, macOS and Python. The repository describes itself as: Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android… The licence is Apache-2.0.

When your agent uses it

  • The user wants to deploy OpenMed at the edge
  • Run NER/de-id on Apple Silicon
  • Target iPhone/iPad/Mac
  • Quantize a clinical model to int8/4-bit

Example prompts

  • “/running-openmed-ondevice”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Pick the backend for the target (table above).
  2. Convert the HF/OpenMed model with the matching convert() /
  3. Quantize if size/latency demands it (MLX 4/8-bit, CoreML int8, WebGPU
  4. Run locally: MLX artifacts go straight through analyze_text /
  5. Verify outputs against the full-precision model before shipping

What it can do on your machine

Read from SKILL.md and the folder at commit 34d7b8c. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • apple.github.io
    • onnx.ai
    • onnxruntime.ai
    • huggingface.co

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Running Openmed Ondevice loads about 2k tokens when it runs. Until then it costs about 172 tokens; SKILL.md has 601 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~172
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from maziyarpanahi/openmed at commit 34d7b8c, republished under its Apache-2.0 licence (© maziyarpanahi). 601 words, ~2,018 tokens.

Download SKILL.mdSave it as .claude/skills/running-openmed-ondevice/SKILL.md (or your agent's skills folder).
name
running-openmed-ondevice
description
Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows. Use when the user wants to deploy OpenMed at the edge, run NER/de-id on Apple Silicon, target iPhone/iPad/Mac, export to ONNX or WebGPU, quantize a clinical model to int8/4-bit, run with no network, or pick between MLX/CoreML/ONNX. Covers the mlx/coreml/onnx extras, the convert() functions and python -m convert CLIs, quantization, loading a local MLX artifact through analyze_text, OpenMedMLXLanguageModel/generate_text, and the on-device-only PHI guarantee (nothing leaves the host).
license
Apache-2.0
metadata.project
OpenMed
metadata.category
deployment-ops
metadata.pairs
adjacent
metadata.version
1.0

Running OpenMed on-device

OpenMed runs fully on-device by design. These three backends let you take it further at the edge: MLX (Apple Silicon acceleration), CoreML (iOS/macOS / Neural Engine), and ONNX / WebGPU (cross-platform and in-browser). The flow is the same: convert → (quantize) → run locally. Because inference is local, raw PHI never leaves the device — the strongest privacy posture OpenMed offers.

When to use this skill

When you need OpenMed where there is no server: an iOS/macOS app (CoreML), fast NER/de-id on an Apple Silicon Mac (MLX), or a portable/browser deployment (ONNX/WebGPU). For a hosted endpoint use serving-openmed-rest-api; for an agent tool use deploying-openmed-mcp; for corpora use batch-processing-clinical-text.

Pick a backend

BackendExtraBest forQuantization
MLXopenmed[mlx]Apple Silicon Macs; fastest local NER/de-id; on-device LLMs4-bit / 8-bit weights
CoreMLopenmed[coreml]iOS/iPadOS/macOS apps, Neural Engineint8 palettization
ONNX / WebGPUopenmed[onnx]cross-platform runtimes, browser (transformers.js)fp16 (WebGPU); int8 via ORT

Quick start — MLX (Apple Silicon)

bash
pip install "openmed[mlx]"

# Convert a HF token-classification model to an OpenMed MLX artifact, 8-bit:
python -m openmed.mlx.convert --model OpenMed/<some-ner-model> --output ./mlx_ner --quantize 8
python
import openmed

# Run NER/de-id through the normal API — pass the local artifact dir as model_name.
# The loader auto-detects the MLX backend from the artifact (or set backend explicitly).
result = openmed.analyze_text(
    "Patient received 75mg clopidogrel for NSTEMI.",
    model_name="./mlx_ner",          # local MLX artifact directory
    output_format="dict",
)

# Force MLX via config if you prefer to be explicit:
from openmed.core.config import OpenMedConfig
cfg = OpenMedConfig(backend="mlx")   # None=auto-detect, "mlx", or "hf"

convert() is also importable: openmed.mlx.convert.convert(model_id, output_dir, quantize_bits=8). The CLI accepts --quantize {4,8}, --quantize-group-size, --cache-dir, and an optional --eval-suite to certify quantized recall against the full-precision parent (recommended for clinical models — quantization can drop recall on rare entities).

On-device LLM generation (MLX)
python
from openmed.mlx.lm import generate_text, OpenMedMLXLanguageModel

text = generate_text(
    messages=[{"role": "user", "content": "Summarize: chest pain, troponin elevated."}],
    model_name="OpenMed/laneformer-2b-it-q4-mlx",   # resolves to a local MLX-LM artifact
    max_tokens=128,
)

llm = OpenMedMLXLanguageModel("OpenMed/laneformer-2b-it-q4-mlx")
out = llm.generate(prompt="...", max_tokens=64, temp=0.0)

Quick start — CoreML (iOS/macOS)

bash
pip install "openmed[coreml]"
python -m openmed.coreml.convert --model OpenMed/<some-ner-model> --output model.mlpackage --quantize int8
python
from openmed.coreml.convert import convert
convert(
    "OpenMed/<some-ner-model>",
    "model.mlpackage",
    compute_units="cpuAndNeuralEngine",   # "all" | "cpuAndNeuralEngine" | "cpuOnly"
    compute_precision="float16",          # float16 for Neural Engine, float32 for CPU
    quantize="int8",                      # emits an int8-palettized sibling .mlpackage
)

Bundle the .mlpackage in your Xcode app and run it with Core ML; the converter writes the id2label map so your app can decode token labels. Use float16 + cpuAndNeuralEngine for the Neural Engine; int8 shrinks the model for storage-constrained devices.

Quick start — ONNX / WebGPU

bash
pip install "openmed[onnx]"
python -m openmed.onnx.convert --model OpenMed/<some-ner-model> --output ./onnx_out
python
from openmed.onnx.convert import convert
res = convert("OpenMed/<some-ner-model>", "./onnx_out", include_webgpu=True, opset=18)
# Emits model.onnx (fp32) and model.webgpu.onnx (fp16) + an export manifest.

Run model.onnx with ONNX Runtime on any platform, or ship model.webgpu.onnx to the browser via transformers.js for in-page, zero-upload inference. Use --no-webgpu to skip the fp16 artifact.

Workflow

  1. Pick the backend for the target (table above).
  2. Convert the HF/OpenMed model with the matching convert() / python -m openmed.<backend>.convert.
  3. Quantize if size/latency demands it (MLX 4/8-bit, CoreML int8, WebGPU fp16). For clinical de-id/NER, certify recall — MLX's --eval-suite writes a recall-delta report so you don't silently lose rare entities.
  4. Run locally: MLX artifacts go straight through analyze_text / deidentify; CoreML/ONNX artifacts run in their native runtimes (Core ML, ONNX Runtime, transformers.js).
  5. Verify outputs against the full-precision model before shipping (evaluating-with-leakage-gates for de-id).
Show full SKILL.md (247 more words)Show less

Hand-off to / from OpenMed

  • Same API surface: an MLX artifact path is a drop-in model_name for openmed.analyze_text / deidentify — downstream skills (building-patient-timelines, exporting-to-fhir) are unchanged.
  • From the catalog: start from a model chosen via choosing-openmed-models / loading-openmed-models, then convert it here.
  • Eval gate: pipe quantized de-id output into evaluating-with-leakage-gates before release.

Edge cases & gotchas

  • Quantization can hurt clinical recall. A dropped rare PHI entity is a breach. Always benchmark the quantized model vs. full precision (MLX --eval-suite/recall-delta; manual eval for CoreML/ONNX) and gate on leakage, not just F1.
  • MLX is Apple-Silicon only. On non-Apple hardware the MLX backend isn't available and OpenMed falls back to PyTorch; convert/quantize steps that need mlx will skip quantization with a warning.
  • CoreML compute units matter. float16 targets the Neural Engine but some ops fall back to CPU; validate latency on a real device, not just the simulator.
  • ONNX dynamic axes / opset. Keep opset>=18 and verify the model with onnx.checker (the converter does). token-classification only — these converters wrap AutoModelForTokenClassification.
  • On-device ≠ no responsibility. Local inference removes network exposure, but the model and any cached output still live on the device — encrypt at rest and keep raw PHI out of logs.
  • No license bundling. Convert your own permissively-licensed models; don't embed restricted terminologies in shipped artifacts.

Standards & references

© maziyarpanahi, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/running-openmed-ondevice of maziyarpanahi/openmed.

Open the folder on GitHubat commit 34d7b8c

Compare with similar skills

Running Openmed Ondevice next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Running Openmed Ondevice compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Running Openmed Ondevice this skillmaziyarpanahi/openmed5.5k—~2kAutomated safety check: PassApache-2.0
Onboard Jetpack5 Inference BackendsEGalahad/sim2real146—~1.1kAutomated safety check: PassNone
Local Asrysyecust/lecture-to-notes273—~1.6kAutomated safety check: PassCustom licence
Quark Onnx Debugamd/Quark182—~4.8kAutomated safety check: PassMIT
Local Asrcat-xierluo/legal-skills720—~5.8kAutomated safety check: PassMIT
Quark Onnx Ptq Workflowamd/Quark182—~4.5kAutomated safety check: PassMIT

Similar skills

  • Install, convert, debug, and benchmark sim2real ONNX GPU and TensorRT inference backends on onboard JetPack 5 Orin hosts such as g1-cable.

    146 GitHub stars~1.1k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check passed
  • Local Asr

    ysyecust/lecture-to-notes

    把本地长视频/音频转写成文字稿 + 可选字幕,纯本地(不上传云端),用 sherpa-onnx X-ASR Zipformer transducer 模型(int8 量化、中英双语、自动标点)。已在 macOS Apple Silicon(int8 + AMX,~100× 实时)、Linux ARM64(CPU,~32× 实时)与 Windows(PowerShell…

    273 GitHub stars~1.6k tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed
  • Diagnose failed Quark ONNX installation, calibration, quantization, custom-op compilation, or export attempts.

    182 GitHub stars~4.8k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check passed
  • Local Asr

    cat-xierluo/legal-skills

    使用本地 ASR 服务将音频或视频文件转录为带时间戳和说话人的 Markdown,Apple Silicon 默认使用 MOSS-MLX,保留 FunASR 原生及 ONNX 管线供显式选择;支持认领式声纹注册,本人声纹注册后自动识别标注。支持 mp4、mov、mp3、wav、m4a 等格式;用于会议记录、电话录音、视频字幕和播客转录。

    720 GitHub stars~5.8k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • End-to-end ONNX PTQ workflow for AMD Quark — from a .onnx file (and calibration data) to a quantized .onnx output.

    182 GitHub stars~4.5k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check passed
  • Quark Install

    amd/Quark

    Installs or verifies AMD Quark and ensures the selected Python environment has an accelerator-matched PyTorch.

    182 GitHub stars~3.5k tokensUpdated 13 days ago
    AI & LLM EngineeringAuto-check: notes

More from maziyarpanahi/openmed

All 74 skills in this repo
  • Checks OpenMed de-identified clinical text against the 18 HIPAA Safe Harbor identifier categories and reports gaps and residual re-identification risk.

    5.5k GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • OpenMed Model Card Writer

    maziyarpanahi/openmed

    Fills in a model card for an OpenMed clinical NER or de-identification model from its evaluation reports: intended use, metrics, subgroups and limitations.

    5.5k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Walks a data pipeline against the HIPAA Privacy and Security Rule checklist and produces a gap report before it processes patient data.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • ICD-10 Coding Assistant

    maziyarpanahi/openmed

    Suggests candidate ICD-10-CM diagnosis and ICD-10-PCS procedure codes for clinical text extracted by OpenMed, with rationale for a certified coder to review.

    5.5k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • OpenMed ETL to OMOP CDM

    maziyarpanahi/openmed

    Maps OpenMed-extracted, terminology-coded conditions, drugs and measurements into OMOP CDM v5.4 tables for OHDSI and ATLAS analytics.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Extracting SDOH and Z-Codes

    maziyarpanahi/openmed

    Finds social risks such as housing instability or food insecurity in clinical notes and proposes matching ICD-10-CM Z-codes for a coder to confirm.

    5.5k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Questions about Running Openmed Ondevice

What does Running Openmed Ondevice do?

Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows. Running Openmed Ondevice is an agent skill from maziyarpanahi/openmed. Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows.

When should I use Running Openmed Ondevice?

Running Openmed Ondevice fits situations like: the user wants to deploy OpenMed at the edge; run NER/de-id on Apple Silicon; target iPhone/iPad/Mac; quantize a clinical model to int8/4-bit.

How do I install Running Openmed Ondevice in Claude Code?

Run `npx skills add maziyarpanahi/openmed --skill running-openmed-ondevice -a claude-code`. Or copy the skill folder (skills/running-openmed-ondevice in maziyarpanahi/openmed) into .claude/skills/running-openmed-ondevice in your project. Claude Code loads it when a task matches its description.

How do I install Running Openmed Ondevice in Codex?

Run `npx skills add maziyarpanahi/openmed --skill running-openmed-ondevice -a codex`. Or copy the skill folder (skills/running-openmed-ondevice in maziyarpanahi/openmed) into .agents/skills/running-openmed-ondevice in your project. Codex loads it when a task matches its description.

Can I use Running Openmed Ondevice in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add maziyarpanahi/openmed --skill running-openmed-ondevice -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/running-openmed-ondevice, .gemini/skills/running-openmed-ondevice, .github/skills/running-openmed-ondevice and .opencode/skills/running-openmed-ondevice in your project.

What does Running Openmed Ondevice need to run?

Going by SKILL.md and its folder, Running Openmed Ondevice needs the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Running Openmed Ondevice access the network?

SKILL.md names 5 domains. As links in the text: github.com, apple.github.io, onnx.ai, onnxruntime.ai and huggingface.co. This is read from the text; nothing was executed.

Is Running Openmed Ondevice safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Running Openmed Ondevice use?

Running Openmed Ondevice is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Running Openmed Ondevice use?

About 2k tokens (SKILL.md is roughly 8.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Running Openmed Ondevice?

Skills that share tags, products or a category with Running Openmed Ondevice: Onboard Jetpack5 Inference Backends (EGalahad/sim2real, 146 stars), Local Asr (ysyecust/lecture-to-notes, 273 stars), Quark Onnx Debug (amd/Quark, 182 stars) and Local Asr (cat-xierluo/legal-skills, 720 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Running Openmed Ondevice?

maziyarpanahi (a GitHub user) maintains it in maziyarpanahi/openmed, which has 5,506 GitHub stars. The repository holds 74 skills in this directory. The repository was last updated on October 11, 2026.

Source: maziyarpanahi/openmed on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.