alt.freeweights.phi / Phi-3-medium-4k-instruct-onnx-cuda
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.phiSubject:

Phi-3-medium-4k-instruct-onnx-cuda

Date: 2026-11-15Commit: 5152243Signed: 2DC28CC7B26A283B ✓

Text generation model. Onnx weights, 36.0 GB in all. Published by microsoft under MIT.

phi36.0GBPhi-3-medium-4k-instruct-onnx-cudaonnxpermissive
FactsParamsnot statedSize36.0 GBFormatsonnxTasktext generationLicenseMITFrom sourcepermissive
$ fw get microsoft/Phi-3-medium-4k-instruct-onnx-cuda
# manifest sha256 72f260479ebd… · 36.0 GB · 25 files
$ fw verify ./Phi-3-medium-4k-instruct-onnx-cuda microsoft/Phi-3-medium-4k-instruct-onnx-cuda
From sourceHosted (signed)microsoft/Phi-3-medium-4k-instruct-onnx-cudaLast check: 2026-11-15 03:52 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

Overview

Size
36.0 GB
Weights
252 KB (smallest of 2 ONNX variants)
Parameters
not stated
Formats
onnx
Task
text generation
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:52 UTCpassed

Model card

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

Phi-3 Medium-4K-Instruct ONNX CUDA models#

This repository hosts the optimized versions of Phi-3-medium-4k-instruct to accelerate inference with ONNX Runtime for your machines with NVIDIA GPUs.

Phi-3 Medium is a 14B parameter, lightweight, state-of-the-art open model trained with the Phi-3 datasets, which include both synthetic data and the filtered publicly available websites data, with a focus on high-quality and reasoning dense properties. The model belongs to the Phi-3 family with the medium version in two variants: 4K and 128K, which are the context lengths (in tokens) that they can support.

The base model has undergone a post-training process that incorporates both supervised fine-tuning and direct preference optimization for the instruction following and safety measures. When assessed against benchmarks testing common sense, language understanding, math, code, long context, and logical reasoning, Phi-3-Medium-4K-Instruct showcased a robust and state-of-the-art performance among models of the same-size and next-size-up.

Optimized variants of the Phi-3 Medium models are published here in ONNX format and run with ONNX Runtime on CPU and GPU across devices, including server platforms, Windows, and Linux, with the precision best suited to each of these targets.

ONNX Models#

Here are some of the optimized configurations we have added:

  1. ONNX model for FP16 CUDA: ONNX model for NVIDIA GPUs.
  2. ONNX model for INT4 CUDA: ONNX model for NVIDIA GPUs using int4 quantization via RTN.

How do you know which is the best ONNX model for you:

  • Are you on a Windows machine with GPU?

Note: Using the Hugging Face CLI, you can download sub folders and not all models if you are limited on disk space. The FP16 model is recommended for larger batch sizes, while the INT4 model optimizes performance for lower batch sizes.

Example:

# Download just the FP16 model
$ huggingface-cli download microsoft/Phi-3-small-8k-instruct-onnx-cuda --include cuda-fp16/* --local-dir .  --local-dir-use-symlinks False

How to Get Started with the Model#

To support the Phi-3 models across a range of devices, platforms, and EP backends, we introduce a new API to wrap several aspects of generative AI inferencing. This API makes it easy to drag and drop LLMs straight into your app. To run the early version of these models with ONNX, follow the steps here.

Hardware Supported#

The models are tested on:

  • 1 A100 GPU, SKU: Standard_ND96amsr_A100_v4 (CUDA)

Minimum Configuration Required:

Model Description#
  • Developed by: Microsoft
  • Model type: ONNX
  • Language(s) (NLP): Python, C, C++
  • License: MIT
  • Model Description: This is a conversion of the Phi-3 Medium-4K-Instruct model for ONNX Runtime inference.

Additional Details#

Performance Metrics#

CUDA#

Phi-3 Medium-4K-Instruct performs better with ONNX Runtime compared to PyTorch for all batch size, prompt length combinations. For FP16 CUDA, ORT performs up to 5X faster than PyTorch, while with INT4 CUDA, it's up to 10X faster than PyTorch. It is also up to 3X faster than llama.cpp for large batch sizes.

The table below shows the average throughput of the first 256 tokens generated (tps) for FP16 and INT4 precisions on CUDA as measured on 1 A100 80GB GPU, SKU: Standard_ND96amsr_A100_v4.

Batch Size, Prompt LengthORT FP16 CUDAPyTorch Eager FP16 CUDASpeed Up ORT/PyTorch
1, 1647.3214.413.28
4, 16190.0584.432.25
16, 16707.68347.522.04
16, 64698.22342.832.04
Batch Size, Prompt LengthORT INT4 CUDAPyTorch Eager INT4 CUDASpeed Up ORT/PyTorch
1, 16115.6814.897.77
4, 1688.5345.221.96
16, 16341.8168.362.03
Package Versions#
Pip package nameVersion
torch2.3.0
triton2.3.0
onnxruntime-gpu1.18.0
transformers4.40.2
bitsandbytes0.43.1

Appendix#

Model Card Contact#

parinitarahi, kvaishnavi, natke

Contributors#

Kunal Vaishnavi, Sunghoon Choi, Yufeng Li, Sheetal Arun Kadam, Rui Ren, Natalie Kershaw, Parinita Rahi

Files

25 files · 36.0 GBWeights 252 KB (smallest of 2 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 25 files with their sha256
FileSizesha256
.gitattributes1.57 KB1403a1a07764f40b81196144fc294c8daff49cbc0f1d0a79fcfbf5e35a027311
LICENSE12.5 KBc6186c688d3a12fdad30e4fe4962de3af2897bd47944702962f8cac94a646f94
README.md6.42 KB2ecdd24f9d565df1f83da293601401b4f7e01cd1295117d84b48899709503c7f
config.json907 B20b1f98cd3d2ea41cff1848c2484c8ca444528922f7c43aa0e23569231dab5ab
configuration_phi3.py10.4 KB18b06d379f5199bfb8b7da26da14c580f3852e792895d2bf6158b2ef33c92d52
cuda-fp16/added_tokens.json293 B5f5c94d30901fe9c961d776d51eadbda4454991a77b53d36e0be0571a8e72a7d
cuda-fp16/config.json907 B20b1f98cd3d2ea41cff1848c2484c8ca444528922f7c43aa0e23569231dab5ab
cuda-fp16/configuration_phi3.py10.4 KB18b06d379f5199bfb8b7da26da14c580f3852e792895d2bf6158b2ef33c92d52
cuda-fp16/genai_config.json1.73 KB9967ff313953242918ced3688a0e3d3d1a8d567d583d00470a1b5259fee6ade9
cuda-fp16/phi3-medium-4k-instruct-cuda-fp16.onnx252 KB75790ad9b978c82fa1df50a5d54bcce247057ffd3bd881d39dd7431e41c81fd4
cuda-fp16/phi3-medium-4k-instruct-cuda-fp16.onnx.data27.9 GB6b49db114b14daaf02f0f8e0db83ef02e7b9db4dd7b8e16112da700aa9e8c205
cuda-fp16/special_tokens_map.json569 B474d699677e264edd3851559548cbbb61801ad8da6b249c81455007602313c34
cuda-fp16/tokenizer.json1.84 MB9e2ae3d66819f163cdcfedba5078f3a3af8118c2712491ed60912f77886bda6f
cuda-fp16/tokenizer.model500 KB9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
cuda-fp16/tokenizer_config.json3.15 KB7a176e2c0b8aa486b71a86d94bfd2a298ead18728becf25e5b69f436f2b98bd5
cuda-int4-rtn-block-32/added_tokens.json293 B5f5c94d30901fe9c961d776d51eadbda4454991a77b53d36e0be0571a8e72a7d
cuda-int4-rtn-block-32/config.json907 B20b1f98cd3d2ea41cff1848c2484c8ca444528922f7c43aa0e23569231dab5ab
cuda-int4-rtn-block-32/configuration_phi3.py10.4 KB18b06d379f5199bfb8b7da26da14c580f3852e792895d2bf6158b2ef33c92d52
cuda-int4-rtn-block-32/genai_config.json1.74 KBaefafcbf3d9fc429c277d61322c22fdf562acb3ebe6fc5b6b915c77adcd9de4e
cuda-int4-rtn-block-32/phi3-medium-4k-instruct-cuda-int4-rtn-block-32.onnx343 KB3669644852a7cd6b143d830ce4e47fa26c2960c971674a185b5ede7f57889a69
cuda-int4-rtn-block-32/phi3-medium-4k-instruct-cuda-int4-rtn-block-32.onnx.data8.09 GB66b8e074fa9af03c7468b84cb1a0ebf6d280ffcf191bddbd002e9211cafd7753
cuda-int4-rtn-block-32/special_tokens_map.json569 B474d699677e264edd3851559548cbbb61801ad8da6b249c81455007602313c34
cuda-int4-rtn-block-32/tokenizer.json1.84 MB9e2ae3d66819f163cdcfedba5078f3a3af8118c2712491ed60912f77886bda6f
cuda-int4-rtn-block-32/tokenizer.model500 KB9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
cuda-int4-rtn-block-32/tokenizer_config.json3.15 KB7a176e2c0b8aa486b71a86d94bfd2a298ead18728becf25e5b69f436f2b98bd5
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
5152243c86 pinned now2026-11-15 03:52 UTC25 files · 36.0 GB

Use it

$ fw get microsoft/Phi-3-medium-4k-instruct-onnx-cuda
# manifest sha256 72f260479ebd… · 36.0 GB · 25 files
$ fw verify ./Phi-3-medium-4k-instruct-onnx-cuda microsoft/Phi-3-medium-4k-instruct-onnx-cuda
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-medium-4k-instruct-onnx-cuda.json --dir ./Phi-3-medium-4k-instruct-onnx-cuda $ python3 fw.py verify ./Phi-3-medium-4k-instruct-onnx-cuda ./microsoft__Phi-3-medium-4k-instruct-onnx-cuda.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-3-medium-4k-instruct-onnx-cuda --revision 5152243c860cf661df49b9b64b6c90db635cc7a9 --local-dir ./Phi-3-medium-4k-instruct-onnx-cuda

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
c6186c688d3a12fdad30e4fe4962de3af2897bd47944702962f8cac94a646f94
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-medium-4k-instruct-onnx-cudaDate: 2026-11-15Commit: 5152243Signed: 2DC28CC7B26A283B ✓
Upstream
microsoft/Phi-3-medium-4k-instruct-onnx-cuda
Pinned commit
5152243c860cf661df49b9b64b6c90db635cc7a9
Manifest
Phi-3-medium-4k-instruct-onnx-cuda.json · .minisig
Manifest sha256
72f260479ebde19231d43558927051129665d655470d9cc4c38bb024e67407c3
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 03:52 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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