loading-openmed-models

loading-openmed-models is a skill for Claude Code, Codex from maziyarpanahi/openmed. It costs 118 tokens per session (2,049 once invoked), scanned A, original, Apache-2.0.

Instructions for loading OpenMed clinical and biomedical named-entity recognition models from Hugging Face or a local folder. These models identify terms such as diseases in text.

In plain words
What is it for?
Use them to choose a model name, control its cache location and computing device, load it once for repeated work, or run it from a local copy.
Why use it?
They help avoid downloading or loading the same model repeatedly and support use in offline or restricted environments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Part of the openmed-skills plugin — 74 skills shipped together

Good fit Use them to choose a model name, control its cache location and computing device, load it once for repeated work, or run it from a local copy.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/maziyarpanahi/openmed/loading-openmed-models
About the project

OpenMed is local-first healthcare AI software that extracts clinical information and removes personally identifying details from clinical text on hardware controlled by the user. Healthcare developers use its Python runtime, Apple Silicon and mobile SDKs, and browser support for on-device clinical NER and PII de-identification.

maziyarpanahi/openmed · 5,263 stars · on GitHub · openmed.life

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add maziyarpanahi/openmed --skill loading-openmed-models
Clone the repo
git clone --depth 1 https://github.com/maziyarpanahi/openmed

Made for: Claude Code, Codex.

Or install openmed-skills, the plugin that ships this one along with the rest of its 74 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for loading-openmed-models

README.md
[![agentmods](https://agentmods.dev/badge/skills/maziyarpanahi/openmed/loading-openmed-models.svg)](https://agentmods.dev/skills/maziyarpanahi/openmed/loading-openmed-models)
Your own site
<a href="https://agentmods.dev/skills/maziyarpanahi/openmed/loading-openmed-models"><img src="https://agentmods.dev/badge/skills/maziyarpanahi/openmed/loading-openmed-models.svg" alt="Measured on agentmods" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,049 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00118 $0.02049
Opus 5 $0.00059 $0.01025
Sonnet 5 $0.00024 $0.00410
Haiku 4.5 $0.00012 $0.00205

Measured 9d ago against content hash 5ffe26d4c7eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

loading-openmed-models scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

skills/loading-openmed-models/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Loading OpenMed Models

OpenMed models download once from the Hugging Face Hub into a local cache, then run fully on-device — no network, no telemetry. This skill covers how to load a model, reuse it across many calls without reloading weights, point at a local copy, and run offline.

When to use

  • You are about to run NER repeatedly and want to load the model once.
  • You need to control where weights are cached (cache_dir) or force CPU/GPU.
  • You must run offline in a locked-down or air-gapped environment.
  • You are choosing between a registry key, a full HF id, or a local directory.

For which model to load, see choosing-openmed-models. To actually run it, see extracting-clinical-entities.

Install

pip install "openmed[hf]"   # adds Hugging Face transformers + hub download

The three ways to name a model

analyze_text, extract_pii, load_model, and ModelLoader.load_model all accept the same model_name in three forms:

Form Example Notes
Registry key "disease_detection_superclinical" Short, resolved via the bundled registry.
Full HF id "OpenMed/OpenMed-NER-DiseaseDetect-BigMed-278M" Anything org/name; downloaded from the Hub.
Local path "/models/my-openmed-ner" An existing directory; loaded with local_files_only=True.

A bare name without / is prefixed with the default org (OpenMed). An existing local path is detected automatically and never hits the network.

Quick start: load and reuse a loader

The single most important pattern — build one ModelLoader, pass it everywhere. The loader caches models, tokenizers, and pipelines in memory, so the second call is instant.

import openmed
from openmed import ModelLoader, OpenMedConfig

# One loader, reused across calls. Weights load on the first call only.
loader = ModelLoader()

notes = [
    "Patient prescribed 500 mg metformin for type 2 diabetes.",
    "History of myocardial infarction; started on atorvastatin.",
]

for note in notes:
    result = openmed.analyze_text(
        note,
        model_name="disease_detection_superclinical",
        loader=loader,          # <-- reuse; no reload on subsequent calls
        output_format="dict",
    )
    print(result.entities)

Read the full file on GitHub · 216 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 216 lines · 118 tokens per session scan A 5ffe26d4c7eb

Subscribe to this mod's changes

loading-openmed-models is a skill published in the GitHub repository maziyarpanahi/openmed (5,263 stars, last pushed today), licensed Apache-2.0. It adds 118 tokens to every session and 2,049 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

saelens

Train sparse autoencoders to interpret model features.

NousResearch/hermes-agent · 14 tokens

add-new-model

Use this skill when the user wants to add or port a new model architecture to MLX-VLM — mapping a Hugging Face modeltype to a new file under mlxvlm/models, writing the ModelConfig, matching layer/weight names, reusing a similar existing model, adding a test class, and validating the port. Covers vision-language…

Blaizzy/mlx-vlm · 83 tokens

benchmarking

Use this skill when the user wants to benchmark an MLX-VLM change and present the numbers in a PR — fork-vs-main A/B comparisons, isolated-module micro-benchmarks, median-of-N timing with warmup, peak-memory reporting, correctness checks, parameter sweeps, and self-contained reproducible bench scripts to paste into a…

Blaizzy/mlx-vlm · 74 tokens

convert-quantize

Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlxvlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to…

Blaizzy/mlx-vlm · 99 tokens

cli-inference

Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlxvlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.

Blaizzy/mlx-vlm · 67 tokens

server-inference

Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlxvlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.

Blaizzy/mlx-vlm · 80 tokens