{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "maziyarpanahi-openmed--run-a-local-pii-de-identification-api-for-clinical-text",
 "repo": "maziyarpanahi/openmed",
 "repo_url": "https://github.com/maziyarpanahi/openmed",
 "repo_slug": "maziyarpanahi-openmed",
 "title": "Run a local REST API that de-identifies clinical text",
 "page_title": "How to run a local REST API that de-identifies clinical text with Openmed",
 "summary": "Start the OpenMed REST service and call its PII extract and de-identify endpoints from your app.",
 "who": "A backend developer who must strip names, addresses and IDs from notes before they reach other systems.",
 "problem": "De-identification inside each app duplicates work and is hard to audit.",
 "outcome": "A local service on port 8080 with /pii/extract and /pii/deidentify endpoints.",
 "steps": [
  "Run `pip install --upgrade \"openmed[hf,service]\"`",
  "Start it with `python -m openmed.service.logging` plus `--host 0.0.0.0 --port 8080`",
  "Check GET /health returns 200 OK",
  "POST text to /pii/extract to see detected PII, and to /pii/deidentify to get redacted text",
  "Review a sample of outputs by hand before trusting it in a pipeline"
 ],
 "agent_prompt": "Start the maziyarpanahi/openmed REST service on port 8080 and write a client that sends <synthetic notes> to /pii/deidentify and saves the redacted text. Show me 3 before and after examples.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "This card is written from the maziyarpanahi/openmed README, not from a test run by Deduped. Before you start, make sure you have Python 3.10+ and pip. Check the repo for newer instructions before you rely on these steps.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.10+ and pip",
  "Optional: Apple Silicon for MLX, Android with ONNX Runtime Mobile, or a browser with WebGPU",
  "Model downloads from the Hugging Face Hub, or local model folders for offline use"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "health-data",
   "notice": "Automated de-identification can miss identifiers; it is not a compliance guarantee on its own."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/maziyarpanahi-openmed/run-a-local-pii-de-identification-api-for-clinical-text/",
 "md": "https://dedupedai.com/use-cases/maziyarpanahi-openmed/run-a-local-pii-de-identification-api-for-clinical-text/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/maziyarpanahi-openmed--run-a-local-pii-de-identification-api-for-clinical-text.json",
 "api_version": "v1"
}
