Initial config export (README, examples)

#1
README.md CHANGED
@@ -1,3 +1,46 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ## Usage (Python)
27
+
28
+ ```python
29
+ from medvllm.medical.config.models.medical_config import MedicalModelConfig
30
+ cfg = MedicalModelConfig.from_pretrained("Junaidi-AI/med-vllm")
31
+ print(cfg.task_type)
32
+ ```
33
+
34
+ Or directly load a specific example folder if exported as a subfolder with
35
+ its own config files.
36
+
37
+ ## Medical Disclaimer
38
+
39
+ This repository and associated configurations are provided for research and
40
+ engineering purposes only. They are not intended for clinical decision-making.
41
+ Always involve qualified healthcare professionals and ensure compliance with
42
+ applicable regulations (e.g., HIPAA, GDPR). Avoid using PHI/PII.
43
+
44
+ ## License
45
+
46
+ MIT
examples/classification/config.json ADDED
@@ -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
+ }
examples/classification/config.yaml ADDED
@@ -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
examples/generation/config.json ADDED
@@ -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
+ }
examples/generation/config.yaml ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 1
10
+ cache_ttl: 3600
11
+ classification_labels: []
12
+ config_version: 1.0.0
13
+ cudnn_benchmark: null
14
+ document_types:
15
+ - clinical_note
16
+ - discharge_summary
17
+ - radiology_report
18
+ domain_adaptation: false
19
+ domain_adaptation_lambda: 0.1
20
+ domain_specific_vocab: null
21
+ emit_trace: false
22
+ enable_flash_attention: null
23
+ enable_memory_pooling: false
24
+ enable_mixed_precision: false
25
+ enable_profiling: false
26
+ enable_uncertainty_estimation: false
27
+ enforce_eager: false
28
+ entity_linking:
29
+ confidence_threshold: 0.8
30
+ enabled: false
31
+ knowledge_bases:
32
+ - umls
33
+ - snomed_ct
34
+ - loinc
35
+ eos: -1
36
+ file_path: null
37
+ flash_attention_config: null
38
+ gpu_memory_utilization: 0.9
39
+ grad_checkpointing: false
40
+ hf_config: namespace(model_type='unknown', max_position_embeddings=4096)
41
+ imaging_modalities:
42
+ - xray
43
+ kvcache_block_size: 256
44
+ max_entity_span_length: 10
45
+ max_medical_seq_length: 1024
46
+ max_model_len: 1024
47
+ max_num_batched_tokens: 32768
48
+ max_num_seqs: 512
49
+ max_retries: 3
50
+ medical_entity_types:
51
+ - disease
52
+ medical_specialties:
53
+ - cardiology
54
+ memory_efficient: true
55
+ mixed_precision_dtype: fp16
56
+ model: gpt2
57
+ model_type: medical_llm
58
+ ner_confidence_threshold: 0.5
59
+ num_kvcache_blocks: -1
60
+ pool_device: auto
61
+ pool_max_bytes: null
62
+ pretrained_model_name_or_path: gpt2
63
+ profiler_device: auto
64
+ quantization_bits: null
65
+ quantization_method: null
66
+ recompute_granularity: null
67
+ regulatory_compliance:
68
+ - hipaa
69
+ - gdpr
70
+ request_timeout: 30
71
+ section_headers:
72
+ - history_of_present_illness
73
+ - past_medical_history
74
+ - medications
75
+ - allergies
76
+ - family_history
77
+ - social_history
78
+ - review_of_systems
79
+ - physical_exam
80
+ - assessment_and_plan
81
+ task_type: generation
82
+ tensor_parallel_size: 1
83
+ torch_matmul_precision: null
84
+ trace_dir: profiles
85
+ uncertainty_threshold: 0.7
86
+ use_cuda_graphs: false
87
+ use_medical_adapter: true
88
+ version: 0.1.0
examples/ner/config.json ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": 4096,
52
+ "max_model_len": 4096,
53
+ "max_num_batched_tokens": 32768,
54
+ "max_num_seqs": 512,
55
+ "max_retries": 3,
56
+ "medical_entity_types": [
57
+ "disease",
58
+ "drug",
59
+ "procedure"
60
+ ],
61
+ "medical_specialties": [
62
+ "cardiology"
63
+ ],
64
+ "memory_efficient": true,
65
+ "mixed_precision_dtype": "fp16",
66
+ "model": "dmis-lab/biobert-base-cased-v1.2",
67
+ "model_type": "medical_llm",
68
+ "ner_confidence_threshold": 0.85,
69
+ "num_kvcache_blocks": -1,
70
+ "pool_device": "auto",
71
+ "pool_max_bytes": null,
72
+ "pretrained_model_name_or_path": "dmis-lab/biobert-base-cased-v1.2",
73
+ "profiler_device": "auto",
74
+ "quantization_bits": null,
75
+ "quantization_method": null,
76
+ "recompute_granularity": null,
77
+ "regulatory_compliance": [
78
+ "hipaa",
79
+ "gdpr"
80
+ ],
81
+ "request_timeout": 30,
82
+ "section_headers": [
83
+ "history_of_present_illness",
84
+ "past_medical_history",
85
+ "medications",
86
+ "allergies",
87
+ "family_history",
88
+ "social_history",
89
+ "review_of_systems",
90
+ "physical_exam",
91
+ "assessment_and_plan"
92
+ ],
93
+ "task_type": "ner",
94
+ "tensor_parallel_size": 1,
95
+ "torch_matmul_precision": null,
96
+ "trace_dir": "profiles",
97
+ "uncertainty_threshold": 0.7,
98
+ "use_cuda_graphs": false,
99
+ "use_medical_adapter": true,
100
+ "version": "0.1.0"
101
+ }
examples/ner/config.yaml ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 1
10
+ cache_ttl: 3600
11
+ classification_labels: []
12
+ config_version: 1.0.0
13
+ cudnn_benchmark: null
14
+ document_types:
15
+ - clinical_note
16
+ - discharge_summary
17
+ - radiology_report
18
+ domain_adaptation: false
19
+ domain_adaptation_lambda: 0.1
20
+ domain_specific_vocab: null
21
+ emit_trace: false
22
+ enable_flash_attention: null
23
+ enable_memory_pooling: false
24
+ enable_mixed_precision: false
25
+ enable_profiling: false
26
+ enable_uncertainty_estimation: false
27
+ enforce_eager: false
28
+ entity_linking:
29
+ confidence_threshold: 0.8
30
+ enabled: false
31
+ knowledge_bases:
32
+ - umls
33
+ - snomed_ct
34
+ - loinc
35
+ eos: -1
36
+ file_path: null
37
+ flash_attention_config: null
38
+ gpu_memory_utilization: 0.9
39
+ grad_checkpointing: false
40
+ hf_config: namespace(model_type='unknown', max_position_embeddings=4096)
41
+ imaging_modalities:
42
+ - xray
43
+ kvcache_block_size: 256
44
+ max_entity_span_length: 10
45
+ max_medical_seq_length: 4096
46
+ max_model_len: 4096
47
+ max_num_batched_tokens: 32768
48
+ max_num_seqs: 512
49
+ max_retries: 3
50
+ medical_entity_types:
51
+ - disease
52
+ - drug
53
+ - procedure
54
+ medical_specialties:
55
+ - cardiology
56
+ memory_efficient: true
57
+ mixed_precision_dtype: fp16
58
+ model: dmis-lab/biobert-base-cased-v1.2
59
+ model_type: medical_llm
60
+ ner_confidence_threshold: 0.85
61
+ num_kvcache_blocks: -1
62
+ pool_device: auto
63
+ pool_max_bytes: null
64
+ pretrained_model_name_or_path: dmis-lab/biobert-base-cased-v1.2
65
+ profiler_device: auto
66
+ quantization_bits: null
67
+ quantization_method: null
68
+ recompute_granularity: null
69
+ regulatory_compliance:
70
+ - hipaa
71
+ - gdpr
72
+ request_timeout: 30
73
+ section_headers:
74
+ - history_of_present_illness
75
+ - past_medical_history
76
+ - medications
77
+ - allergies
78
+ - family_history
79
+ - social_history
80
+ - review_of_systems
81
+ - physical_exam
82
+ - assessment_and_plan
83
+ task_type: ner
84
+ tensor_parallel_size: 1
85
+ torch_matmul_precision: null
86
+ trace_dir: profiles
87
+ uncertainty_threshold: 0.7
88
+ use_cuda_graphs: false
89
+ use_medical_adapter: true
90
+ version: 0.1.0