Authoring Model Cards
A model card is the honest spec sheet for a model: what it's for, how well it
works, where it breaks, and who it might fail. For clinical models this is
governance-critical — an undocumented de-id model is one nobody can sign off on.
This skill fills a model card directly from OpenMed eval outputs so the numbers
are reproducible, not aspirational.
When to use this skill
- You're publishing or updating an OpenMed model and need its card.
- You have eval artifacts (
GateReport, fairness_report, error_report) and
need to turn them into intended-use, metrics, and limitations sections.
- A clinical AI governance / model-risk review needs a transparency document.
Run the evals first (see evaluating-with-leakage-gates,
benchmarking-clinical-ner, auditing-subgroup-fairness); this skill documents
their results — it does not generate the numbers.
Card sections (Mitchell et al., + clinical extensions)
See references/model-card-sections.md for the full section-to-source map. The
load-bearing sections for an OpenMed model:
- Model details — repo id, family, tier, format, params, milestone, license
(Apache-2.0). Pull from the
GateReport identity fields.
- Intended use — the clinical task and the deployment envelope.
- Out-of-scope / misuse — explicitly: not a medical device; not for autonomous
clinical decisions; de-id is verified, not assumed.
- Metrics — entity-level P/R/F1 and, for de-id, residual leakage + per-label
recall floors and the gate decision.
- Quantitative analysis (subgroups) — per-group leakage/recall from
fairness_report, including which groups lack data.
- Limitations — error patterns from
error_report; calibration assumptions.
- Caveats & disclaimer — the medical-device disclaimer.
Quick start — fill the card from eval outputs
from openmed.eval import (
run_suite, ReleaseGate, fairness_report, error_report,
)
report = run_suite("eval/gold/test.json", suite="golden",
model_name="OpenMed/Privacy-PII-Detection", device="cpu",
metadata={"family": "PII", "tier": "base",
"policy": "hipaa_safe_harbor"})
gate = ReleaseGate(milestone="v1.6", policy="hipaa_safe_harbor").evaluate(report)
fair = fairness_report("OpenMed/Privacy-PII-Detection", "golden")
errs = error_report("OpenMed/Privacy-PII-Detection", "eval/gold/test.json")
card = {
"model_details": {
"repo_id": gate.repo_id, "family": gate.family, "tier": gate.tier,
"format": gate.format, "license": "Apache-2.0",
},
"metrics": {
"exact_span_f1": report.metrics["exact_span_f1"]["f1"],
"residual_leakage_rate": gate.residual_leakage_rate,
"critical_leakage_count": gate.critical_leakage_count,
"per_label_recall": dict(gate.per_label_recall),
"release_decision": gate.decision, # RELEASABLE / QUARANTINED
},
"subgroup_analysis": fair.to_dict(), # per-group leakage/recall
"limitations": errs.to_dict()["confusion_matrix"],
}
# Render `card` into Markdown front matter + body (or the HF card template).
error_report and fairness_report carry no plaintext PHI (offsets + hashes),
so their output is safe to paste into a public card.
Workflow
- Gather artifacts. Gate report, fairness report, error report — all from a
pinned model + synthetic eval set.
- Fill model details from the
GateReport identity fields so the card,
models.jsonl, and the README cannot drift (the gate's manifest_coherence
and model_card checks enforce this).
- Write intended use narrowly. Name the clinical task, language(s), and the
deployment envelope. Over-broad intended-use is the most common card failure.
- State out-of-scope and the disclaimer plainly (see template below).
- Report metrics with their floors. For de-id, lead with leakage and the
gate decision, not F1.
- Report subgroups honestly, including the documentation gap: if race/
ethnicity isn't available, say so rather than implying parity.
- List limitations from real errors, not boilerplate — cite the confusion
matrix's worst cells.
Disclaimer block (paste & adapt)
This model assists clinical text processing and is not a medical device.
It does not make autonomous clinical decisions. De-identification output must be
independently verified before any data is shared; residual PHI risk is never
zero. Validate on your own population before deployment.
Hand-off to / from OpenMed
- From
evaluating-with-leakage-gates (GateReport),
benchmarking-clinical-ner (error_report), and auditing-subgroup-fairness
(fairness_report): these are the card's evidence.
- To
building-with-openmed / models.jsonl: keep card front matter
(license, task, languages) coherent with the manifest — the gate checks it.
- Pairs with
gating-deid-leakage: cite the green gate as the card's
release evidence.
Edge cases & gotchas
- Don't claim numbers you can't reproduce. Every metric in the card should
trace to an eval artifact and a pinned eval-set hash.
- Intended use ≠ capability. Document the supported envelope; mark everything
else out-of-scope.
- Subgroup silence is a finding. Omitting race because it wasn't collected is
itself a limitation to state — don't let absence read as equity.
- Card/manifest drift fails the gate. License/task/language mismatches between
the card and
models.jsonl trip manifest_coherence.
- No raw PHI examples. Use the offset/hash examples from
error_report; never
paste real patient strings as "qualitative examples".
- Quantized variants need their own line. Report INT8/INT4 recall deltas
(G4) per format; don't reuse the fp32 numbers.
Standards & references
1---2name: authoring-model-cards3description: Generate a model card for an OpenMed clinical NER or de-identification model documenting intended use, quantitative metrics, subgroup performance, limitations, and a medical-device disclaimer for clinical AI governance. Use when the user wants to write or update a model card, a README model section, or governance documentation, or to turn OpenMed eval outputs (release gate report, fairness_report, error_report) into the card's metrics and limitations sections. Trigger on "model card", "intended use", "model documentation", "governance", "limitations section", "datasheet", or "FDA/ONC transparency" for an OpenMed model.4license: Apache-2.05---67# Authoring Model Cards89A model card is the honest spec sheet for a model: what it's for, how well it10works, where it breaks, and who it might fail. For clinical models this is11governance-critical — an undocumented de-id model is one nobody can sign off on.12This skill fills a model card directly from OpenMed eval outputs so the numbers13are reproducible, not aspirational.1415## When to use this skill1617- You're publishing or updating an OpenMed model and need its card.18- You have eval artifacts (`GateReport`, `fairness_report`, `error_report`) and19 need to turn them into intended-use, metrics, and limitations sections.20- A clinical AI governance / model-risk review needs a transparency document.2122Run the evals **first** (see `evaluating-with-leakage-gates`,23`benchmarking-clinical-ner`, `auditing-subgroup-fairness`); this skill documents24their results — it does not generate the numbers.2526## Card sections (Mitchell et al., + clinical extensions)2728See `references/model-card-sections.md` for the full section-to-source map. The29load-bearing sections for an OpenMed model:3031- **Model details** — repo id, family, tier, format, params, milestone, license32 (Apache-2.0). Pull from the `GateReport` identity fields.33- **Intended use** — the clinical task and the deployment envelope.34- **Out-of-scope / misuse** — explicitly: not a medical device; not for autonomous35 clinical decisions; de-id is verified, not assumed.36- **Metrics** — entity-level P/R/F1 and, for de-id, residual leakage + per-label37 recall floors and the gate decision.38- **Quantitative analysis (subgroups)** — per-group leakage/recall from39 `fairness_report`, including which groups lack data.40- **Limitations** — error patterns from `error_report`; calibration assumptions.41- **Caveats & disclaimer** — the medical-device disclaimer.4243## Quick start — fill the card from eval outputs4445```python46from openmed.eval import (47 run_suite, ReleaseGate, fairness_report, error_report,48)4950report = run_suite("eval/gold/test.json", suite="golden",51 model_name="OpenMed/Privacy-PII-Detection", device="cpu",52 metadata={"family": "PII", "tier": "base",53 "policy": "hipaa_safe_harbor"})5455gate = ReleaseGate(milestone="v1.6", policy="hipaa_safe_harbor").evaluate(report)56fair = fairness_report("OpenMed/Privacy-PII-Detection", "golden")57errs = error_report("OpenMed/Privacy-PII-Detection", "eval/gold/test.json")5859card = {60 "model_details": {61 "repo_id": gate.repo_id, "family": gate.family, "tier": gate.tier,62 "format": gate.format, "license": "Apache-2.0",63 },64 "metrics": {65 "exact_span_f1": report.metrics["exact_span_f1"]["f1"],66 "residual_leakage_rate": gate.residual_leakage_rate,67 "critical_leakage_count": gate.critical_leakage_count,68 "per_label_recall": dict(gate.per_label_recall),69 "release_decision": gate.decision, # RELEASABLE / QUARANTINED70 },71 "subgroup_analysis": fair.to_dict(), # per-group leakage/recall72 "limitations": errs.to_dict()["confusion_matrix"],73}74# Render `card` into Markdown front matter + body (or the HF card template).75```7677`error_report` and `fairness_report` carry no plaintext PHI (offsets + hashes),78so their output is safe to paste into a public card.7980## Workflow81821. **Gather artifacts.** Gate report, fairness report, error report — all from a83 pinned model + synthetic eval set.842. **Fill model details** from the `GateReport` identity fields so the card,85 `models.jsonl`, and the README cannot drift (the gate's `manifest_coherence`86 and `model_card` checks enforce this).873. **Write intended use narrowly.** Name the clinical task, language(s), and the88 deployment envelope. Over-broad intended-use is the most common card failure.894. **State out-of-scope and the disclaimer** plainly (see template below).905. **Report metrics with their floors.** For de-id, lead with leakage and the91 gate decision, not F1.926. **Report subgroups honestly**, including the documentation gap: if race/93 ethnicity isn't available, say so rather than implying parity.947. **List limitations from real errors**, not boilerplate — cite the confusion95 matrix's worst cells.9697### Disclaimer block (paste & adapt)9899> This model assists clinical text processing and is **not a medical device**.100> It does not make autonomous clinical decisions. De-identification output must be101> independently verified before any data is shared; residual PHI risk is never102> zero. Validate on your own population before deployment.103104## Hand-off to / from OpenMed105106- **From** `evaluating-with-leakage-gates` (`GateReport`),107 `benchmarking-clinical-ner` (`error_report`), and `auditing-subgroup-fairness`108 (`fairness_report`): these are the card's evidence.109- **To** `building-with-openmed` / `models.jsonl`: keep card front matter110 (license, task, languages) coherent with the manifest — the gate checks it.111- **Pairs with** `gating-deid-leakage`: cite the green gate as the card's112 release evidence.113114## Edge cases & gotchas115116- **Don't claim numbers you can't reproduce.** Every metric in the card should117 trace to an eval artifact and a pinned eval-set hash.118- **Intended use ≠ capability.** Document the supported envelope; mark everything119 else out-of-scope.120- **Subgroup silence is a finding.** Omitting race because it wasn't collected is121 itself a limitation to state — don't let absence read as equity.122- **Card/manifest drift fails the gate.** License/task/language mismatches between123 the card and `models.jsonl` trip `manifest_coherence`.124- **No raw PHI examples.** Use the offset/hash examples from `error_report`; never125 paste real patient strings as "qualitative examples".126- **Quantized variants need their own line.** Report INT8/INT4 recall deltas127 (G4) per format; don't reuse the fp32 numbers.128129## Standards & references130131- Mitchell et al., *Model Cards for Model Reporting* (FAT* 2019):132 https://arxiv.org/abs/1810.03993133- Hugging Face model card spec & template:134 https://huggingface.co/docs/hub/model-cards135- Sendak et al., *Presenting machine learning model information to clinical end136 users* (clinical "model facts" label): https://doi.org/10.1038/s41746-020-0253-3137- FDA, *Clinical Decision Support Software* guidance:138 https://www.fda.gov/regulatory-information/search-fda-guidance-documents/clinical-decision-support-software139- Section-to-source map: `references/model-card-sections.md`.