Image-Text-to-Text
MLX
Safetensors
mage_vl
vision-language-model
video-understanding
mage-vl
conversational
custom_code
8-bit precision
Instructions to use mlx-community/Mage-VL-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Mage-VL-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("mlx-community/Mage-VL-8bit") config = load_config("mlx-community/Mage-VL-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
| { | |
| "architectures": [ | |
| "MageVLForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_mage_vl.MageVLConfig", | |
| "AutoModel": "modeling_mage_vl.MageVLModel", | |
| "AutoModelForImageTextToText": "modeling_mage_vl.MageVLForConditionalGeneration", | |
| "AutoProcessor": "processing_mage_vl.MageVLProcessor", | |
| "AutoVideoProcessor": "video_processing_mage_vl.MageVLVideoProcessor", | |
| "AutoModelForCausalLM": "modeling_mage_vl.MageVLForConditionalGeneration" | |
| }, | |
| "bos_token_id": 151643, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "generation_config": { | |
| "_from_model_config": true, | |
| "bos_token_id": 151643, | |
| "eos_token_id": 151645, | |
| "transformers_version": "4.57.3" | |
| }, | |
| "image_token_id": 151655, | |
| "model_type": "mage_vl", | |
| "quantization": { | |
| "group_size": 64, | |
| "bits": 8, | |
| "mode": "affine" | |
| }, | |
| "quantization_config": { | |
| "group_size": 64, | |
| "bits": 8, | |
| "mode": "affine" | |
| }, | |
| "text_config": { | |
| "_name_or_path": "/mage-vl/pretrain_models/Qwen3-4B-Instruct-2507", | |
| "architectures": [ | |
| "MageVLForConditionalGeneration" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": 151643, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 2560, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 9728, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 262144, | |
| "max_window_layers": 36, | |
| "model_type": "qwen3", | |
| "num_attention_heads": 32, | |
| "num_hidden_layers": 36, | |
| "num_key_value_heads": 8, | |
| "rms_norm_eps": 1e-06, | |
| "rope_scaling": null, | |
| "sliding_window": null, | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "vocab_size": 151936, | |
| "rope_parameters": { | |
| "rope_theta": 5000000, | |
| "rope_type": "default" | |
| }, | |
| "tie_word_embeddings": false | |
| }, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.7.0", | |
| "video_token_id": 151656, | |
| "vision_config": { | |
| "attention_dropout": 0.0, | |
| "frame_windows_size": 4, | |
| "hidden_act": "gelu", | |
| "hidden_size": 1024, | |
| "image_size": 448, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 4096, | |
| "layer_norm_eps": 1e-06, | |
| "layer_norm_type": "layer_norm", | |
| "model_type": "mage_vl_vision", | |
| "num_attention_heads": 16, | |
| "num_channels": 3, | |
| "num_hidden_layers": 24, | |
| "out_hidden_size": 2560, | |
| "patch_size": 16, | |
| "rope_theta": 10000.0, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 1, | |
| "text_hidden_size": 2560, | |
| "tokens_per_second": 1, | |
| "use_head": false, | |
| "max_position_embeddings": 8192 | |
| }, | |
| "vision_end_token_id": 151653, | |
| "vision_start_token_id": 151652 | |
| } |