Image-Text-to-Text
MLX
Safetensors
English
molmo3
mlx-vlm
apple-silicon
quantized
molmo
multimodal
grounding
spatial
conversational
custom_code
8-bit precision
Run this model with HF Jobs
Run VisualInference/Molmo3-4B-MLX-8bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use VisualInference/Molmo3-4B-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/Molmo3-4B-MLX-8bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("VisualInference/Molmo3-4B-MLX-8bit") config = load_config("VisualInference/Molmo3-4B-MLX-8bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Download chat_template.jinja from VisualInference/Molmo3-4B-MLX-8bit: direct link, hf CLI and curl.
- Browser
- Download file 2.92 kB
-
https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit/resolve/main/chat_template.jinja
- Command line
-
hf download hf://VisualInference/Molmo3-4B-MLX-8bit/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/VisualInference/Molmo3-4B-MLX-8bit/resolve/main/chat_template.jinja
2.92 kB
| {#- Count the images of the conversation. If there are more than one, each is prefixed with "Image <n>" -#} | |
| {%- set counts = namespace(images=0, image=0) -%} | |
| {%- for message in messages -%} | |
| {%- if message['content'] is not string -%} | |
| {%- for item in message['content'] -%} | |
| {%- if item['type'] == 'image' -%} | |
| {%- set counts.images = counts.images + 1 -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- for message in messages -%} | |
| {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) or message['role'] not in ['user', 'assistant'] -%} | |
| {{- raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') -}} | |
| {%- endif -%} | |
| {%- set text = namespace(value='') -%} | |
| {%- if message['content'] is string -%} | |
| {%- set text.value = message['content'] -%} | |
| {%- else -%} | |
| {%- for item in message['content'] -%} | |
| {%- if item['type'] == 'image' -%} | |
| {%- set counts.image = counts.image + 1 -%} | |
| {%- if counts.images > 1 -%} | |
| {%- set text.value = text.value + 'Image ' + counts.image|string -%} | |
| {%- endif -%} | |
| {%- set text.value = text.value + '<|image|>' -%} | |
| {%- elif item['type'] == 'video' -%} | |
| {%- set text.value = text.value + '<|video|>' -%} | |
| {%- elif item['type'] == 'text' -%} | |
| {%- if item['style'] is defined and item['style'] -%} | |
| {%- set text.value = text.value + item['style'] + ': ' + item['text'] -%} | |
| {%- else -%} | |
| {%- set text.value = text.value + item['text'] -%} | |
| {%- endif -%} | |
| {%- elif item['type'] == 'points' -%} | |
| {%- set coords = namespace(value='') -%} | |
| {%- for coordinate in item['coordinates'] -%} | |
| {%- set coords.value = coords.value + '<|POINT_PATCH|><|POINT_SUBPATCH|><|POINT_LOC|>' + loop.index|string -%} | |
| {%- endfor -%} | |
| {%- set tag = '<points coords="' + coords.value + '<|POINT_PATCH|>"' -%} | |
| {%- if item['label'] is defined and item['label'] -%} | |
| {%- set text.value = text.value + tag + '>' + item['label'] + '</points>' -%} | |
| {%- else -%} | |
| {%- set text.value = text.value + tag + '/>' -%} | |
| {%- endif -%} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- endif -%} | |
| {%- if message['role'] == 'user' -%} | |
| {%- if not loop.first -%} | |
| {{- '<|im_end|>\n' -}} | |
| {%- endif -%} | |
| {{- '<|im_start|>user\n' + text.value + '<|im_end|>\n' -}} | |
| {%- else -%} | |
| {{- '<|im_start|>assistant\n' + text.value -}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{- '<|im_start|>assistant\n' -}} | |
| {%- endif -%} | |