Registry / llm-agents / openmed

openmed

JSON →
library2.2.0pypypi✓ verified 21d ago

OpenMed is a Python library that delivers state-of-the-art biomedical and clinical Large Language Models (LLMs), focusing on advanced entity extraction, assertion detection, and medical reasoning. It provides a robust, open-source toolkit for HIPAA-compliant workflows, supporting a simple Python API, a FastAPI-based REST service, and batch processing capabilities. The library is actively developed, with its current version being 0.6.4, and is designed to unify model discovery, advanced extractions, and one-line orchestration for clinical NLP workflows.

pip install openmed
INSTALL
IMPORT
SIG · OPENMED
O
openmed
llm-agentspythonv2.2.0
Install
45.5s avg
Import
1987ms
Disk
2457MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 67.87s
py 3.11
✓ 0.07s
✓ 67.5s
py 3.12
✓ —
✓ 62.63s
py 3.13
1/3 runs
✓ 61.67s
py 3.9
✓ —
✓ 13s
2457MB installed
● package 2457MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

analyze_text
from openmed import analyze_text
BatchProcessor
from openmed import BatchProcessor
extract_pii
from openmed import extract_pii
deidentify
from openmed import deidentify
OpenMedConfig
from openmed import OpenMedConfig

This quickstart demonstrates how to use the `analyze_text` function to perform named entity recognition (NER) on clinical text using a specified model. It prints detected entities, their text, and confidence scores.

from openmed import analyze_text text = "Patient started on imatinib for chronic myeloid leukemia." result = analyze_text( text, model_name="disease_detection_superclinical", # Example model confidence_threshold=0.55 # Optional: filter entities by confidence ) for entity in result.entities: print(f"{entity.label:<12} {entity.text:<35} {entity.confidence:.2f}") # Example output: # DISEASE chronic myeloid leukemia 0.98 # DRUG imatinib 0.95
openmed --version
Debug
Known issues
gotchaOpenMed relies on underlying biomedical models (often from Hugging Face). These models can be large and require significant memory and/or GPU resources for optimal performance, particularly for larger texts or batch processing. Ensure your environment meets the computational demands, and models are available or downloaded.
fix
Allocate sufficient RAM/VRAM. For GPU acceleration, ensure compatible drivers and PyTorch/TensorFlow installations. Specify `model_name` correctly or configure `OPENMED_MODEL_CACHE_DIR` to pre-download models.
affects: All versions
gotchaWhile OpenMed provides robust tools for HIPAA-compliant PII detection and de-identification (e.g., smart entity merging), achieving full HIPAA compliance is a broader responsibility that extends beyond the library's capabilities. It requires proper configuration, integration into a secure environment, and adherence to organizational policies.
fix
Carefully review OpenMed's PII documentation. Ensure secure data handling practices, access controls, and auditing are in place at the application and infrastructure level.
affects: All versions supporting PII features (v0.5.0+)
gotchaOpenMed supports different configuration profiles (e.g., 'dev', 'prod', 'test', 'fast') that can alter default behaviors like confidence thresholds or entity grouping. Not explicitly managing these profiles can lead to inconsistent results between development and production environments.
fix
Always explicitly set the desired `config_profile` when invoking `analyze_text` or related functions in production contexts, or manage it via environment variables (e.g., `OPENMED_PROFILE`).
affects: All versions supporting configuration profiles
gotchaFor PII extraction and de-identification in languages other than English, the `lang` parameter (e.g., `lang="es"` for Spanish) must be explicitly provided to the `extract_pii` or `deidentify` functions. Failing to do so may result in incorrect or incomplete PII detection.
fix
When processing non-English text for PII, pass the appropriate ISO 639-1 language code to the `lang` parameter.
affects: All versions supporting multilingual PII
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'openmed'
The `openmed` library has not been installed in your Python environment, or the environment where it's installed is not active.
fix
Install the library using pip: `pip install openmed` or `uv pip install openmed` if you are using the `uv` installer.
ModuleNotFoundError: No module named 'transformers'
The `openmed` library relies on Hugging Face Transformers for its models, and the `[hf]` extra dependency, which includes `transformers`, was not installed.
fix
Install `openmed` with the Hugging Face support extra: `pip install 'openmed[hf]'` or `uv pip install 'openmed[hf]'`.
Failed to load model: [model_name]
The specified model name is incorrect, the model files could not be downloaded from Hugging Face Hub (e.g., due to network issues), or there's a problem with the local model cache.
fix
Verify that the `model_name` is spelled correctly and is a valid model listed in the OpenMed model registry. Ensure you have an active internet connection to download models, or check your local Hugging Face cache for corrupted files. Example correct usage: `analyze_text("text", model_name="disease_detection_superclinical")`.
Upgrade
Version history
2.2.0latest on PyPI · released Aug 21, 2026
Audit
Dependencies
transformersoptionalRequired for Hugging Face model integration, used by the '[hf]' extra.
fastapioptionalRequired for the REST API service, used by the '[service]' extra.
uvicornoptionalRequired for the REST API service, used by the '[service]' extra.
Agent activity
26 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
openmed — pip install openmed · libregistry