MaziyarPanahi commited on
Commit
ca1f441
·
verified ·
1 Parent(s): a802129

Use OpenMed runtime guidance

Browse files
README.md CHANGED
@@ -38,8 +38,8 @@ including local clinical-document and chart workflows on Mac, iPhone, and iPad.
38
  These repositories contain MLX conversions of
39
  [`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct),
40
  a compact 2.4B-parameter Cohere Compass vision-language model released under
41
- Apache 2.0. OpenMed owns the Python and Swift runtime paths described here; no
42
- `mlx-vlm` installation or model-repository Python code is required for use.
43
 
44
  The same byte-identical README is published across all five precision
45
  variants. The repository name, `config.json`, and `openmed-mlx.json` identify
@@ -62,12 +62,10 @@ while reducing the decoder footprint.
62
 
63
  ## Python through OpenMed
64
 
65
- Install an OpenMed revision that contains the native Compass runtime. Until the
66
- linked implementation PR is merged and released, install its tested branch:
67
 
68
  ```bash
69
- python -m pip install -U \
70
- "openmed[mlx] @ git+https://github.com/maziyarpanahi/openmed.git@feature/cohere-compass-runtime"
71
  ```
72
 
73
  Image plus text:
@@ -237,12 +235,9 @@ incorrect, or fabricated. A qualified human must verify consequential use.
237
  - Source: [`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct)
238
  - Pinned source revision: `373bda96ac70bf89f99f7048f420cf00dc07c149`
239
  - OpenMed / OpenMedKit: [github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)
240
- - Independent conversion reference: the Cohere Compass port contributed to
241
- MLX-VLM at revision `dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc`
242
 
243
- Thank you to Cohere for releasing North Micro Vision and to the MLX and
244
- MLX-VLM contributors whose prior Compass work provided a useful independent
245
- reference while OpenMed implemented and tested its own Python and Swift paths.
246
 
247
  The converted weights retain the source model's Apache 2.0 license. OpenMed's
248
  SDK source is separately licensed under Apache 2.0.
 
38
  These repositories contain MLX conversions of
39
  [`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct),
40
  a compact 2.4B-parameter Cohere Compass vision-language model released under
41
+ Apache 2.0. OpenMed provides the Python and Swift runtime paths described here
42
+ and consumes the repositories as data-only model artifacts.
43
 
44
  The same byte-identical README is published across all five precision
45
  variants. The repository name, `config.json`, and `openmed-mlx.json` identify
 
62
 
63
  ## Python through OpenMed
64
 
65
+ Install OpenMed with Apple MLX support:
 
66
 
67
  ```bash
68
+ uv pip install "openmed[mlx]"
 
69
  ```
70
 
71
  Image plus text:
 
235
  - Source: [`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct)
236
  - Pinned source revision: `373bda96ac70bf89f99f7048f420cf00dc07c149`
237
  - OpenMed / OpenMedKit: [github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)
 
 
238
 
239
+ Thank you to Cohere for releasing North Micro Vision and to the Apple MLX
240
+ contributors who make private on-device inference possible.
 
241
 
242
  The converted weights retain the source model's Apache 2.0 license. OpenMed's
243
  SDK source is separately licensed under Apache 2.0.
openmed-mlx.json CHANGED
@@ -34,11 +34,5 @@
34
  "weights": {
35
  "format": "safetensors",
36
  "path": "model.safetensors"
37
- },
38
- "provenance": {
39
- "independent_conversion_reference": {
40
- "library": "mlx-vlm",
41
- "revision": "dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc"
42
- }
43
  }
44
  }
 
34
  "weights": {
35
  "format": "safetensors",
36
  "path": "model.safetensors"
 
 
 
 
 
 
37
  }
38
  }
openmed-runtime-validation.json CHANGED
@@ -20,7 +20,7 @@
20
  "huggingface-hub": "1.27.0",
21
  "pillow": "12.3.0"
22
  },
23
- "test": "tests/integration/test_mlx_vlm_compass.py"
24
  },
25
  "swift": {
26
  "passed": true,
 
20
  "huggingface-hub": "1.27.0",
21
  "pillow": "12.3.0"
22
  },
23
+ "test": "tests/integration/test_mlx_vision_language_compass.py"
24
  },
25
  "swift": {
26
  "passed": true,
openmed-validation.json CHANGED
@@ -3,14 +3,14 @@
3
  {
4
  "coherence_detail": "coherent surface form",
5
  "coherent": true,
6
- "elapsed_seconds": 0.2915,
7
  "fact_detail": "privacy/locality concepts present",
8
  "facts_correct": true,
9
  "fixture": null,
10
- "generation_tokens": 26,
11
  "id": "text_privacy",
12
  "passed": true,
13
- "peak_memory_gb": 5.063733678,
14
  "prompt": "In one concise sentence, explain how running a vision-language model entirely on-device can improve privacy for clinical documents.",
15
  "prompt_tokens": 30,
16
  "response": "Running a vision-language model entirely on-device reduces the need for cloud storage and transmission of sensitive clinical data, thereby enhancing privacy."
@@ -18,14 +18,14 @@
18
  {
19
  "coherence_detail": "coherent surface form",
20
  "coherent": true,
21
- "elapsed_seconds": 0.0468,
22
  "fact_detail": "all expected facts present",
23
  "facts_correct": true,
24
  "fixture": null,
25
- "generation_tokens": 2,
26
  "id": "text_fact_extraction",
27
  "passed": true,
28
- "peak_memory_gb": 5.063733678,
29
  "prompt": "A synthetic note states: \"The follow-up appointment is scheduled for Tuesday at 10:30 AM.\" What day is the follow-up? Answer with only the day.",
30
  "prompt_tokens": 44,
31
  "response": "Tuesday"
@@ -33,29 +33,29 @@
33
  {
34
  "coherence_detail": "coherent surface form",
35
  "coherent": true,
36
- "elapsed_seconds": 1.0647,
37
  "fact_detail": "all expected facts present",
38
  "facts_correct": true,
39
  "fixture": "synthetic_clinical_document.png",
40
- "generation_tokens": 32,
41
  "id": "image_clinical_document",
42
  "passed": true,
43
- "peak_memory_gb": 7.675185886,
44
  "prompt": "This is synthetic test data. In one concise sentence, report the exact patient name, record ID, medication with dose and frequency, and allergy shown in the image.",
45
  "prompt_tokens": 1161,
46
- "response": "The synthetic test data includes patient Alex Rivera (Record ID: SYN-2048), prescribed Metformin 500 mg twice daily, with a penicillin allergy."
47
  },
48
  {
49
  "coherence_detail": "coherent surface form",
50
  "coherent": true,
51
- "elapsed_seconds": 0.7383,
52
  "fact_detail": "all expected facts present",
53
  "facts_correct": true,
54
  "fixture": "synthetic_clinic_chart.png",
55
- "generation_tokens": 5,
56
  "id": "image_chart",
57
  "passed": true,
58
- "peak_memory_gb": 7.675185886,
59
  "prompt": "Which category has the tallest bar, and what exact value is printed above it? Answer concisely.",
60
  "prompt_tokens": 1053,
61
  "response": "Screening, 42"
@@ -69,16 +69,16 @@
69
  "memory_size": 549755813888,
70
  "resource_limit": 499000
71
  },
72
- "load_seconds": 0.8684,
73
- "mlx_vlm_revision": "dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc",
74
- "model_path": "OpenMed/North-Micro-Vision-Instruct-bf16-mlx",
75
  "passed": true,
 
76
  "runtime_versions": {
77
  "huggingface-hub": "1.27.0",
78
  "mlx": "0.32.0",
79
  "mlx-lm": "0.31.3",
80
  "mlx-metal": "0.32.0",
81
- "mlx-vlm": "0.6.10",
82
  "transformers": "5.15.0"
83
  },
84
  "schema_version": 1,
 
3
  {
4
  "coherence_detail": "coherent surface form",
5
  "coherent": true,
6
+ "elapsed_seconds": 0.4045,
7
  "fact_detail": "privacy/locality concepts present",
8
  "facts_correct": true,
9
  "fixture": null,
10
+ "generation_tokens": 25,
11
  "id": "text_privacy",
12
  "passed": true,
13
+ "peak_memory_gb": 5.07432437,
14
  "prompt": "In one concise sentence, explain how running a vision-language model entirely on-device can improve privacy for clinical documents.",
15
  "prompt_tokens": 30,
16
  "response": "Running a vision-language model entirely on-device reduces the need for cloud storage and transmission of sensitive clinical data, thereby enhancing privacy."
 
18
  {
19
  "coherence_detail": "coherent surface form",
20
  "coherent": true,
21
+ "elapsed_seconds": 0.0535,
22
  "fact_detail": "all expected facts present",
23
  "facts_correct": true,
24
  "fixture": null,
25
+ "generation_tokens": 1,
26
  "id": "text_fact_extraction",
27
  "passed": true,
28
+ "peak_memory_gb": 5.083239598,
29
  "prompt": "A synthetic note states: \"The follow-up appointment is scheduled for Tuesday at 10:30 AM.\" What day is the follow-up? Answer with only the day.",
30
  "prompt_tokens": 44,
31
  "response": "Tuesday"
 
33
  {
34
  "coherence_detail": "coherent surface form",
35
  "coherent": true,
36
+ "elapsed_seconds": 1.3907,
37
  "fact_detail": "all expected facts present",
38
  "facts_correct": true,
39
  "fixture": "synthetic_clinical_document.png",
40
+ "generation_tokens": 31,
41
  "id": "image_clinical_document",
42
  "passed": true,
43
+ "peak_memory_gb": 7.668086766,
44
  "prompt": "This is synthetic test data. In one concise sentence, report the exact patient name, record ID, medication with dose and frequency, and allergy shown in the image.",
45
  "prompt_tokens": 1161,
46
+ "response": "The synthetic test data includes patient Alex Rivera, record ID SYN-2048, medication Metformin 500 mg twice daily, and allergy to Penicillin."
47
  },
48
  {
49
  "coherence_detail": "coherent surface form",
50
  "coherent": true,
51
+ "elapsed_seconds": 0.8995,
52
  "fact_detail": "all expected facts present",
53
  "facts_correct": true,
54
  "fixture": "synthetic_clinic_chart.png",
55
+ "generation_tokens": 4,
56
  "id": "image_chart",
57
  "passed": true,
58
+ "peak_memory_gb": 7.668086766,
59
  "prompt": "Which category has the tallest bar, and what exact value is printed above it? Answer concisely.",
60
  "prompt_tokens": 1053,
61
  "response": "Screening, 42"
 
69
  "memory_size": 549755813888,
70
  "resource_limit": 499000
71
  },
72
+ "load_seconds": 3.0775,
73
+ "model_path": "/Users/maziyar/Developer/openmed-mlx-export/artifacts/north-micro-vision/North-Micro-Vision-Instruct-bf16-mlx",
 
74
  "passed": true,
75
+ "runtime": "openmed.mlx.OpenMedMLXVisionLanguageModel",
76
  "runtime_versions": {
77
  "huggingface-hub": "1.27.0",
78
  "mlx": "0.32.0",
79
  "mlx-lm": "0.31.3",
80
  "mlx-metal": "0.32.0",
81
+ "openmed": "1.0.0",
82
  "transformers": "5.15.0"
83
  },
84
  "schema_version": 1,