Image-Text-to-Text
Transformers
Safetensors
cohere_compass
vision
multimodal
conversational
multilingual
native-resolution
Instructions to use CohereLabs/North-Micro-Vision-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CohereLabs/North-Micro-Vision-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CohereLabs/North-Micro-Vision-Instruct") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("CohereLabs/North-Micro-Vision-Instruct") model = AutoModelForMultimodalLM.from_pretrained("CohereLabs/North-Micro-Vision-Instruct", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CohereLabs/North-Micro-Vision-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CohereLabs/North-Micro-Vision-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/North-Micro-Vision-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/CohereLabs/North-Micro-Vision-Instruct
- SGLang
How to use CohereLabs/North-Micro-Vision-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CohereLabs/North-Micro-Vision-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/North-Micro-Vision-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CohereLabs/North-Micro-Vision-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CohereLabs/North-Micro-Vision-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use CohereLabs/North-Micro-Vision-Instruct with Docker Model Runner:
docker model run hf.co/CohereLabs/North-Micro-Vision-Instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -151,6 +151,16 @@ print(response)
|
|
| 151 |
|
| 152 |
The example uses the recommended Transformers sampling settings. For deterministic output, set `do_sample=False` and omit `temperature`, `top_p`, and `top_k`.
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
### Grounding Coordinates
|
| 155 |
|
| 156 |
Bounding boxes are returned as `[x1, y1, x2, y2]` on a normalized 0–1000 scale. Map them back to the original image by scaling each axis:
|
|
@@ -194,6 +204,19 @@ North Micro Vision Instruct is intended for research and development use cases s
|
|
| 194 |
- Multimodal training used an 8K-token context; longer contexts have not been validated.
|
| 195 |
- Native-resolution inputs can increase memory use and latency as image dimensions grow.
|
| 196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
## Benchmark Results
|
| 198 |
|
| 199 |
The complete comparison is provided below. We ran vision-language and text-only evaluations with [VLMEvalKit](https://github.com/open-compass/vlmevalkit), capping generation at 1,024 tokens; see the [technical blog post](https://huggingface.co/blog/CohereLabs/meet-north-micro-vision-instruct) for the full methodology.
|
|
|
|
| 151 |
|
| 152 |
The example uses the recommended Transformers sampling settings. For deterministic output, set `do_sample=False` and omit `temperature`, `top_p`, and `top_k`.
|
| 153 |
|
| 154 |
+
## Architecture
|
| 155 |
+
|
| 156 |
+
North Micro Vision combines a custom-trained 400M-parameter native-resolution vision encoder with an in-house 2B-parameter language model North Micro LLM. The language model follows our Command A+ architecture, interleaving three sliding-window attention layers that use rotary positional embeddings with one global attention layer without positional embeddings. The vision encoder combines 2D RoPE with learned 1D positional embeddings to preserve spatial structure across native-resolution inputs.
|
| 157 |
+
|
| 158 |
+
The projector maps visual features into the language model's embedding space. Following DeepStack, patch embeddings from multiple vision-encoder layers are injected into corresponding early LLM layers, giving the language model access to visual representations at different levels of abstraction.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
*High-level North Micro Vision architecture, consisting of a native-resolution vision encoder, a projector, and a language model.*
|
| 162 |
+
|
| 163 |
+
|
| 164 |
### Grounding Coordinates
|
| 165 |
|
| 166 |
Bounding boxes are returned as `[x1, y1, x2, y2]` on a normalized 0–1000 scale. Map them back to the original image by scaling each axis:
|
|
|
|
| 204 |
- Multimodal training used an 8K-token context; longer contexts have not been validated.
|
| 205 |
- Native-resolution inputs can increase memory use and latency as image dimensions grow.
|
| 206 |
|
| 207 |
+
## Ecosystem Support
|
| 208 |
+
|
| 209 |
+
### Fast Inference 🚀
|
| 210 |
+
|
| 211 |
+
- [MLX-VLM model weights](https://huggingface.co/collections/mlx-community/north-micro-vision) - Community-contributed by Prince Canuma and Neywa.
|
| 212 |
+
|
| 213 |
+
### Fine-tuning
|
| 214 |
+
|
| 215 |
+
In partnership with NVIDIA, we're also shipping an AutoModel recipe for North Micro Vision, so developers can fine-tune and deploy it on NVIDIA GPUs right out of the box.
|
| 216 |
+
|
| 217 |
+
- [NVIDIA AutoModel recipe](https://github.com/NVIDIA-NeMo/Automodel/tree/main/examples/vlm_finetune/cohere_micro_vision) - Fine-tune and deploy North Micro Vision on NVIDIA GPUs.
|
| 218 |
+
- [Axolotl fine-tuning support](https://docs.axolotl.ai/docs/models/cohere-north-micro-vision-instruct.html) - Community-supported fine-tuning using the Axolotl framework.
|
| 219 |
+
|
| 220 |
## Benchmark Results
|
| 221 |
|
| 222 |
The complete comparison is provided below. We ran vision-language and text-only evaluations with [VLMEvalKit](https://github.com/open-compass/vlmevalkit), capping generation at 1,024 tokens; see the [technical blog post](https://huggingface.co/blog/CohereLabs/meet-north-micro-vision-instruct) for the full methodology.
|