pick-a-pii-model
できること
このスキルは、端末上で動く、テキストの中の個人情報を見つけるモデルを選ぶ方法をエージェントに教えます。保存されたモデルの一覧を使うので、選択はオフラインでも行えます。
使う場面
- ✓ノートパソコン、Apple SiliconのMac、スマートフォンで動く個人データの検出器が必要なチームがあるとき。
- ✓プロジェクトに特定の言語のテキストがあり、その言語に合う既定のプライバシーモデルが必要なとき。
- ✓プライバシーモデルを出荷する前に、直接の識別子を最初に捉えられるかを確かめる必要があるとき。
スキルのリンク
https://github.com/maziyarpanahi/openmed/blob/master/skills/pick-a-pii-model/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Mac上で英語の医療ノートにある人名を見つけるには、どのオフラインのモデルを使うべきですか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは同梱のモデル一覧を読み、言語、ファイル形式、サイズで絞ります。既定のモデルを優先し、出荷前にベンチマークを行うよう勧めます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
よくある質問
モデルをダウンロードしますか?
いいえ。候補の一覧は、同梱のリストだけを読み、モデルの重みはダウンロードしません。
小さいモデルは常に安全ですか?
いいえ。モデルのサイズや形式は、個人情報をよく見つけることを証明しないと、スキルは説明しています。
どの形式に対応していますか?
CPUとGPU用のPyTorch形式と、Apple Silicon用のMLX形式に触れています。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 5.8k
- ランキング
- #14719
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
annotating-variants
5.8kエージェントが、無料の公開アノテーターを使って、遺伝子バリアントの作用を予測し、HGVS名をゲノム上の位置に変換し、集団の頻度を付与できるよう支援します。
ask-openmed
5.8kエージェントが、臨床テキストの依頼に合ったOpenMedのワークフローを選べるよう支援します。患者データが含まれる可能性がある場合は、必ずプライバシーの確認から始めます。
assembling-fhir-bundles
5.8kエージェントが、複数のFHIR健康記録を、内部の参照を正しくつないだ一つのトランザクションBundleにまとめ、EHRに送れる状態にします。
auditing-deid-leakage
5.8kエージェントが、匿名化済みの臨床テキストに残っている識別子(SSN、カード番号、メール、日付など)をスキャンし、残っていれば公開を止めます。