running-openmed-ondevice
यह क्या करती है
यह स्किल एजेंट को सिखाती है कि OpenMed मेडिकल टेक्स्ट मॉडल को किसी व्यक्ति के अपने डिवाइस पर बिना इंटरनेट के कैसे चलाएँ। इसमें Apple डिवाइस, iPhone और iPad ऐप, और ब्राउज़र सेटअप शामिल हैं।
कब इस्तेमाल करें
- ✓जब कोई टीम बिना डेटा सर्वर पर भेजे Mac या iPhone पर मेडिकल टेक्स्ट विश्लेषण चलाना चाहती है।
- ✓जब डेवलपर को मॉडल WebGPU या ONNX के ज़रिए वेब ब्राउज़र में चलाना हो।
- ✓जब उपयोगकर्ता छोटे डिवाइस के लिए क्लिनिकल मॉडल को 8-बिट या 4-बिट वज़न तक छोटा करना चाहता है।
Skill का लिंक
https://github.com/maziyarpanahi/openmed/blob/master/skills/running-openmed-ondevice/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं इस मेडिकल टेक्स्ट मॉडल को बिना इंटरनेट कनेक्शन के अपने Mac पर कैसे चला सकता हूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट मॉडल को चुने हुए रनटाइम के लिए फ़ॉर्मैट में बदलता है, चाहें तो उसे छोटा करता है, और उसे स्थानीय रूप से चलाता है। चूँकि कुछ भी डिवाइस से बाहर नहीं जाता, मरीज़ का टेक्स्ट डिवाइस पर ही रहता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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
| Backend | Extra | Best for | Quantization |
|---|---|---|---|
| MLX | openmed[mlx] |
Apple Silicon Macs; fastest local NER/de-id; on-device LLMs | 4-bit / 8-bit weights |
| CoreML | openmed[coreml] |
iOS/iPadOS/macOS apps, Neural Engine | int8 palettization |
| ONNX / WebGPU | openmed[onnx] |
cross-platform runtimes, browser (transformers.js) | fp16 (WebGPU); int8 via ORT |
Quick start — MLX (Apple Silicon)
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
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)
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)
pip install "openmed[coreml]"
python -m openmed.coreml.convert --model OpenMed/<some-ner-model> --output model.mlpackage --quantize int8
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
pip install "openmed[onnx]"
python -m openmed.onnx.convert --model OpenMed/<some-ner-model> --output ./onnx_out
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
- Pick the backend for the target (table above).
- Convert the HF/OpenMed model with the matching
convert()/python -m openmed.<backend>.convert. - Quantize if size/latency demands it (MLX 4/8-bit, CoreML int8, WebGPU
अक्सर पूछे जाने वाले सवाल
कौन-सा बैकएंड चुनूँ?
Apple Silicon Mac के लिए MLX, iPhone और iPad ऐप के लिए CoreML, और ब्राउज़र व दूसरी प्रणालियों के लिए ONNX या WebGPU इस्तेमाल करें।
क्या इसके लिए इंटरनेट चाहिए?
नहीं। स्किल कहती है कि अनुमान स्थानीय रूप से चलता है और नेटवर्क की ज़रूरत नहीं।
क्या होस्टेड सर्वर विकल्प शामिल है?
नहीं। स्किल सर्वर और एजेंट टूल सेटअप के लिए दूसरी स्किल्स की ओर इशारा करती है।
जानकारी
लेखक का मूल विवरण
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,
repo: maziyarpanahi/openmed
लोकप्रियता
- GitHub स्टार
- 5.8k
- रैंकिंग में स्थान
- #14728
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
annotating-variants
5.8kआपके एजेंट को मुफ़्त सार्वजनिक एनोटेटर से जेनेटिक वेरिएंट का असर बताने, HGVS नामों को जीनोम पोज़िशन में बदलने और जनसंख्या आवृत्ति जोड़ने में मदद करती है।
ask-openmed
5.8kआपके एजेंट को क्लिनिकल टेक्स्ट अनुरोध के लिए सही OpenMed वर्कफ़्लो चुनने में मदद करती है, जहाँ मरीज़ का डेटा हो सकता है वहाँ पहले गोपनीयता जाँच से शुरू करके।
assembling-fhir-bundles
5.8kकई FHIR स्वास्थ्य रिकॉर्ड को एक ट्रांज़ैक्शन Bundle में पैक करती है, जो EHR को भेजने के लिए तैयार हो और आंतरिक संदर्भ सही जुड़े हों।
auditing-deid-leakage
5.8kडी-आइडेंटिफ़ाइड क्लिनिकल टेक्स्ट में बचे पहचानकर्ता जैसे SSN, कार्ड नंबर, ईमेल और तारीखें खोजती है, और कुछ बचा हो तो रिलीज़ रोक देती है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।