Native OpenMed and OpenMedKit vision-language inference for Apple Silicon,
including local clinical-document and chart workflows on Mac, iPhone, and iPad.
These repositories contain MLX conversions of
CohereLabs/North-Micro-Vision-Instruct,
a compact 2.4B-parameter Cohere Compass vision-language model released under
Apache 2.0. OpenMed provides the Python and Swift runtime paths described here
and consumes the repositories as data-only model artifacts.
The same byte-identical README is published across all five precision
variants. The repository name, config.json, and openmed-mlx.json identify
the precision.
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 preserves the source visual encoder for OCR and document work
while reducing the decoder footprint.
Python through OpenMed
Install OpenMed with Apple MLX support:
uv pip install "openmed[mlx]"
Image plus text:
python
1from openmed.mlx import OpenMedMLXVisionLanguageModel
23model = OpenMedMLXVisionLanguageModel(4"OpenMed/North-Micro-Vision-Instruct-6bit-mlx"5)67result = model.generate_with_metadata(8"Read this synthetic document and list the visible medication and dose.",9 image="synthetic-clinical-note.png",10 max_tokens=128,11)1213print(result.text)14print(result.prompt_tokens, result.generation_tokens)
Text-only generation uses the same loaded model:
python
1response = model.generate(2"Explain why local processing can improve clinical-document privacy.",3 max_tokens=96,4)
Pass a local artifact directory instead of the Hub repository ID for a fully
offline deployment. OpenMed validates the Compass artifact, loads weights
strictly, applies the bundled chat template, performs native-resolution image
processing, and generates with MLX. It never enables remote model code.
Swift and iOS through OpenMedKit
OpenMedKit implements Cohere Compass directly in Swift on MLX. Add the tested
OpenMed branch until the implementation is merged and included in a tagged
release:
Load from Hugging Face and ask a question about a local image:
swift
1importOpenMedKit23let model =tryawaitOpenMedVisionLanguageModel.load(4 modelID:"OpenMed/North-Micro-Vision-Instruct-6bit-mlx"5)67let result =tryawait model.generate(8"List the visible medication and dose.",9 imageURL: clinicalDocumentURL,10 maxTokens:12811)1213print(result.text)
For a bundled, app-managed, or air-gapped artifact:
swift
1let model =tryawaitOpenMedVisionLanguageModel.load(2 modelDirectory: localModelDirectory
3)
OpenMedVisionLanguageGeneration exposes decoded text, generated token IDs,
prompt/generation token counts, and timing. Overloads support text-only input,
CIImage, a local image URL, or multiple UserInput.Image values.
The initial Hub download is a network operation. Prompt and image inference is
local after the artifact is cached, with no telemetry and no cloud inference
fallback. For PHI workflows, pre-download or bundle the model before intake,
keep raw documents out of logs and analytics, and apply OpenMedKit privacy
policies before an explicitly authorized export.
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 maps naturally to a privacy-first OpenMedKit pipeline:
Capture or import a page locally on iPhone, iPad, or Mac.
Run image normalization and VLM inference on the device.
Validate names, identifiers, medications, measurements, and other generated
fields against the source page.
Redact or pseudonymize with OpenMedKit policies before any authorized
disclosure.
Preserve provenance and require human review before consequential use.
Local inference reduces a network boundary; it does not make generated content
automatically safe or correct. Never auto-trigger diagnosis, treatment,
disclosure, or another consequential clinical action from model output.
OpenMed runtime validation
Before the runtime and cards were published, every precision was loaded
independently and run through the same synthetic suite in both native runtimes:
exact Tuesday extraction from a short synthetic note;
correct name, synthetic record ID, medication, dose, frequency, and allergy
extraction from a generated clinical-document image;
exact Screening, 42 extraction from a generated chart image;
tokenizer/chat-template and prompt-token-count parity;
native image resize, patch-grid, visual-token, and multimodal decode checks;
macOS execution for all five payloads and an iOS device-target build gate.
The Python and Swift tests use the same prompts, image fixtures, token counts,
and clinical fact acceptance criteria. Canonical fact and chart answers are
also token-exact. Free-form sentences can choose equivalent near-tied tokens
across MLX language bindings, so those are checked for coherence and required
facts instead of brittle punctuation or wording.
openmed-runtime-validation.json records the OpenMed runtime gates for this
variant. openmed-validation.json preserves the original conversion and
independent-reference certificate. Those fixtures are synthetic and are not
clinical-quality evidence.
Artifact contract
Each repository is data-only and includes:
model.safetensors plus its index;
config.json with model_type: cohere_compass;
tokenizer, chat-template, and generation configuration;
native-resolution image processor configuration;
openmed-mlx.json runtime/precision metadata;
OpenMed conversion and native-runtime validation reports.
No conversion-time Python package or executable model code is stored in the
repository. Both OpenMed runtimes consume the same artifact payload.
Scope and limitations
The source model supports visual question answering, grounding, OCR, document
and chart understanding, multilingual prompts, and multiple images. 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, and is intended as a compact foundation for
prototyping and specialization. Native-resolution images can materially
increase memory use, latency, and thermal pressure on mobile devices. Measure
the exact precision, image sizes, and sustained workload on each target device.
This model and OpenMedKit are not medical devices. Outputs can be incomplete,
incorrect, or fabricated. A qualified human must verify consequential use.