Model reference · open weights
AIN is an open-weight language model from MBZUAI. AIN (FP32) weighs 16.6 GB; the smallest configuration that runs it is 2× RTX 3060 12 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the MBZUAI/AIN model card, 2026-10-01
What it is
| Released by | MBZUAI |
|---|---|
| Released | 2025-01-07 |
| Parameters | 8.3B |
| VRAM | 16.6 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB … RTX 4060 Ti 16 GB 2 smaller cards | ||||
| RTX 3090 24 GB | 10 | 2 | all 32K | 23.4 GB |
| RTX 4090 24 GB | 9 | 2 | all 32K | 23.4 GB |
| RTX 5090 32 GB | 26 | 6 | all 32K | 31.0 GB |
| L40S 48 GB | 53 | 13 | all 32K | 44.0 GB |
| A100 80 GB | 126 | 31 | all 32K | 78.2 GB |
| H100 80 GB | 117 | 29 | all 32K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 150 | 37 | all 32K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 179 | 44 | all 32K | 107 GB |
| H200 141 GB | 244 | 61 | all 32K | 138 GB |
| B200 180 GB | 324 | 81 | all 32K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 5 | 1 | all 32K | 11.6 GB a card |
| 2× RTX 4060 Ti 16 GB tensor parallel | 21 | 5 | all 32K | 15.4 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 19.1 GB | 20.5 GB |
| 5 | 21.0 GB | 28.1 GB |
| 8 | 22.4 GB | 33.7 GB |
| 16 | 26.2 GB | 48.7 GB |
| 32 | 33.7 GB | 78.8 GB |
| 64 | 48.7 GB | 139 GB |
One card, with vLLM's small-card settings.
From the model card
Ahmed Heakl * Sara Ghaboura * Omkar Thawakar Fahad Shahbaz Khan Hisham Cholakkal Rao M. Anwer Salman Khan
Amid the swift progress of large language models (LLMs) and their evolution into large multimodal models (LMMs), significant strides have been made in high-resource languages such as English and Chinese. While Arabic LLMs have seen notable progress, Arabic LMMs remain largely unexplored, often narrowly focusing on a few specific aspects of the language and visual understanding. To bridge this gap, we introduce AIN - the Arabic Inclusive Multimodal Model- designed to excel across diverse domains.
AIN is an English-Arabic bilingual LMM designed to excel in English and Arabic, leveraging carefully constructed 3.6 million high-quality Arabic-English multimodal data samples. AIN demonstrates state-of-the-art Arabic performance, while also possessing strong English-language visual capabilities.
Please install the qwen vision kit. This includes base64, URLs, and interleaved images and videos. You can install it using the following command:
pip install qwen-vl-utils
Here we show a code snippet to show you how to use the chat model with transformers and qwen_vl_utils:
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
# default: Load the model on the available device(s)
model = Qwen2VLForConditionalGeneration.from_pretrained(
"MBZUAI/AIN", torch_dtype="auto", device_map="auto"
)
# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
# model = Qwen2VLForConditionalGeneration.from_pretrained(
# "MBZUAI/AIN",
# torch_dtype=torch.bfloat16,
# attn_implementation="flash_attention_2",
# device_map="auto",
# )
# default processer
processor = AutoProcessor.from_pretrained("MBZUAI/AIN")
# The default range for the number of visual tokens per image in the model is 4-16384. You can set min_pixels and max_pixels according to your needs, such as a token count range of 256-1280, to balance speed and memory usage.
# min_pixels = 256*28*28
# max_pixels = 1280*28*28
# processor = AutoProcessor.from_pretrained("MBZUAI/AIN", min_pixels=min_pixels, max_pixels=max_pixels)
messages = [
{
"role": "user",
"content": [
{
"type": "image",
"image": "https://huggingface.co/MBZUAI/AIN/resolve/main/assets_hf/demo_image.jpeg",
},
{"type": "text", "text": "يرجى وصف هذه الصورة."},
],
}
]
# Preparation for inference
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
padding=True,
return_tensors="pt",
)
inputs = inputs.to("cuda")
# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
from PIL import Image
import requests
import torch
from torchvision import io
from typing import Dict
from transformers import Qwen2VLForConditionalGeneration, AutoTokenizer, AutoProcessor
# Load the model in half-precision on the available device(s)
model = Qwen2VLForConditionalGeneration.from_pretrained(
"MBZUAI/AIN", torch_dtype="auto", device_map="auto"
)
processor = AutoProcessor.from_pretrained("MBZUAI/AIN")
# Image
url = "https://huggingface.co/MBZUAI/AIN/resolve/main/assets_hf/demo_image.jpeg"
image = Image.open(requests.get(url, stream=True).raw)
conversation = [
{
"role": "user",
"content": [
{
"type": "image",
},
{"type": "text", "text": "Describe this image in Arabic."},
],
}
]
# Preprocess the inputs
text_prompt = processor.apply_chat_template(conversation, add_generation_prompt=True)
# Excepted output: 'system\nYou are a helpful assistant.\nuser\nDescribe this image.\nassistant\n'
inputs = processor(
text=[text_prompt], images=[image], padding=True, return_tensors="pt"
)
inputs = inputs.to("cuda")
# Inference: Generation of the output
output_ids = mQuoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.