Model reference · open weights
Phi-3-vision-128k is an open-weight language model from microsoft. Phi-3-vision-128k-instruct (BF16) weighs 8.3 GB; the smallest configuration that runs it is RTX 4060 Ti 16 GB.
For self-hosting, compare this build's requirements below with the GPU you plan to rent.
Summary of the microsoft/Phi-3-vision-128k-instruct model card, 2026-10-01
What it is
| Released by | microsoft |
|---|---|
| Released | 2024-05-19 |
| Parameters | 4.1B |
| VRAM | 8.3 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 6K | 11.6 GB | ||
| RTX 4060 Ti 16 GB | 2 | 16K | 15.4 GB | |
| RTX 3090 24 GB | 4 | 1 | 36K | 23.4 GB |
| RTX 4090 24 GB | 4 | 1 | 35K | 23.4 GB |
| RTX 5090 32 GB | 6 | 1 | 54K | 31.0 GB |
| L40S 48 GB | 10 | 2 | 87K | 44.0 GB |
| A100 80 GB | 21 | 5 | all 128K | 78.2 GB |
| H100 80 GB | 20 | 5 | all 128K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 25 | 6 | all 128K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 29 | 7 | all 128K | 107 GB |
| H200 141 GB | 39 | 9 | all 128K | 138 GB |
| B200 180 GB | 50 | 12 | all 128K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 4 | 1 | 34K | 11.6 GB a card |
| 2× RTX 4060 Ti 16 GB tensor parallel | 6 | 1 | 53K | 15.4 GB a card |
| 2× RTX 4090 24 GB tensor parallel | 11 | 2 | 92K | 23.4 GB a card |
| 2× RTX 3090 24 GB tensor parallel | 11 | 2 | 92K | 23.4 GB a card |
| 2× RTX 5090 32 GB tensor parallel | 16 | 4 | all 128K | 31.0 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 12.1 GB | 21.8 GB |
| 5 | 25.0 GB | 73.3 GB |
| 8 | 34.6 GB | 112 GB |
| 16 | 60.4 GB | 215 GB |
| 32 | 112 GB | 421 GB |
| 64 | 215 GB | 834 GB |
One card, with vLLM's small-card settings.
From the model card
🎉 Phi-3.5: [mini-instruct]; [MoE-instruct] ; [vision-instruct]
The Phi-3-Vision-128K-Instruct is a lightweight, state-of-the-art open multimodal model built upon datasets which include - synthetic data and filtered publicly available websites - with a focus on very high-quality, reasoning dense data both on text and vision. The model belongs to the Phi-3 model family, and the multimodal version comes with 128K context length (in tokens) it can support. The model underwent a rigorous enhancement process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures.
Resources and Technical Documentation:
| Short Context | Long Context | |
|---|---|---|
| Mini | 4K [HF] ; [ONNX] ; [GGUF] | 128K [HF] ; [ONNX] |
| Small | 8K [HF] ; [ONNX] | 128K [HF] ; [ONNX] |
| Medium | 4K [HF] ; [ONNX] | 128K [HF] ; [ONNX] |
| Vision | 128K [HF] ; [ONNX] |
Primary use cases
The model is intended for broad commercial and research use in English. The model provides uses for general purpose AI systems and applications with visual and text input capabilities which require
Our model is designed to accelerate research on efficient language and multimodal models, for use as a building block for generative AI powered features.
Use case considerations
Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fairness before using within a specific downstream use case, particularly for high-risk scenarios. Developers should be aware of and adhere to applicable laws or regulations (including privacy, trade compliance laws, etc.) that are relevant to their use case.
Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.
Phi-3-Vision-128K-Instruct has been integrated in the development version (4.40.2) of transformers. Until the official version is released through pip, ensure that you are doing one of the following:
When loading the model, ensure that trust_remote_code=True is passed as an argument of the from_pretrained() function.
Update your local transformers to the development version: pip uninstall -y transformers && pip install git+https://github.com/huggingface/transformers. The previous command is an alternative to cloning and installing from the source.
The current transformers version can be verified with: pip list | grep transformers.
Examples of required packages:
flash_attn==2.5.8
numpy==1.24.4
Pillow==10.3.0
Requests==2.31.0
torch==2.3.0
torchvision==0.18.0
transformers==4.40.2
Phi-3-Vision-128K-Instruct is also available in Azure AI Studio.
Given the nature of the training data, the Phi-3-Vision-128K-Instruct model is best suited for a single image input wih prompts using the chat format as follows. You can provide the prompt as a single image with a generic template as follow:
where the model generates the text after `` . In case of multi-turn conversation, the prompt can be formatted as follows:
This code snippets show how to get quickly started with running the model on a GPU:
from PIL import Image
import requests
from transformers import AutoModelForCausalLM
from transformers import AutoProcessor
model_id = "microsoft/Phi-3-vision-128k-instruct"
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cuda", trust_remote_code=True, torch_dtype="auto", _attn_implementation='flash_attention_2') # use _attn_implementation='eager' to disable flash attention
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
messages = [
{"role": "user", "content": "\nWhat is shown in this image?"},
{"role": "assistant", "content": "The chart displays the percentage of respondents who agree with various statements about their preparedness for meetings. It shows five categories: 'Having clear and pre-defined goals for meetings', 'Knowing where to find the information I need for a meeting', 'Understanding my exact role and responsibilities when I'm invited', 'Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.