serving-openmed-rest-api
Skill by maziyarpanahi
Sets up OpenMed's FastAPI REST service for clinical NER, PII extraction, and de-identification. It suits developers who need to serve OpenMed over HTTP inside their own infrastructure.
Install serving-openmed-rest-api
Built from the published package, never by AI.
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.claude/skills && cp -r /tmp/openmed/skills/serving-openmed-rest-api ~/.claude/skills/serving-openmed-rest-apiRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
Step-by-step: install serving-openmed-rest-api in Claude Code
git clone --depth 1 https://github.com/maziyarpanahi/openmed /tmp/openmed && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/openmed/skills/serving-openmed-rest-api ~/.gemini/antigravity-cli/skills/serving-openmed-rest-apiAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install serving-openmed-rest-api in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides the setup of openmed.service, a FastAPI app that exposes OpenMed's clinical NER, PII extraction, and de-identification over HTTP. It covers installing the service extra, launching the app with uvicorn or building it with create_app, and calling the endpoints for health, analysis, PII extraction, de-identification, and model management. It also covers configuring the runtime through environment variables, such as model preloading, keep-alive, resident model limits, and dynamic batching.
The service is designed to be self-hosted. Models run on-device, the source states there is no telemetry, and request schemas reject unknown fields. The skill also gives a Dockerfile example and notes on keeping PHI out of logs. It is aimed at teams building an internal de-identification microservice, an NER backend, or a containerized inference tier.
Written from the project's SKILL.md and checked against it.
What it can do
- GET /healthReturns liveness, version, and the active configuration profile.
- POST /analyzeRuns clinical named entity recognition on a text input.
- POST /pii/extractDetects PII and PHI spans in submitted text.
- POST /pii/deidentifyMasks, removes, replaces, hashes, or shifts dates in PHI.
- GET /models/loadedReports the cache and keep-alive status of resident models.
- POST /models/unloadUnloads one model or all inactive models to free memory.
- ServiceRuntime env varsConfigures preloading, keep-alive, resident model caps, and batching.
- Container setupShows a Dockerfile that runs the service on port 8000.
What you need
- Python
- pip with the openmed[service] extra (FastAPI, uvicorn, pydantic)
- Docker (only for the containerized setup)
Try asking
- Set up OpenMed as a FastAPI service on port 8000 for clinical NER.
- Write a Dockerfile that serves OpenMed and preloads a clinical NER model.
- Show me how to call the /pii/deidentify endpoint with mask as the method.
Good to know
- The app has no built-in authentication, CORS, or TLS. A reverse proxy or gateway is needed.
- Request and response body logging should be avoided because it can expose PHI.
- Responses with keep_mapping or policy can re-identify patients and must be handled securely.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/serving-openmed-rest-api/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to serving-openmed-rest-api
All alternatives →Searches arXiv for scientific papers and preprints, extracts their metadata and abstracts, and downloads PDF or HTML full text. Suited to users who need research papers, literature or specific arXiv IDs.
Downloads AlphaFold predicted structures and PAE matrices for a UniProt ID, then reports pLDDT confidence, domain boundaries and disorder. Built for users who already have a UniProt accession.
Queries the QuickGO and Evidence & Conclusion Ontology REST API to map genes to Gene Ontology terms. Built for researchers doing functional annotation and GO hierarchy exploration.
Connects an AI assistant to Peloton to browse fitness classes, check live and archived schedules, and manage workouts. Built for Peloton users who want to plan rides from their assistant.
Queries NCBI Gene through the E-utilities and Datasets API. It helps researchers search genes by symbol or ID, retrieve gene details, and run batch lookups for annotation and functional analysis.
Prepares and launches nf-core/pacsomatic runs for matched tumor-normal PacBio HiFi data starting from unaligned BAM files. It generates samplesheets and pinned launch artifacts, then runs locally or submits to a scheduler.
Compare with literature-search-arxiv, alphafold-database-fetch-and-analyze or quickgo-database
serving-openmed-rest-api: common questions
Does the OpenMed REST service send data to external servers?
The source says models run on-device and the service has no telemetry. Inference stays on the machine where the service runs.
Which endpoints does the OpenMed REST service expose?
It exposes /health, /analyze, /pii/extract, /pii/deidentify, /models/loaded, and /models/unload. Request fields are validated strictly, and unknown fields are rejected.
How can I reduce first-request latency in the OpenMed service?
Set OPENMED_SERVICE_PRELOAD_MODELS to warm models at startup. The source notes that preloading avoids first-request latency but uses more memory.
How do I install serving-openmed-rest-api?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is serving-openmed-rest-api free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is serving-openmed-rest-api safe to use?
It scores 79 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to serving-openmed-rest-api?
Similar skills: literature-search-arxiv, alphafold-database-fetch-and-analyze, quickgo-database, peloton.
