Downloads · 30 days
268
23% of all-time downloads
microsoft/Phi-4-reasoning-plus-onnx
Phi-4-reasoning-plus-onnx is a machine learning model from microsoft. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This repository hosts the optimized versions of the Phi-4 reasoning plus models to accelerate inference with ONNX Runtime.
Downloads · 30 days
268
23% of all-time downloads
All-time downloads
1.2K
Public
Repo size
27.9 GB
Likes
7
Trending 2
Click a slice to open those files.
.data19.9 GB · 71%
From the Hugging Face model README
This repository hosts the optimized versions of the Phi-4 reasoning plus 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:
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-reasoning-plus-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-reasoning-plus-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-reasoning-plus-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
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.
Phi-4 reasoning plus 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-reasoning-plus/blob/main/README.md.