pick-a-pii-model
What it does
This skill teaches an agent how to pick a model that finds personal details in text and runs on a local device. It uses a saved list of models, so the choice works offline.
When to use it
- ✓When a team needs a personal data detector that runs on a laptop, an Apple Silicon Mac, or a phone.
- ✓When a project has text in a specific language and needs the right default privacy model for it.
- ✓When a user is about to ship a privacy model and needs to check that it catches direct identifiers first.
Skill link
https://github.com/maziyarpanahi/openmed/blob/master/skills/pick-a-pii-model/SKILL.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Which offline model should I use to find personal names in my English medical notes on a Mac?”
5 new skills a week. 1 minute to read.
How it works
The agent reads a built-in list of models and filters it by language, file format, and size. It prefers the default model and recommends a benchmark before shipping.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Pick an on-device PII model
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.
Procedure
- Identify the input language and script before choosing a model.
- Choose the runtime:
pytorchfor local CPU/GPU and mobile export sources,mlx-fpormlx-8bitfor Apple Silicon. - Read
get_default_pii_model(language)as the baseline. - Filter
get_pii_models_by_language(language)by runtime and device budget. - Prefer the baseline when it fits; otherwise select a compatible candidate.
- Benchmark the candidate on direct identifiers, critical leakage, scripts, and the target quantization before shipping.
Runnable offline shortlist
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.
Selection rules
- Reject an unsupported language instead of silently falling back to English.
- Prefer audited script coverage over a model's name or marketing description.
- Treat parameter count as a rough capacity signal, not download size, latency, peak memory, or quality.
- Measure latency and peak memory on the real target device.
- Fail closed when conversion or quantization drops direct-identifier recall or introduces residual critical leakage.
- Cache approved weights locally and set offline mode for steady-state use.
Repository example
Read the PII model comparison example for registry inspection and model-by-model inference.
FAQ
Does it download models?
No. The shortlist reads only a bundled list and does not download model weights.
Is a smaller model always safer?
No. The skill says model size or format does not prove the model finds personal details well.
Which formats does it handle?
It mentions PyTorch for CPU and GPU use and MLX formats for Apple Silicon.
Details
Original description by the author
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.
repo: maziyarpanahi/openmed
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14719
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
annotating-variants
5.8kHelps your agent predict what a genetic variant does, convert HGVS names to genome positions and attach population frequencies, using free public annotators.
ask-openmed
5.8kHelps your agent pick the right OpenMed workflow for a clinical text request, starting with a privacy check whenever patient data may be present.
assembling-fhir-bundles
5.8kPackages several FHIR health records into one transaction Bundle ready to send to an EHR, with the internal references linked correctly.
auditing-deid-leakage
5.8kScans de-identified clinical text for leftover identifiers such as SSNs, card numbers, emails and dates, and blocks release if any remain.
Similar skills
pytorch-patterns
280kHelps your agent use PyTorch for machine learning models. It applies best practices for efficient model training and ensures reproducible results.
evm-token-decimals
280kHelps your agent avoid errors with decimal numbers across different blockchain networks. It ensures token values are accurate in transactions and calculations.
ito-inference
280kLets your agent check the availability of AI models for use. It connects the compute request with the ready model service.