alt.freeweights.phi / phi-4-onnx
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.phiSubject:

phi-4-onnx

Date: 2026-11-15Commit: c4e245bSigned: 2DC28CC7B26A283B ✓

Model. Onnx weights, 19.9 GB in all. Published by microsoft under MIT.

phi19.9GBphi-4-onnxonnxpermissive
FactsParamsnot statedSize19.9 GBFormatsonnxTasknot taggedLicenseMITFrom sourcepermissive
$ fw get microsoft/phi-4-onnx
# manifest sha256 dfa293b1ae2d… · 19.9 GB · 25 files
$ fw verify ./phi-4-onnx microsoft/phi-4-onnx
From sourceHosted (signed)microsoft/phi-4-onnxLast check: 2026-11-15 03:51 UTC

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

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Scan with

Overview

Size
19.9 GB
Weights
266 KB (smallest of 2 ONNX variants)
Parameters
not stated
Formats
onnx
Task
not tagged
License
MIT (permissive)
Files
25, each with a sha256
Publisher
microsoft
Added
2026-11-15
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-15 03:51 UTCpassed

Model card

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

Phi-4 ONNX models#

Introduction#

This repository hosts the optimized versions of the Phi-4 models to accelerate inference with ONNX Runtime.

Optimized models are published here in ONNX format to run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, Linux and Mac desktops, and mobile CPUs, with the precision best suited to each of these targets.

Here are some of the optimized configurations we have added:

  1. ONNX model for int4 CPU: ONNX model for CPU and mobile using int4 quantization via RTN.
  2. ONNX model for int4 GPU: ONNX model for GPU using int4 quantization via RTN.

Model Run#

You can see how to run examples with ORT GenAI here

For CPU:

# Download the model directly using the Hugging Face CLI
huggingface-cli download microsoft/phi-4-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .

# Install the CPU package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai

# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-qa.py -o model-qa.py
python model-qa.py -m cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4 -e cpu

For CUDA:

# Download the model directly using the Hugging Face CLI
huggingface-cli download microsoft/phi-4-onnx --include gpu/* --local-dir .

# Install the CUDA package of ONNX Runtime GenAI
pip install --pre onnxruntime-genai-cuda

# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-qa.py -o model-qa.py
python model-qa.py -m gpu/gpu-int4-rtn-block-32 -e cuda

For DirectML:

# Download the model directly using the Hugging Face CLI
huggingface-cli download microsoft/phi-4-onnx --include gpu/* --local-dir .

# Install the DML package of ONNX Runtime GenAI
onnxruntime-genai-directml

# Please adjust the model directory (-m) accordingly
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/common.py -o common.py
curl https://raw.githubusercontent.com/microsoft/onnxruntime-genai/main/examples/python/model-qa.py -o model-qa.py
python model-qa.py -m gpu/gpu-int4-rtn-block-32 -e dml

Model Description#

  • Developed by: Microsoft
  • Model type: ONNX
  • License: MIT
  • Model Description: This is a conversion of the Phi-4 model for ONNX Runtime inference.

Disclaimer: Model is only an optimization of the base model, any risk associated with the model is the responsibility of the user of the model. Please verify and test for your scenarios. There may be a slight difference in output from the base model with the optimizations applied.

Base Model#

Phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning. See details at https://huggingface.co/microsoft/phi-4

Files

25 files · 19.9 GBWeights 266 KB (smallest of 2 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 25 files with their sha256
FileSizesha256
.gitattributes1.61 KB6d37258060e6eabdd54ea002644865fdaaa41030cb2a01fb037333493b169d10
LICENSE1.10 KBc49419617a6070bcb197cfe272f7007fdec3e790dbb529cb995473bd69c0bd51
README.md3.50 KB41eeabdae691a880ed761ba34365f09df0cddd902763488706233360d2b59326
config.json802 B07eedad2c48798b6e3728e4a1b75e0e092019a375ba725a40e40c78d13664045
configuration_phi3.py10.9 KBec2044b77d0b8111640ac134daa3af1f40dc552a739f8959626e7e58ea3352df
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/config.json802 B07eedad2c48798b6e3728e4a1b75e0e092019a375ba725a40e40c78d13664045
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/configuration_phi3.py10.9 KBec2044b77d0b8111640ac134daa3af1f40dc552a739f8959626e7e58ea3352df
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/genai_config.json1.52 KBcb5ffa9107d84fe58e1fbacc3819ea88422f00eaab7c28b8ac75fc3089c4b932
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/merges.txt917 KBb6fe424e334903f7fb84d3a106d9730455f4744b9fe3c21ee136d97a00e72502
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx266 KBf57c1187064f9fb47cadf6ade3b8a38c6256a92b2b19ffd675f63ae71de93465
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx.data10.9 GB9a91462a3fe396cd28b99351baa3b19f6373056766d0f28ec024c6612d747f30
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/special_tokens_map.json575 B80b78737e654c58bfdeca896e45765563f37252efe982251ede7aee157b8549b
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer.json7.15 MBc612e57b2763204798271c0cdc14a373a565e6a371f1bfbd44e385a8391c9884
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer_config.json17.7 KB0eb6d6c0b18f0730c9714dd429004c66aac14b59cd05ee88b9f825a24c12f575
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/vocab.json1.61 MB741943243bd0035a8082ef0ccc09ef62e7ce7ec2f2f053aeedd808dba1c2ffc5
gpu/gpu-int4-rtn-block-32/config.json802 B07eedad2c48798b6e3728e4a1b75e0e092019a375ba725a40e40c78d13664045
gpu/gpu-int4-rtn-block-32/configuration_phi3.py10.9 KBec2044b77d0b8111640ac134daa3af1f40dc552a739f8959626e7e58ea3352df
gpu/gpu-int4-rtn-block-32/genai_config.json1.57 KB0230ec1c6d3761342d3fd435780f23df6a18ec3fffd2fb158fe39e2e8fd6e6ff
gpu/gpu-int4-rtn-block-32/merges.txt917 KBb6fe424e334903f7fb84d3a106d9730455f4744b9fe3c21ee136d97a00e72502
gpu/gpu-int4-rtn-block-32/model.onnx359 KB94ce65a52a4ef7fcea28bb5e5a677bf57968116f68c50a5b6ba63e4439fe85c1
gpu/gpu-int4-rtn-block-32/model.onnx.data8.99 GBaf8d99d133c18ac59cc84395cb8ee2a82e753c4662366a40c69ea34ff561fa19
gpu/gpu-int4-rtn-block-32/special_tokens_map.json575 B80b78737e654c58bfdeca896e45765563f37252efe982251ede7aee157b8549b
gpu/gpu-int4-rtn-block-32/tokenizer.json7.15 MBc612e57b2763204798271c0cdc14a373a565e6a371f1bfbd44e385a8391c9884
gpu/gpu-int4-rtn-block-32/tokenizer_config.json17.7 KB0eb6d6c0b18f0730c9714dd429004c66aac14b59cd05ee88b9f825a24c12f575
gpu/gpu-int4-rtn-block-32/vocab.json1.61 MB741943243bd0035a8082ef0ccc09ef62e7ce7ec2f2f053aeedd808dba1c2ffc5
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
c4e245b577 pinned now2026-11-15 03:51 UTC25 files · 19.9 GB

Use it

$ fw get microsoft/phi-4-onnx
# manifest sha256 dfa293b1ae2d… · 19.9 GB · 25 files
$ fw verify ./phi-4-onnx microsoft/phi-4-onnx
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/phi-4-onnx.json --dir ./phi-4-onnx $ python3 fw.py verify ./phi-4-onnx ./microsoft__phi-4-onnx.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/phi-4-onnx --revision c4e245b57793e8481e0fa9252b3a45dee44a921b --local-dir ./phi-4-onnx

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-15
Text in
LICENSE
Text sha256
c49419617a6070bcb197cfe272f7007fdec3e790dbb529cb995473bd69c0bd51
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-4-onnxDate: 2026-11-15Commit: c4e245bSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/phi-4-onnx
Pinned commit
c4e245b57793e8481e0fa9252b3a45dee44a921b
Manifest
phi-4-onnx.json · .minisig
Manifest sha256
dfa293b1ae2dc01977ead85288298ab97566b823d4869665b3d7cde6495653d0
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:51 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/phi-4-onnx.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/phi-4-onnx.json.minisig $ minisign -Vm phi-4-onnx.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

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/phi-4-onnx
Open in Freeweights Studio

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

Signed manifest
minisign, key 2DC28CC7B26A283B. phi-4-onnx.json. Provenance. Takedown history: none.
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