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

Phi-4-mini-instruct-onnx

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

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

phi8.37GBPhi-4-mini-instruct-onnxonnxpermissive
FactsParamsnot statedSize8.37 GBFormatsonnxTasknot taggedLicenseMITFrom sourcepermissive
$ fw get microsoft/Phi-4-mini-instruct-onnx
# manifest sha256 494297e8ecfc… · 8.37 GB · 27 files
$ fw verify ./Phi-4-mini-instruct-onnx microsoft/Phi-4-mini-instruct-onnx
From sourceHosted (signed)microsoft/Phi-4-mini-instruct-onnxLast check: 2026-11-15 03:45 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
8.37 GB
Weights
287 KB (smallest of 2 ONNX variants)
Parameters
not stated
Formats
onnx
Task
not tagged
License
MIT (permissive)
Files
27, 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:45 UTCpassed

Model card

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

Phi-4-Mini-Instruct ONNX models#

Introduction#

This repository hosts the optimized versions of the Phi-4 mini 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-mini-instruct-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-mini-instruct-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-mini-instruct-onnx --include gpu/* --local-dir .

# Install the DML package of ONNX Runtime GenAI
pip install --pre 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 mini 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-Mini is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures. See details at https://huggingface.co/microsoft/Phi-4-mini-instruct/blob/main/README.md

Performance Comparison#

HardwareONNXPyTorchspeedup
RTX 4090 GPUint4: 260.045 tokens/sec fp16: 97.463 tokens/se fp32: 19.320 tokens/secfp16: 43.957 tokens/sec5x(fp16)
Intel Xeon Platinum 8272CL CPUint4: 16.89 tokens/secfp32: 1.636 tokens/sec10x
Intel Xeon Platinum 8573B CPUint4: 23.978 tokens/secfp32: 4.479 tokens/sec5.35X
AMD EPYC 7763v CPUint4: 19.884 tokens/secfp32: 1.599 tokens/sec12.4x
Intel Core Ultra 7 165H Laptop CPUint4: 4.863 tokens/secfp32: 1.699 tokens/sec2.8x
Intel i7 processorint4: 3.474 tokens/sec fp32: 1.800 tokens/secfp32: 0.702 tokens/sec4.85x

Files

27 files · 8.37 GBWeights 287 KB (smallest of 2 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 27 files with their sha256
FileSizesha256
.gitattributes1.61 KB6d37258060e6eabdd54ea002644865fdaaa41030cb2a01fb037333493b169d10
LICENSE1.08 KBfa8235e5b48faca34e3ca98cf4f694ef08bd216d28b58071a1f85b1d50cb814d
README.md4.66 KBa7b2d46a8e5bd4c98a06a20dd4ffe9a031294ff9ff366a801189d942651342fe
config.json2.50 KBac65d86061d3d0d704ee2511fd0eb8713ef19eb6eedba17c3080a4165d5b933b
configuration_phi3.py10.9 KBec2044b77d0b8111640ac134daa3af1f40dc552a739f8959626e7e58ea3352df
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/added_tokens.json249 Bd4f2aceb0f20b71dd1f4bcc7e052e4412946bf281840b8f83d39f259571af486
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/config.json2.50 KBac65d86061d3d0d704ee2511fd0eb8713ef19eb6eedba17c3080a4165d5b933b
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 KB0fcfa1e663f2bc867f8dc62fae65dd0924f0a4d68b43d1234df742dd19171470
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/merges.txt2.42 MB856ce61180bb689282eed6b3a6838bb1f438399be23aefe9d20eb379791fb4ad
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx52.1 MB701aa5d185b6a782bc27104a990dd5b634fa507840b7c42f7ee6f1fb812d0b83
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx.data4.86 GBcb0267fa60befa1a4ade8c98b6d32a3d67f51abbd307c7f793f132e8d9092131
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/special_tokens_map.json587 Baff38493227d813e29fcf8406e8e90062f1f031aa47d589325e9c31d89ac7cc3
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer.json15.5 MB382cc235b56c725945e149cc25f191da667c836655efd0857b004320e90e91ea
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer_config.json2.96 KBc565326a315fbe62cda093a59d298828c8f3f823122661325f41f3ba577a7dec
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/vocab.json3.91 MB6cb65a857824fa6615bb1782d95d882617a8bbce1da0317118586b36f39e98bd
gpu/gpu-int4-rtn-block-32/added_tokens.json249 Bd4f2aceb0f20b71dd1f4bcc7e052e4412946bf281840b8f83d39f259571af486
gpu/gpu-int4-rtn-block-32/config.json2.50 KBac65d86061d3d0d704ee2511fd0eb8713ef19eb6eedba17c3080a4165d5b933b
gpu/gpu-int4-rtn-block-32/configuration_phi3.py10.9 KBec2044b77d0b8111640ac134daa3af1f40dc552a739f8959626e7e58ea3352df
gpu/gpu-int4-rtn-block-32/genai_config.json1.57 KB3cdbd2ff0b2cda7829b262cda331a72b99daaa758d55bb056bb4d098d22b1140
gpu/gpu-int4-rtn-block-32/merges.txt2.42 MB856ce61180bb689282eed6b3a6838bb1f438399be23aefe9d20eb379791fb4ad
gpu/gpu-int4-rtn-block-32/model.onnx287 KBf8ff300b85719f79f1c220c88575626c62cc772a228244a6b96031d1a8d25250
gpu/gpu-int4-rtn-block-32/model.onnx.data3.41 GBb32f38f9211040b01c1483759cef7a6cce28df9f83b6b8bb91a474575d559d0f
gpu/gpu-int4-rtn-block-32/special_tokens_map.json587 Baff38493227d813e29fcf8406e8e90062f1f031aa47d589325e9c31d89ac7cc3
gpu/gpu-int4-rtn-block-32/tokenizer.json15.5 MB382cc235b56c725945e149cc25f191da667c836655efd0857b004320e90e91ea
gpu/gpu-int4-rtn-block-32/tokenizer_config.json2.96 KBc565326a315fbe62cda093a59d298828c8f3f823122661325f41f3ba577a7dec
gpu/gpu-int4-rtn-block-32/vocab.json3.91 MB6cb65a857824fa6615bb1782d95d882617a8bbce1da0317118586b36f39e98bd
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
fc04c8f93d pinned now2026-11-15 03:45 UTC27 files · 8.37 GB

Use it

$ fw get microsoft/Phi-4-mini-instruct-onnx
# manifest sha256 494297e8ecfc… · 8.37 GB · 27 files
$ fw verify ./Phi-4-mini-instruct-onnx microsoft/Phi-4-mini-instruct-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-mini-instruct-onnx.json --dir ./Phi-4-mini-instruct-onnx $ python3 fw.py verify ./Phi-4-mini-instruct-onnx ./microsoft__Phi-4-mini-instruct-onnx.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-4-mini-instruct-onnx --revision fc04c8f93df696602fd9f300a30d1bf2e3081347 --local-dir ./Phi-4-mini-instruct-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
fa8235e5b48faca34e3ca98cf4f694ef08bd216d28b58071a1f85b1d50cb814d
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-mini-instruct-onnxDate: 2026-11-15Commit: fc04c8fSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/Phi-4-mini-instruct-onnx
Pinned commit
fc04c8f93df696602fd9f300a30d1bf2e3081347
Manifest
Phi-4-mini-instruct-onnx.json · .minisig
Manifest sha256
494297e8ecfcd9fdda107854675f1a714f3aaa5c2cf7553c4c8e0cddce130c4d
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:45 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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