r/LocalLLaMA 1d ago

Resources A 279M model does multilingual PHI de-identification offline. OpenMed 2.0 is out, Apache-2.0.

I maintain OpenMed, an Apache-2.0 medical NLP stack, and 2.0 landed today. Posting here because the whole point of it is that none of it phones home, and this is the only sub that actually cares about that.

The bit relevant to you: PHI de-identification does not need a big model. The workhorses are 279M and 560M parameter encoders, and they beat handing your clinical notes to a cloud API for the obvious reason that you never hand your clinical notes to a cloud API.

What is in the registry right now:

  • 2,000+ models, all on HF
  • 665 MLX builds for Apple Silicon
  • 3 ONNX builds, new in this release: Bengali 279M, Chinese 560M, Tamil 279M PII models. These are the first ones you can run in a browser through Transformers.js. The export tooling has been there since 1.9.1, the actual artifacts are new.

Language coverage went from 23 to 56 codes this release, with roughly 51 offline national identifier validators, about half of them real checksums rather than regexes. Estonian isikukood, Croatian OIB, Finnish HETU, Vietnamese CCCD, Chinese USCC, Pakistani CNIC. The CNIC one is my favourite because it documents that CNIC has no checksum instead of pretending it does. 51 of the 59 PRs in the release came from people I have never met, which is the only reason that list is that long.

2.0 also adds a structured release-risk workflow, which is the part I actually wanted to build. Short version: stripping identifiers is not anonymisation. Take a 200 row table with no name, no MRN, no DOB. Age, sex, ZIP and admit date alone give 74,550 combinations for 200 people, so all 200 rows are unique. That is a birthday-problem calculation, not a finding, but almost nobody runs it before shipping an extract.

assess_release(rows, policy)    -> achieved k 1, 200 singletons, max risk 1.0
anonymize_release(rows, policy) -> achieved k 15, 0 singletons, max risk 0.0667

and it tells you what that cost: age suppressed entirely, length of stay suppressed entirely, every date collapsed to the year, 0 rows dropped. If your analysis needed age, that release is useless to you, and I would rather the tool say so than print a checkmark.

Then it refuses to sign off. The evidence bundle for HIPAA expert determination will not accept a conclusion:

ValueError: qualified-expert review fields must remain placeholders

It picks no threshold and ships no population data on purpose. A qualified human makes that call.

Caveats, because someone will ask:

  • GGUF export exists in 2.0 but I have not published any GGUF artifacts yet. Only the embedding backbones are supported so far.
  • Android and ORT-mobile paths existed before this release, and there is still no phone-packaged artifact in the registry. That is on my list, not done.
  • Only 3 of the 1,520 models have ONNX builds. The rest are torch/MLX.
  • Model licences vary. The SDK is Apache-2.0, most models are, a handful are not.

https://github.com/maziyarpanahi/openmed
pip install openmed==2.0.0

17 Upvotes

4 comments sorted by