Skip to content

Commit 9fc3a53

Browse files
committed
docs: link HF repo in README; chore: format via pre-commit; config: gate debug prints behind MEDVLLM_CONFIG_DEBUG
1 parent 6026098 commit 9fc3a53

File tree

10 files changed

+855
-0
lines changed

10 files changed

+855
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
license: mit
3+
language: en
4+
tags:
5+
- medical
6+
- config
7+
- med-vllm
8+
library_name: medvllm
9+
pipeline_tag: token-classification
10+
---
11+
12+
# Med vLLM (Config-first Repository)
13+
14+
This repository serves as a config-first landing for the Med vLLM stack.
15+
16+
It contains example configuration files and is intended to help users discover
17+
and consume the `MedicalModelConfig` from the Hub via `from_pretrained`, and to
18+
use these as starting points for training or inference in medical NLP tasks.
19+
20+
## Contents
21+
22+
- NER config example (`examples/ner/`)
23+
- Classification config example (`examples/classification/`)
24+
- Generation config example (`examples/generation/`)
25+
26+
## Install
27+
28+
```bash
29+
pip install medvllm
30+
```
31+
32+
## Quickstart (Python)
33+
34+
```python
35+
from medvllm.medical.config.models.medical_config import MedicalModelConfig
36+
cfg = MedicalModelConfig.from_pretrained("Junaidi-AI/med-vllm")
37+
print(cfg.task_type)
38+
```
39+
40+
Or directly load a specific example folder if exported as a subfolder with
41+
its own config files.
42+
43+
## Examples
44+
45+
- NER: [`examples/ner/config.json`](./examples/ner/config.json) | [`examples/ner/config.yaml`](./examples/ner/config.yaml)
46+
- Classification: [`examples/classification/config.json`](./examples/classification/config.json) | [`examples/classification/config.yaml`](./examples/classification/config.yaml)
47+
- Generation: [`examples/generation/config.json`](./examples/generation/config.json) | [`examples/generation/config.yaml`](./examples/generation/config.yaml)
48+
49+
Use these as starting points and customize fields like `task_type`, `classification_labels`, `medical_entity_types`, and domain settings.
50+
51+
## Tasks supported
52+
53+
- Named Entity Recognition (NER)
54+
- Text Classification
55+
- Text Generation
56+
57+
All tasks share a unified configuration schema via `MedicalModelConfig`.
58+
59+
## Weights roadmap
60+
61+
This repo currently focuses on configs. Model weights/adapters will be added progressively:
62+
63+
- BioBERT/ClinicalBERT adapters
64+
- Task-specific fine-tuned checkpoints (NER/Classification)
65+
66+
Follow the repo for updates or open a Discussion to request specific checkpoints.
67+
68+
## Debug and logging
69+
70+
By default, verbose config debug prints are silenced. To enable them for troubleshooting, set:
71+
72+
```bash
73+
export MEDVLLM_CONFIG_DEBUG=1
74+
```
75+
76+
## Medical Disclaimer
77+
78+
This repository and associated configurations are provided for research and
79+
engineering purposes only. They are not intended for clinical decision-making.
80+
Always involve qualified healthcare professionals and ensure compliance with
81+
applicable regulations (e.g., HIPAA, GDPR). Avoid using PHI/PII.
82+
83+
## License
84+
85+
MIT
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"_serializing": true,
3+
"activation_recompute": false,
4+
"adapter_config": null,
5+
"adapter_type": null,
6+
"allow_tf32": false,
7+
"anatomical_regions": [
8+
"head"
9+
],
10+
"attention_impl": null,
11+
"batch_size": 16,
12+
"cache_ttl": 3600,
13+
"classification_labels": [
14+
"diagnosis",
15+
"treatment",
16+
"follow-up"
17+
],
18+
"config_version": "1.0.0",
19+
"cudnn_benchmark": null,
20+
"document_types": [
21+
"clinical_note",
22+
"discharge_summary",
23+
"radiology_report"
24+
],
25+
"domain_adaptation": false,
26+
"domain_adaptation_lambda": 0.1,
27+
"domain_specific_vocab": null,
28+
"emit_trace": false,
29+
"enable_flash_attention": null,
30+
"enable_memory_pooling": false,
31+
"enable_mixed_precision": false,
32+
"enable_profiling": false,
33+
"enable_uncertainty_estimation": false,
34+
"enforce_eager": false,
35+
"entity_linking": {
36+
"confidence_threshold": 0.8,
37+
"enabled": false,
38+
"knowledge_bases": [
39+
"umls",
40+
"snomed_ct",
41+
"loinc"
42+
]
43+
},
44+
"eos": -1,
45+
"file_path": null,
46+
"flash_attention_config": null,
47+
"gpu_memory_utilization": 0.9,
48+
"grad_checkpointing": false,
49+
"hf_config": "namespace(model_type='unknown', max_position_embeddings=4096)",
50+
"imaging_modalities": [
51+
"xray"
52+
],
53+
"kvcache_block_size": 256,
54+
"max_entity_span_length": 10,
55+
"max_medical_seq_length": 4096,
56+
"max_model_len": 4096,
57+
"max_num_batched_tokens": 32768,
58+
"max_num_seqs": 512,
59+
"max_retries": 3,
60+
"medical_entity_types": [
61+
"disease"
62+
],
63+
"medical_specialties": [
64+
"cardiology"
65+
],
66+
"memory_efficient": true,
67+
"mixed_precision_dtype": "fp16",
68+
"model": "emilyalsentzer/Bio_ClinicalBERT",
69+
"model_type": "medical_llm",
70+
"ner_confidence_threshold": 0.5,
71+
"num_kvcache_blocks": -1,
72+
"pool_device": "auto",
73+
"pool_max_bytes": null,
74+
"pretrained_model_name_or_path": "emilyalsentzer/Bio_ClinicalBERT",
75+
"profiler_device": "auto",
76+
"quantization_bits": null,
77+
"quantization_method": null,
78+
"recompute_granularity": null,
79+
"regulatory_compliance": [
80+
"hipaa",
81+
"gdpr"
82+
],
83+
"request_timeout": 30,
84+
"section_headers": [
85+
"history_of_present_illness",
86+
"past_medical_history",
87+
"medications",
88+
"allergies",
89+
"family_history",
90+
"social_history",
91+
"review_of_systems",
92+
"physical_exam",
93+
"assessment_and_plan"
94+
],
95+
"task_type": "classification",
96+
"tensor_parallel_size": 1,
97+
"torch_matmul_precision": null,
98+
"trace_dir": "profiles",
99+
"uncertainty_threshold": 0.7,
100+
"use_cuda_graphs": false,
101+
"use_medical_adapter": true,
102+
"version": "0.1.0"
103+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
_serializing: true
2+
activation_recompute: false
3+
adapter_config: null
4+
adapter_type: null
5+
allow_tf32: false
6+
anatomical_regions:
7+
- head
8+
attention_impl: null
9+
batch_size: 16
10+
cache_ttl: 3600
11+
classification_labels:
12+
- diagnosis
13+
- treatment
14+
- follow-up
15+
config_version: 1.0.0
16+
cudnn_benchmark: null
17+
document_types:
18+
- clinical_note
19+
- discharge_summary
20+
- radiology_report
21+
domain_adaptation: false
22+
domain_adaptation_lambda: 0.1
23+
domain_specific_vocab: null
24+
emit_trace: false
25+
enable_flash_attention: null
26+
enable_memory_pooling: false
27+
enable_mixed_precision: false
28+
enable_profiling: false
29+
enable_uncertainty_estimation: false
30+
enforce_eager: false
31+
entity_linking:
32+
confidence_threshold: 0.8
33+
enabled: false
34+
knowledge_bases:
35+
- umls
36+
- snomed_ct
37+
- loinc
38+
eos: -1
39+
file_path: null
40+
flash_attention_config: null
41+
gpu_memory_utilization: 0.9
42+
grad_checkpointing: false
43+
hf_config: namespace(model_type='unknown', max_position_embeddings=4096)
44+
imaging_modalities:
45+
- xray
46+
kvcache_block_size: 256
47+
max_entity_span_length: 10
48+
max_medical_seq_length: 4096
49+
max_model_len: 4096
50+
max_num_batched_tokens: 32768
51+
max_num_seqs: 512
52+
max_retries: 3
53+
medical_entity_types:
54+
- disease
55+
medical_specialties:
56+
- cardiology
57+
memory_efficient: true
58+
mixed_precision_dtype: fp16
59+
model: emilyalsentzer/Bio_ClinicalBERT
60+
model_type: medical_llm
61+
ner_confidence_threshold: 0.5
62+
num_kvcache_blocks: -1
63+
pool_device: auto
64+
pool_max_bytes: null
65+
pretrained_model_name_or_path: emilyalsentzer/Bio_ClinicalBERT
66+
profiler_device: auto
67+
quantization_bits: null
68+
quantization_method: null
69+
recompute_granularity: null
70+
regulatory_compliance:
71+
- hipaa
72+
- gdpr
73+
request_timeout: 30
74+
section_headers:
75+
- history_of_present_illness
76+
- past_medical_history
77+
- medications
78+
- allergies
79+
- family_history
80+
- social_history
81+
- review_of_systems
82+
- physical_exam
83+
- assessment_and_plan
84+
task_type: classification
85+
tensor_parallel_size: 1
86+
torch_matmul_precision: null
87+
trace_dir: profiles
88+
uncertainty_threshold: 0.7
89+
use_cuda_graphs: false
90+
use_medical_adapter: true
91+
version: 0.1.0
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"_serializing": true,
3+
"activation_recompute": false,
4+
"adapter_config": null,
5+
"adapter_type": null,
6+
"allow_tf32": false,
7+
"anatomical_regions": [
8+
"head"
9+
],
10+
"attention_impl": null,
11+
"batch_size": 1,
12+
"cache_ttl": 3600,
13+
"classification_labels": [],
14+
"config_version": "1.0.0",
15+
"cudnn_benchmark": null,
16+
"document_types": [
17+
"clinical_note",
18+
"discharge_summary",
19+
"radiology_report"
20+
],
21+
"domain_adaptation": false,
22+
"domain_adaptation_lambda": 0.1,
23+
"domain_specific_vocab": null,
24+
"emit_trace": false,
25+
"enable_flash_attention": null,
26+
"enable_memory_pooling": false,
27+
"enable_mixed_precision": false,
28+
"enable_profiling": false,
29+
"enable_uncertainty_estimation": false,
30+
"enforce_eager": false,
31+
"entity_linking": {
32+
"confidence_threshold": 0.8,
33+
"enabled": false,
34+
"knowledge_bases": [
35+
"umls",
36+
"snomed_ct",
37+
"loinc"
38+
]
39+
},
40+
"eos": -1,
41+
"file_path": null,
42+
"flash_attention_config": null,
43+
"gpu_memory_utilization": 0.9,
44+
"grad_checkpointing": false,
45+
"hf_config": "namespace(model_type='unknown', max_position_embeddings=4096)",
46+
"imaging_modalities": [
47+
"xray"
48+
],
49+
"kvcache_block_size": 256,
50+
"max_entity_span_length": 10,
51+
"max_medical_seq_length": 1024,
52+
"max_model_len": 1024,
53+
"max_num_batched_tokens": 32768,
54+
"max_num_seqs": 512,
55+
"max_retries": 3,
56+
"medical_entity_types": [
57+
"disease"
58+
],
59+
"medical_specialties": [
60+
"cardiology"
61+
],
62+
"memory_efficient": true,
63+
"mixed_precision_dtype": "fp16",
64+
"model": "gpt2",
65+
"model_type": "medical_llm",
66+
"ner_confidence_threshold": 0.5,
67+
"num_kvcache_blocks": -1,
68+
"pool_device": "auto",
69+
"pool_max_bytes": null,
70+
"pretrained_model_name_or_path": "gpt2",
71+
"profiler_device": "auto",
72+
"quantization_bits": null,
73+
"quantization_method": null,
74+
"recompute_granularity": null,
75+
"regulatory_compliance": [
76+
"hipaa",
77+
"gdpr"
78+
],
79+
"request_timeout": 30,
80+
"section_headers": [
81+
"history_of_present_illness",
82+
"past_medical_history",
83+
"medications",
84+
"allergies",
85+
"family_history",
86+
"social_history",
87+
"review_of_systems",
88+
"physical_exam",
89+
"assessment_and_plan"
90+
],
91+
"task_type": "generation",
92+
"tensor_parallel_size": 1,
93+
"torch_matmul_precision": null,
94+
"trace_dir": "profiles",
95+
"uncertainty_threshold": 0.7,
96+
"use_cuda_graphs": false,
97+
"use_medical_adapter": true,
98+
"version": "0.1.0"
99+
}

0 commit comments

Comments
 (0)