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.
GateReport, fairness_report, error_report) andneed to turn them into intended-use, metrics, and limitations sections.
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.
See references/model-card-sections.md for the full section-to-source map. The
load-bearing sections for an OpenMed model:
(Apache-2.0). Pull from the GateReport identity fields.
clinical decisions; de-id is verified, not assumed.
recall floors and the gate decision.
fairness_report, including which groups lack data.
error_report; calibration assumptions.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.
pinned model + synthetic eval set.
GateReport identity fields so the card,models.jsonl, and the README cannot drift (the gate's manifest_coherence
and model_card checks enforce this).
deployment envelope. Over-broad intended-use is the most common card failure.
gate decision, not F1.
ethnicity isn't available, say so rather than implying parity.
matrix's worst cells.
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.
evaluating-with-leakage-gates (GateReport),benchmarking-clinical-ner (error_report), and auditing-subgroup-fairness
(fairness_report): these are the card's evidence.
building-with-openmed / models.jsonl: keep card front matter(license, task, languages) coherent with the manifest — the gate checks it.
gating-deid-leakage: cite the green gate as the card'srelease evidence.
trace to an eval artifact and a pinned eval-set hash.
else out-of-scope.
itself a limitation to state — don't let absence read as equity.
the card and models.jsonl trip manifest_coherence.
error_report; neverpaste real patient strings as "qualitative examples".
(G4) per format; don't reuse the fp32 numbers.
https://arxiv.org/abs/1810.03993
https://huggingface.co/docs/hub/model-cards
users* (clinical "model facts" label): https://doi.org/10.1038/s41746-020-0253-3
https://www.fda.gov/regulatory-information/search-fda-guidance-documents/clinical-decision-support-software
references/model-card-sections.md.