alt.freeweights.phi / Phi-3-vision-128k-instruct
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.phiSubject:

Phi-3-vision-128k-instruct

Date: 2026-11-14Commit: ed2772fSigned: 2DC28CC7B26A283B ✓

Text generation model with 4.1B parameters. Safetensors weights, 8.30 GB in all. Published by microsoft under MIT.

4.1B params8.30GBPhi-3-vision-128k-instructsafetensorspermissive
FactsParams4.1BSize8.30 GBFormatssafetensorsTasktext generationLicenseMITFrom sourcepermissive
$ fw get microsoft/Phi-3-vision-128k-instruct
# manifest sha256 6029d83494be… · 8.30 GB · 21 files
$ fw verify ./Phi-3-vision-128k-instruct microsoft/Phi-3-vision-128k-instruct
From sourceHosted (signed)microsoft/Phi-3-vision-128k-instructLast check: 2026-11-14 21:17 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Overview

Size
8.30 GB
Weights
8.29 GB (safetensors)
Parameters
4.1B
Formats
safetensors
Task
text generation
License
MIT (permissive)
Files
21, each with a sha256
Publisher
microsoft
Added
2026-11-14
Section
alt.freeweights.phi
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-14 21:17 UTCpassed

Model card

From the publisher at commit ed2772f. Shown as plain text with links; images open at the publisher.

🎉 Phi-3.5: [[mini-instruct]](https://huggingface.co/microsoft/Phi-3.5-mini-instruct); [[MoE-instruct]](https://huggingface.co/microsoft/Phi-3.5-MoE-instruct) ; [[vision-instruct]](https://huggingface.co/microsoft/Phi-3.5-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:

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:

<|user|>\n<|image_1|>\n{prompt}<|end|>\n<|assistant|>\n 

where the model generates the text after <|assistant|> . In case of multi-turn conversation, the prompt can be formatted as follows:

<|user|>\n<|image_1|>\n{prompt_1}<|end|>\n<|assistant|>\n{response_1}<|end|>\n<|user|>\n{prompt_2}<|end|>\n<|assistant|>\n 
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": "<|image_1|>\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', 'Having tools to manage admin tasks like note-taking or summarization', and 'Having more focus time to sufficiently prepare for meetings'. Each category has an associated bar indicating the level of agreement, measured on a scale from 0% to 100%."}, 
    {"role": "user", "content": "Provide insightful questions to spark discussion."} 
] 

url = "https://assets-c4akfrf5b4d3f4b7.z01.azurefd.net/assets/2024/04/BMDataViz_661fb89f3845e.png" 
image = Image.open(requests.get(url, stream=True).raw) 

prompt = processor.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

inputs = processor(prompt, [image], return_tensors="pt").to("cuda:0") 

generation_args = { 
    "max_new_tokens": 500, 
    "temperature": 0.0, 
    "do_sample": False, 
} 

generate_ids = model.generate(**inputs, eos_token_id=processor.tokenizer.eos_token_id, **generation_args) 

# remove input tokens 
generate_ids = generate_ids[:, inputs['input_ids'].shape[1]:]
response = processor.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0] 

print(response) 

Additional basic examples are provided here.

How to finetune?#

We recommend user to take a look at the Phi-3 CookBook finetuning recipe for Vision

Responsible AI Considerations#

Like other models, the Phi family of models can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:

  • Quality of Service: The Phi models are trained primarily on English text. Languages other than English will experience worse performance. English language varieties with less representation in the training data might experience worse performance than standard American English.
  • Representation of Harms & Perpetuation of Stereotypes: These models can over- or under-represent groups of people, erase representation of some groups, or reinforce demeaning or negative stereotypes. Despite safety post-training, these limitations may still be present due to differing levels of representation of different groups or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
  • Inappropriate or Offensive Content: These models may produce other types of inappropriate or offensive content, which may make it inappropriate to deploy for sensitive contexts without additional mitigations that are specific to the use case.
  • Information Reliability: Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
  • Limited Scope for Code: Majority of Phi-3 training data is based in Python and use common packages such as "typing, math, random, collections, datetime, itertools". If the model generates Python scripts that utilize other packages or scripts in other languages, we strongly recommend users manually verify all API uses.

Developers should apply responsible AI best practices and are responsible for ensuring that a specific use case complies with relevant laws and regulations (e.g. privacy, trade, etc.). Important areas for consideration include:

  • Allocation: Models may not be suitable for scenarios that could have consequential impact on legal status or the allocation of resources or life opportunities (ex: housing, employment, credit, etc.) without further assessments and additional debiasing techniques.
  • High-Risk Scenarios: Developers should assess suitability of using models in high-risk scenarios where unfair, unreliable or offensive outputs might be extremely costly or lead to harm. This includes providing advice in sensitive or expert domains where accuracy and reliability are critical (ex: legal or health advice). Additional safeguards should be implemented at the application level according to the deployment context.
  • Misinformation: Models may produce inaccurate information. Developers should follow transparency best practices and inform end-users they are interacting with an AI system. At the application level, developers can build feedback mechanisms and pipelines to ground responses in use-case specific, contextual information, a technique known as Retrieval Augmented Generation (RAG).
  • Generation of Harmful Content: Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
  • Misuse: Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
  • Identification of individuals: models with vision capabilities may have the potential to uniquely identify individuals in images. Safety post-training steers the model to refuse such requests, but developers should consider and implement, as appropriate, additional mitigations or user consent flows as required in their respective jurisdiction, (e.g., building measures to blur faces in image inputs before processing.

Training#

Model#
  • Architecture: Phi-3-Vision-128K-Instruct has 4.2B parameters and contains image encoder, connector, projector, and Phi-3 Mini language model.
  • Inputs: Text and Image. It’s best suited for prompts using the chat format.
  • Context length: 128K tokens
  • GPUs: 512 H100-80G
  • Training time: 1.5 days
  • Training data: 500B vision and text tokens
  • Outputs: Generated text in response to the input
  • Dates: Our models were trained between February and April 2024
  • Status: This is a static model trained on an offline text dataset with cutoff date Mar 15, 2024. Future versions of the tuned models may be released as we improve models.
  • Release Type: Open weight release
  • Release dates: The model weight is released on May 21, 2024.
Datasets#

Our training data includes a wide variety of sources, and is a combination of

  1. publicly available documents filtered rigorously for quality, selected high-quality educational data and code;
  2. selected high-quality image-text interleave;
  3. newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.), newly created image data, e.g., chart/table/diagram/slides;
  4. high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.

The data collection process involved sourcing information from publicly available documents, with a meticulous approach to filtering out undesirable documents and images. To safeguard privacy, we carefully filtered various image and text data sources to remove or scrub any potentially personal data from the training data.

More details can be found in the Phi-3 Technical Report.

Benchmarks#

To understand the capabilities, we compare Phi-3-Vision-128K-Instruct with a set of models over a variety of zero-shot benchmarks using our internal benchmark platform.

BenchmarkPhi-3 Vision-128K-InLlaVA-1.6 Vicuna-7BQWEN-VL ChatLlama3-Llava-Next-8BClaude-3 HaikuGemini 1.0 Pro VGPT-4V-Turbo
MMMU40.434.239.036.440.742.055.5
MMBench80.576.375.879.462.480.086.1
ScienceQA90.870.667.273.772.079.775.7
MathVista44.531.529.434.833.235.047.5
InterGPS38.120.522.324.632.128.641.0
AI2D76.763.159.866.960.362.874.7
ChartQA81.455.050.965.859.358.062.3
TextVQA70.964.659.455.762.764.768.1
POPE85.887.282.687.074.484.283.7

Software#

Hardware#

Note that by default, the Phi-3-Vision-128K model uses flash attention, which requires certain types of GPU hardware to run. We have tested on the following GPU types:

  • NVIDIA A100
  • NVIDIA A6000
  • NVIDIA H100

License#

The model is licensed under the MIT license.

Trademarks#

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

Data Summary#

https://huggingface.co/microsoft/Phi-3-vision-128k-instruct/blob/main/data_summary_card.md

Files

21 files · 8.30 GBWeights 8.29 GB (safetensors). Sizes and sha256 from the signed manifest.
Show all 21 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
CODE_OF_CONDUCT.md444 B9daeae709a0bd71bcfd1c96dc5822ecec5210327eff929da64b0ae7f8faf1444
LICENSE1.14 KBc2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
README.md15.7 KB2da495714cfd46cf9bcf8db7f748e3c060d7c4db67a58dc1a0d5f0c496bb6e6e
SECURITY.md2.66 KB7b6976eec43edfa68b79a459dd089c56b7a395916dbf1a01bd11e6d86e12128f
SUPPORT.md1.24 KB149773411caf2c59cb1a6bfb2c6f070d1d054f1f018e7a80be319a8c384eeaf5
config.json3.66 KBe3fbad3779524ca7e4186f276cd0fd81e2c2b33aaed3331fcced7253d5f7d391
configuration_phi3_v.py10.6 KB98087e2f3467072e8de80958f51019c0726da6bef418968949305de4cd170e26
data_summary_card.md4.42 KB032ef6f50fd7bc98b696a4778a46ea8ba09773031a7a5f591fd7280b0c476701
image_embedding_phi3_v.py14.1 KBa4a3ab2c86448b34e1402b7dac3ea17d074a7c5f86ad46c0047f2db6267808b2
image_processing_phi3_v.py11.4 KB8470db7ad9c2483f60ca14ed84e5eba99be0ff15b66ef9958754879b85d492bc
model-00001-of-00002.safetensors4.94 GB175b2fe918dd8bd2549e3441615ee0c6d7b1f6d638c0104a614546f55c273482
model-00002-of-00002.safetensors3.35 GBe61ece5a8f0c9663afa06cc22799056f5cc084fb993518bf036dc8e268fd4c94
model.safetensors.index.json68.9 KB72d628080d85b3a0e96eac71a47f7a04a666aabf8a91269100c99a8d543f345c
modeling_phi3_v.py75.4 KBb9caa24798d15931241b4aeeaf0624ab8d11f78ccffe79a0d2821da96ffff06b
preprocessor_config.json464 B7ac4fc569fc58a051e9d8ecca34bed7b23c9655d52062e1a1cfd1bf128fb1bad
processing_phi3_v.py11.3 KB99d029093d9a99478fea4e6cea92b5ff47323903ca5e1af9cc441b0a64d126a8
sample_inference.py5.68 KB78d748b915837b762856cb66e10b8536c5454bbff3c6af712005fc44751d87cd
special_tokens_map.json670 Bf9535fada19315e0d8eb89521cebe111c008fee98d16e7c6744acfb50505d8c3
tokenizer.json1.85 MB005df01af5e16e758ff74c1a31e7b8910eb75c7d5626689d6bdee40a779d44fe
tokenizer_config.json9.40 KB948a2ff1e1cf01d05e4a9880c8145818b3de2a2cb0492eb3eba6fa82fc4fd8ba
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
ed2772fabe pinned now manifest updated, same commit2026-11-14 21:17 UTC21 files · 8.30 GB
ed2772fabe2026-11-14 21:17 UTC21 files · 8.30 GB

Use it

$ fw get microsoft/Phi-3-vision-128k-instruct
# manifest sha256 6029d83494be… · 8.30 GB · 21 files
$ fw verify ./Phi-3-vision-128k-instruct microsoft/Phi-3-vision-128k-instruct
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/Phi-3-vision-128k-instruct.json --dir ./Phi-3-vision-128k-instruct $ python3 fw.py verify ./Phi-3-vision-128k-instruct ./microsoft__Phi-3-vision-128k-instruct.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-3-vision-128k-instruct --revision ed2772fabe9dc9acd0caad54b62761d92520cc44 --local-dir ./Phi-3-vision-128k-instruct
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("microsoft/Phi-3-vision-128k-instruct", revision="ed2772fabe9dc9acd0caad54b62761d92520cc44") model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-vision-128k-instruct", revision="ed2772fabe9dc9acd0caad54b62761d92520cc44", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve microsoft/Phi-3-vision-128k-instruct --revision ed2772fabe9dc9acd0caad54b62761d92520cc44

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-14
Text in
LICENSE
Text sha256
c2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.phiSubject: Phi-3-vision-128k-instructDate: 2026-11-14Commit: ed2772fSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/Phi-3-vision-128k-instruct
Pinned commit
ed2772fabe9dc9acd0caad54b62761d92520cc44
Manifest
Phi-3-vision-128k-instruct.json · .minisig
Manifest sha256
6029d83494becbcebbb6602ca085f60390714a065658e8a5643388f1dab77f4f
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:17 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/Phi-3-vision-128k-instruct.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/Phi-3-vision-128k-instruct.json.minisig $ minisign -Vm Phi-3-vision-128k-instruct.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-3-vision-128k-instruct
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. Phi-3-vision-128k-instruct.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of Phi-3-vision-128k-instruct. Each has its own license check and page.

From: BAAI <huggingface.co/BAAI>Subject: bunny-phi-2-siglip-lora
From: microsoft <huggingface.co/microsoft>Subject: MediPhi
From: microsoft <huggingface.co/microsoft>Subject: MediPhi-Clinical
From: microsoft <huggingface.co/microsoft>Subject: MediPhi-Guidelines
From: microsoft <huggingface.co/microsoft>Subject: MediPhi-Instruct
From: microsoft <huggingface.co/microsoft>Subject: MediPhi-MedCode