ONNX 模型库

microsoft/Phi-4-reasoning-plus-onnx

作者 microsoft | 下载 18 | 点赞 2 | 更新 2026-02-11

这个仓库里有什么

  • 6 个 ONNX 模型(.onnx 文件)
  • 45 个文件,其中 .json 21 个、.onnx 6 个、.bin 5 个、.py 3 个、.txt 3 个、.md 2 个
  • 最近更新:2026-02-11

ONNX 文件清单

文件 大小 下载
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx — 下载
gpu/gpu-int4-rtn-block-32/model.onnx — 下载
npu/qnn-int4/phi_4_14B_ctx.onnx_ctx.onnx — 下载
npu/qnn-int4/phi_4_14B_embeddings.all.quant.onnx — 下载
npu/qnn-int4/phi_4_14B_iter.onnx_ctx.onnx — 下载
npu/qnn-int4/phi_4_14B_lm_head.all.quant.onnx — 下载

怎么用

这些 ONNX 文件可以直接用 ONNX Runtime 加载运行;想先看网络结构,可以把文件上传到 Netron 在线查看器 查看。下载链接指向 Hugging Face 原始文件。

说明文档

Phi-4 Reasoning Plus ONNX models

Introduction

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:

  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-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

Model Description

  • Developed by: Microsoft
  • Model type: ONNX
  • License: MIT
  • Model Description: This is a conversion of the Phi-4 reasoning plus 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 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.

模型信息

onnx ONNX ONNX Runtime code nlp phi4 en license:mit region:us
↓ 18 ♥ 2

创建时间: 2025-05-02

更新时间: 2026-02-11

在 Hugging Face 上查看

文件 (45)

.gitattributes
LICENSE
README.md
config.json
configuration_phi3.py
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/config.json
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/configuration_phi3.py
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/genai_config.json
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/merges.txt
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx ONNX
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/model.onnx.data
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/special_tokens_map.json
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer.json
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/tokenizer_config.json
cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/vocab.json
gpu/gpu-int4-rtn-block-32/config.json
gpu/gpu-int4-rtn-block-32/configuration_phi3.py
gpu/gpu-int4-rtn-block-32/genai_config.json
gpu/gpu-int4-rtn-block-32/merges.txt
gpu/gpu-int4-rtn-block-32/model.onnx ONNX
gpu/gpu-int4-rtn-block-32/model.onnx.data
gpu/gpu-int4-rtn-block-32/special_tokens_map.json
gpu/gpu-int4-rtn-block-32/tokenizer.json
gpu/gpu-int4-rtn-block-32/tokenizer_config.json
gpu/gpu-int4-rtn-block-32/vocab.json
npu/qnn-int4/LICENSE
npu/qnn-int4/README.md
npu/qnn-int4/added_tokens.json
npu/qnn-int4/config.json
npu/qnn-int4/genai_config.json
npu/qnn-int4/inference_model.json
npu/qnn-int4/merges.txt
npu/qnn-int4/phi_4_14B_cb_1.bin
npu/qnn-int4/phi_4_14B_cb_2.bin
npu/qnn-int4/phi_4_14B_cb_3.bin
npu/qnn-int4/phi_4_14B_cb_4.bin
npu/qnn-int4/phi_4_14B_cb_5.bin
npu/qnn-int4/phi_4_14B_ctx.onnx_ctx.onnx ONNX
npu/qnn-int4/phi_4_14B_embeddings.all.quant.onnx ONNX
npu/qnn-int4/phi_4_14B_iter.onnx_ctx.onnx ONNX
npu/qnn-int4/phi_4_14B_lm_head.all.quant.onnx ONNX
npu/qnn-int4/special_tokens_map.json
npu/qnn-int4/tokenizer.json
npu/qnn-int4/tokenizer_config.json
npu/qnn-int4/vocab.json

相关模型