Skip to content
Skillpedia
Machine learning5.8k · #14682

choosing-openmed-models

What it does

This skill helps find the right OpenMed model for a clinical or biomedical task, using the model registry rather than a fixed list. It is for people who know their task but not which model to load.

When to use it

  • ✓When you know the task, such as finding diseases or tumors, but not the model name.
  • ✓When you need a privacy model for a specific language.
  • ✓When you want to filter models by size, task or tier before loading one.

Skill link

https://github.com/maziyarpanahi/openmed/blob/master/skills/choosing-openmed-models/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/choosing-openmed-models/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Which OpenMed model should I use to find diseases in Spanish discharge notes?”

5 new skills a week. 1 minute to read.

How it works

The agent queries the model registry at runtime for categories and models, checks each candidate's labels and details, and returns a model key to load.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Choosing OpenMed Models

OpenMed ships a registry of clinical and biomedical NER models grouped into 12 categories. Never hardcode a model list — query the registry at runtime so your code stays correct as models are added. This skill helps you go from "I need to find diseases in Spanish discharge notes" to a concrete model key.

When to use

  • The user knows the task (find diseases / tumors / PHI) but not the model.
  • You need the right PII model for a language (es, fr, de, …).
  • You want to filter models by size, task, or tier before loading.
  • You want to inspect a model's labels, params, and license first.

Once you have a key, hand off to loading-openmed-models to load it.

Install

pip install openmed         # registry queries work without the [hf] extra

Quick start: browse categories, then pick

import openmed

# 1) The 12 categories
openmed.list_model_categories()
# ['Medical', 'Privacy', 'Anatomy', 'Hematology', 'Chemical', 'Disease',
#  'Genomics', 'Oncology', 'Species', 'Pathology', 'Pharmaceutical', 'Protein']

# 2) Models in a category -> list[ModelInfo]
for m in openmed.get_models_by_category("Disease"):
    print(m.model_id, "|", m.size_category, "|", m.entity_types)

# 3) Inspect one model before loading
info = openmed.get_model_info("OpenMed/OpenMed-NER-DiseaseDetect-BigMed-278M")
print(info.display_name, info.task, info.param_count, info.license)

get_models_by_category and get_all_models return ModelInfo objects. get_all_models() returns a dict[str, ModelInfo] keyed by registry key.

What ModelInfo tells you

Every model exposes (real attributes):

model_id          # HF repo id, e.g. "OpenMed/OpenMed-NER-DiseaseDetect-BigMed-278M"
display_name      # human-friendly name
category          # one of the 12 categories
specialization    # e.g. "disease entity detection"
entity_types      # list[str] of labels the model emits, e.g. ["DISEASE", ...]
size_category     # "Tiny" | "Small" | "Medium" | "Large" | "XLarge"
recommended_confidence   # suggested confidence_threshold for this model
family            # "NER" | "PII" | ...
task              # "token-classification"
languages         # e.g. ["en"], ["es"]
param_count       # e.g. 278000000
license           # e.g. "apache-2.0"

Use entity_types to confirm the model emits the labels you need, and recommended_confidence as a sensible default confidence_threshold.

Disease vs Oncology vs Privacy: worked choices

import openmed

# Disease conditions in a general clinical note:
disease = openmed.get_models_by_category("Disease")
# e.g. "OpenMed/OpenMed-NER-DiseaseDetect-BigMed-278M"
#      "OpenMed/OpenMed-NER-DiseaseDetect-BioClinical-108M" (smaller/faster)

# Tumors, staging, oncologic findings -> Oncology, not Disease:
onco = openmed.get_models_by_category("Oncology")
# e.g. "OpenMed/OpenMed-NER-OncologyDetect-BigMed-278M"

# PHI / PII detection -> Privacy category:
privacy = openmed.get_models_by_category("Privacy")

Rule of thumb: bigger (278M/560M) = more accurate, slower; smaller (108M, "Small"/"Tiny") = faster, edge-friendly. Start with a mid-size model and size up only if recall is short.

Pick a PII model by language

import openmed

# All PII models for Spanish -> dict[str, ModelInfo]
es_models = openmed.get_pii_models_by_language("es")

# The recommended default PII model id for a language:
default_es = openmed.get_default_pii_model("es")
print(default_es)   # HF repo id, or None if unsupported

deidentify(..., lang="es") and extract_pii(..., lang="es") already select an appropriate default — use these helpers when you need to override or to confirm coverage. Supported de-id languages live in openmed.SUPPORTED_LANGUAGES (en es pt fr de it nl hi te ar tr ja).

Structured search with ModelQuery

For filtering by task, language, size, or tier, use the typed search:

from openmed import search_models, ModelQuery

results = search_models(ModelQuery(
    task="token-classification",
    language="en",
    max_params=200_000_000,   # keep it small for on-device
    license="apache-2.0",
))
for r in results:
    print(r.repo_id, r.param_count, r.languages, r.formats)

Each result is a ModelSearchResult with fields like repo_id, family, task, languages, tier, param_count, architecture, base_model, formats, canonical_labels, license, and released. ModelQuery filters include `task

FAQ

Do I need to memorize model names?

No. The skill looks them up from the registry, so it stays current as models are added.

Can I check a model before loading it?

Yes. The skill helps inspect a model's labels, size and license first.

What do I need installed?

Just the openmed Python package, since registry queries work without the extra model runtime.

Details

Original description by the author

Discover and pick the right OpenMed model for a clinical or biomedical task, domain, or language. Use when the user asks which OpenMed model to use, wants to list model categories, find a Disease vs Oncology vs Privacy/PII model, get a PII model for a specific language, search models by size or task, or inspect a model's labels and metadata before loading. Covers list_model_categories, get_models_by_category, get_pii_models_by_language, get_default_pii_model, search_models(ModelQuery(...)), get_model_info, and the openmed models CLI. Pairs with loading-openmed-models.

repo: maziyarpanahi/openmed

Popularity

GitHub stars
5.8k
Ranking position
#14682
License
Apache-2.0
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills