annotating-variants
Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST,…
Select an on-device OpenMed PII model from the committed registry by language, runtime format, and size budget, then require recall validation before deployment. Use when an agent must choose a local PII detector for CPU, Apple Silicon, or a mobile export without relying on live
Claude Code
$ npx -y skills add maziyarpanahi/openmed --skill pick-a-pii-model --agent claude-code
Codex
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a codex -y
Cursor
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a cursor -y
Gemini CLI
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a gemini-cli -y
GitHub Copilot
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a github-copilot -y
OpenCode
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a opencode -y
Windsurf
$ npx skills add maziyarpanahi/openmed --skill pick-a-pii-model -a windsurf -y
name: pick-a-pii-model description: "Select an on-device OpenMed PII model from the committed registry by language, runtime format, and size budget, then require recall validation before deployment. Use when an agent must choose a local PII detector for CPU, Apple Silicon, or a mobile export without relying on live model discovery."
Use the committed registry to build an offline shortlist. Treat the language default as the safety baseline, but never treat model size or format as proof of recall.
1. Identify the input language and script before choosing a model. 2. Choose the runtime: `pytorch` for local CPU/GPU and mobile export sources, `mlx-fp` or `mlx-8bit` for Apple Silicon. 3. Read `get_default_pii_model(language)` as the baseline. 4. Filter `get_pii_models_by_language(language)` by runtime and device budget. 5. Prefer the baseline when it fits; otherwise select a compatible candidate. 6. Benchmark the candidate on direct identifiers, critical leakage, scripts, and the target quantization before shipping.
This snippet reads only the bundled manifest; it does not download weights.
from openmed import get_default_pii_model, get_pii_models_by_language
LANGUAGE = "en"
TARGET_FORMAT = "mlx-fp" # Use "pytorch" for CPU or as an export source.
MAX_PARAMETERS_M = 150
baseline_id = get_default_pii_model(LANGUAGE)
models = get_pii_models_by_language(LANGUAGE)
shortlist = [
(key, info)
for key, info in models.items()
if TARGET_FORMAT in info.formats
and info.size_mb is not None
and info.size_mb <= MAX_PARAMETERS_M
]
shortlist.sort(
key=lambda item: (
item[1].model_id != baseline_id,
item[1].size_mb,
item[0],
)
)
if not shortlist:
raise RuntimeError("No compatible PII model fits the requested budget")
registry_key, selected = shortlist[0]
print(
{
"registry_key": registry_key,
"model_id": selected.model_id,
"format": TARGET_FORMAT,
"parameters_m": selected.size_mb,
"recommended_confidence": selected.recommended_confidence,
"is_language_default": selected.model_id == baseline_id,
}
)
print("Benchmark this candidate against the language default before release.")For Android, Core ML, ONNX, or browser deployment, select a compatible `pytorch` source and use the target export workflow. Re-run PII recall after conversion or quantization.
peak memory, or quality.
introduces residual critical leakage.
Read [the PII model comparison example](../../examples/pii_model_comparison.py) for registry inspection and model-by-model inference.
Local-first healthcare AI: clinical NER and HIPAA PII de-identification on hardware you control. 2,200+ medical models, 35 model-backed PII languages, and Python, MLX, Android and browser runtimes. Apache-2.0 SDK.
Annotates VCF variants and normalizes HGVS nomenclature with public, license-free annotators (Ensembl VEP REST,…
Choose the first OpenMed workflow skill for an intake, privacy, extraction, exchange, or verification request using deterministic…
Package multiple FHIR R4 resources produced from OpenMed output into a single valid transaction Bundle ready to POST to an EHR,…
Adversarially scan already-de-identified clinical text for residual identifiers and emit a leakage report that blocks release on…
Produce a signed, reproducible, no-PHI audit trail for an OpenMed de-identification run via deidentify(audit=True). Use when the…
Generates and verifies 21 CFR Part 11-style audit trails — who/what/when, electronic signatures, and tamper-evidence — for…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…