File size: 9,952 Bytes
a7ec518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
---
library_name: mlx
license: apache-2.0
pipeline_tag: image-text-to-text
base_model: CohereLabs/North-Micro-Vision-Instruct
language:
- en
- de
- fr
- es
- it
- pt
- hi
- ja
- ko
- zh
- ar
tags:
- mlx
- mlx-vlm
- openmed
- openmedkit
- apple-silicon
- on-device
- vision
- multimodal
- clinical
- medical
- privacy
- native-resolution
---

# North Micro Vision Instruct — OpenMed MLX family

On-device, native-resolution vision-language inference for Apple Silicon,
prepared for OpenMed's privacy-first clinical document workflows and the
future Cohere Compass runtime in [OpenMedKit](https://github.com/maziyarpanahi/openmed).

These repositories contain MLX conversions of
[`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct),
a compact 2.4B-parameter vision-language model released by Cohere under
Apache 2.0. The same byte-identical README is used across the five precision
variants; the repository name and `config.json` identify the precision.

## Choose a precision

| Repository | Weight payload | Intended trade-off |
| --- | ---: | --- |
| [`OpenMed/North-Micro-Vision-Instruct-4bit-mlx`](https://huggingface.co/OpenMed/North-Micro-Vision-Instruct-4bit-mlx) | 2.02 GiB | Smallest affine variant; validate quality on your exact document set |
| [`OpenMed/North-Micro-Vision-Instruct-5bit-mlx`](https://huggingface.co/OpenMed/North-Micro-Vision-Instruct-5bit-mlx) | 2.25 GiB | Compact middle ground |
| [`OpenMed/North-Micro-Vision-Instruct-6bit-mlx`](https://huggingface.co/OpenMed/North-Micro-Vision-Instruct-6bit-mlx) | 2.48 GiB | Recommended first on-device quality/size trial |
| [`OpenMed/North-Micro-Vision-Instruct-8bit-mlx`](https://huggingface.co/OpenMed/North-Micro-Vision-Instruct-8bit-mlx) | 2.93 GiB | Higher-fidelity quantized variant |
| [`OpenMed/North-Micro-Vision-Instruct-bf16-mlx`](https://huggingface.co/OpenMed/North-Micro-Vision-Instruct-bf16-mlx) | 4.63 GiB | Full converted precision and quality reference |

The 4/5/6/8-bit repositories use 64-element affine weight groups. Their
vision tower remains in source precision; eligible language-model layers are
quantized. This matters for document and OCR work because visual feature
extraction is not compressed just to reduce the decoder footprint.

## Why this model is interesting for OpenMedKit

North Micro Vision accepts interleaved text and images, preserves native image
aspect ratios, and was trained for OCR, document understanding, charts,
grounding, captioning, multilingual prompts, and multi-image conversations.
That combination maps naturally to an OpenMedKit document pipeline:

1. Capture or import a page locally on iPhone, iPad, or Mac.
2. Keep image normalization, OCR/VLM inference, PII handling, and structured
   extraction on the user's device.
3. Validate generated fields against the source page before they enter a
   clinical record or workflow.
4. Redact or pseudonymize with OpenMedKit policies before any explicitly
   authorized export.
5. Never auto-trigger diagnosis, treatment, disclosure, or another
   consequential clinical decision from model output.

OpenMedKit's design defaults remain important even when the model is local:
no telemetry by default, no cloud fallback for PHI, no raw clinical text in
logs or analytics, synthetic fixtures in committed tests, and human review for
consequential use.

## Runtime status: read this before using Swift

The model weights use the standard MLX-VLM artifact layout and include the
source tokenizer, chat template, native-resolution image processor metadata,
and Cohere Compass configuration. They are validated today with the pinned
Python MLX-VLM Compass runtime on Apple Silicon.

The released OpenMedKit Swift package does **not yet contain a native Cohere
Compass VLM implementation**. Do not assume that downloading one of these
repositories through `OpenMedModelStore` is sufficient for iOS inference.
These artifacts are deliberately packaged without conversion-time Python
dependencies so a future OpenMedKit Compass loader can consume the same weight
payloads, but native Swift/iOS support must still land and pass physical-device
memory, thermal, image, and text parity gates.

Until that runtime ships, use MLX-VLM on an Apple Silicon Mac for the model
itself. OpenMedKit can still own capture, privacy policy, redaction, structured
validation, and the surrounding app workflow. Do not send raw PHI from an iOS
device to a Mac or service unless the user and deployment policy explicitly
authorize that transfer.

## Install the validated MLX runtime

Cohere Compass support is pinned to the exact MLX-VLM port used for conversion
and validation:

```bash
python -m pip install -U \
  "git+https://github.com/Blaizzy/mlx-vlm.git@dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc"
```

The validated environment uses MLX 0.32.0, MLX-LM 0.31.3, MLX-VLM 0.6.10
from that commit, and Transformers 5.15.0. Once Cohere Compass support is in a
released MLX-VLM package, a normal `pip install -U mlx-vlm` can replace the
commit pin after you rerun your own parity tests.

## Image + text example

```python
from mlx_vlm import apply_chat_template, generate, load

model_id = "OpenMed/North-Micro-Vision-Instruct-6bit-mlx"
model, processor = load(model_id)

prompt = apply_chat_template(
    processor,
    model.config,
    "Read this synthetic document and list the visible medication and dose.",
    num_images=1,
)
result = generate(
    model,
    processor,
    prompt,
    image="synthetic-clinical-note.png",
    max_tokens=128,
    temperature=0.0,
)
print(result.text)
```

Use synthetic or properly authorized content while prototyping. For a real
clinical app, treat both the image and generated text as sensitive until the
OpenMedKit privacy policy has been applied.

## Text-only example

```python
from mlx_vlm import apply_chat_template, generate, load

model, processor = load(
    "OpenMed/North-Micro-Vision-Instruct-6bit-mlx"
)
prompt = apply_chat_template(
    processor,
    model.config,
    "Explain in one sentence why local processing can improve document privacy.",
    num_images=0,
)
result = generate(
    model,
    processor,
    prompt,
    max_tokens=80,
    temperature=0.0,
)
print(result.text)
```

System prompts are not recommended by the source model authors. Keep
instructions concise and place the task in the user message.

## OpenMedKit integration gates

Before these weights are advertised as a native OpenMedKit/iOS runtime, the
Swift implementation must demonstrate all of the following on a physical
iPhone/iPad as well as Apple Silicon macOS:

- strict weight loading for bf16 and every affine bit width;
- tokenizer and chat-template parity with the validated Python path;
- native-resolution image preprocessing and visual-token count parity;
- coherent deterministic text-only generation;
- correct OCR/document answers on synthetic fixtures;
- bounded memory, launch latency, sustained thermals, and cancellation;
- no network fallback, telemetry, or plaintext PHI logging;
- provenance, model revision, and privacy-policy visibility in the app UI.

That is the bar for “OpenMedKit-ready”; an MLX file extension alone is not.

## Validation performed before publication

Every OpenMed variant is loaded independently with strict tensor matching and
must pass the same deterministic suite before any repository is made public:

- coherent text-only privacy explanation;
- exact fact extraction from a short synthetic text note;
- exact extraction of name, synthetic record ID, medication, dose, frequency,
  and allergy from a generated non-PHI clinical document image;
- exact category/value extraction from a generated chart image;
- model type, processor assets, quantization metadata, and weight-size checks;
- bf16 SHA-256 payload parity with an independently published Cohere-linked
  conversion made from the same pinned source and runtime port;
- quantized payload-size parity plus an explicit nonzero token-embedding gate
  (whole-file hashes are recorded but are not treated as a correctness proxy).

The fixtures are synthetic and are not clinical-quality evidence. Passing
these checks establishes conversion/runtime coherence, not safety or accuracy
for a particular medical workflow. Evaluate the exact document types,
languages, device targets, and failure modes your app will encounter.

## Source model scope and limitations

The source checkpoint supports native-resolution and multiple images,
multilingual conversations, visual question answering, grounding, OCR, and
chart/document understanding. Its language backbone supports a long context,
but Cohere reports multimodal training and validation up to 8K tokens; do not
silently claim longer multimodal reliability.

The source model is not a reasoning model, has limited math and code ability,
does not support tool calling or agentic workflows, and is intended as a
compact foundation for prototyping and specialization. Native-resolution
images can materially increase memory use and latency.

This model and OpenMedKit are not medical devices. Outputs can be incomplete,
incorrect, or fabricated. A qualified human must verify consequential use.

## Reproducibility and credits

- Source: [`CohereLabs/North-Micro-Vision-Instruct`](https://huggingface.co/CohereLabs/North-Micro-Vision-Instruct)
- Pinned source revision: `373bda96ac70bf89f99f7048f420cf00dc07c149`
- MLX-VLM Compass port: [`dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc`](https://github.com/Blaizzy/mlx-vlm/commit/dd79a5d8caf3edafd6fa9e6326d7ce4977ddcbfc)
- OpenMed / OpenMedKit: [github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)

Thank you to Cohere for releasing North Micro Vision and to Prince Canuma and
the MLX-VLM contributors for the Apple Silicon runtime and Compass port.

The converted weights retain the source model's Apache 2.0 license. OpenMed's
SDK source is separately licensed under Apache 2.0.