Model reference · open weights

Phi-3-vision-128k

LLMs microsoft Text gen 1 build Open weights 65k dl/mo

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.

  • Phi-3-vision-128k is a multimodal model developed by Microsoft for text generation tasks involving both text and image inputs.
  • It features 4.1 billion parameters and supports a context length of 131,072 tokens.
  • The model is multilingual and released under the MIT license.

Summary of the microsoft/Phi-3-vision-128k-instruct model card, 2026-10-01

What it is

Released bymicrosoft
Released2024-05-19
Parameters4.1B
VRAM8.3 GB for the weights

What it runs on

Memory and cards for Phi-3-vision-128k-instruct (BF16)

8.3 GBweights, file size
393 MBcache per 1K tokens
580 MBruntime overhead, at least
131,072 tokenscontext max
CardRequests at onceContext maxMemory
8K each32K each
RTX 3060 12 GB6K11.6 GB
RTX 4060 Ti 16 GB216K15.4 GB
RTX 3090 24 GB4136K23.4 GB
RTX 4090 24 GB4135K23.4 GB
RTX 5090 32 GB6154K31.0 GB
L40S 48 GB10287K44.0 GB
A100 80 GB215all 128K78.2 GB
H100 80 GB205all 128K78.1 GB
RTX PRO 6000 Blackwell 96 GB256all 128K93.8 GB
DGX Spark (GB10) 128 GB unified297all 128K107 GB
H200 141 GB399all 128K138 GB
B200 180 GB5012all 128K176 GB
2× RTX 3060 12 GB
tensor parallel
4134K11.6 GB a card
2× RTX 4060 Ti 16 GB
tensor parallel
6153K15.4 GB a card
2× RTX 4090 24 GB
tensor parallel
11292K23.4 GB a card
2× RTX 3090 24 GB
tensor parallel
11292K23.4 GB a card
2× RTX 5090 32 GB
tensor parallel
164all 128K31.0 GB a card
Memory needed at each load
Requests at once8K tokens each32K tokens each
112.1 GB21.8 GB
525.0 GB73.3 GB
834.6 GB112 GB
1660.4 GB215 GB
32112 GB421 GB
64215 GB834 GB

One card, with vLLM's small-card settings.

From the model card

What microsoft says about Phi-3-vision-128k

Read the model card

🎉 Phi-3.5: [mini-instruct]; [MoE-instruct] ; [vision-instruct]

Model Summary

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 ContextLong Context
Mini4K [HF] ; [ONNX] ; [GGUF]128K [HF] ; [ONNX]
Small8K [HF] ; [ONNX]128K [HF] ; [ONNX]
Medium4K [HF] ; [ONNX]128K [HF] ; [ONNX]
Vision128K [HF] ; [ONNX]

Intended Uses

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

  1. memory/compute constrained environments;
  2. latency bound scenarios;
  3. general image understanding;
  4. OCR;
  5. chart and table understanding.

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.

How to Use

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.

Chat Format

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:

Sample inference code

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.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms