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

phi-4-gguf

Date: 2026-11-15Commit: 6edc2efSigned: 2DC28CC7B26A283B ✓

Text generation model. Gguf weights, 211 GB in all. Published by microsoft under MIT.

phi211GBphi-4-ggufggufpermissive
FactsParamsnot statedSize211 GBFormatsggufTasktext generationLicenseMITFrom sourcepermissive
$ fw get microsoft/phi-4-gguf
# manifest sha256 eeb83fbc6fbe… · 211 GB · 29 files
$ fw verify ./phi-4-gguf microsoft/phi-4-gguf
From sourceHosted (signed)microsoft/phi-4-ggufLast check: 2026-11-15 02:41 UTC

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

Works with

Convert with

Overview

Size
211 GB
Weights
3.59 GB (smallest of 23 GGUF variants)
Parameters
not stated
Formats
gguf
Task
text generation
License
MIT (permissive)
Files
29, 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 02:41 UTCpassed

Model card

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

Phi-4 Model Card#

Model Summary#

DevelopersMicrosoft Research
Descriptionphi-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.

phi-4 underwent a rigorous enhancement and alignment process, incorporating both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures |

| Architecture | 14B parameters, dense decoder-only Transformer model |

| Inputs | Text, best suited for prompts in the chat format |

| Context length | 16K tokens |

| GPUs | 1920 H100-80G |

| Training time | 21 days |

| Training data | 9.8T tokens |

| Outputs | Generated text in response to input |

| Dates | October 2024 – November 2024 |

| Status | Static model trained on an offline dataset with cutoff dates of June 2024 and earlier for publicly available data |

| Release date | December 12, 2024 |

| License | MIT |

Intended Use#

Primary Use CasesOur model is designed to accelerate research on language models, for use as a building block for generative AI powered features. It provides uses for general purpose AI systems and applications (primarily in English) which require:
  1. Memory/compute constrained environments.
  2. Latency bound scenarios.
  3. Reasoning and logic. |

| Out-of-Scope Use Cases | Our models is not specifically designed or evaluated for all downstream purposes, thus:

  1. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fairness before using within a specific downstream use case, particularly for high-risk scenarios.
  2. Developers should be aware of and adhere to applicable laws or regulations (including privacy, trade compliance laws, etc.) that are relevant to their use case, including the model’s focus on English.
  3. Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under. |

Data Overview#

Training Datasets#

Our training data is an extension of the data used for Phi-3 and includes a wide variety of sources from:

  1. Publicly available documents filtered rigorously for quality, selected high-quality educational data, and code.
  2. Newly created synthetic, “textbook-like” data for the purpose of teaching math, coding, common sense reasoning, general knowledge of the world (science, daily activities, theory of mind, etc.).
  3. Acquired academic books and Q&A datasets.
  4. High quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.

Multilingual data constitutes about 8% of our overall data. We are focusing on the quality of data that could potentially improve the reasoning ability for the model, and we filter the publicly available documents to contain the correct level of knowledge.

Benchmark datasets#

We evaluated phi-4 using OpenAI’s SimpleEval and our own internal benchmarks to understand the model’s capabilities, more specifically:

  • MMLU: Popular aggregated dataset for multitask language understanding.
  • MATH: Challenging competition math problems.
  • GPQA: Complex, graduate-level science questions.
  • DROP: Complex comprehension and reasoning.
  • MGSM: Multi-lingual grade-school math.
  • HumanEval: Functional code generation.
  • SimpleQA: Factual responses.

Safety#

Approach#

phi-4 has adopted a robust safety post-training approach. This approach leverages a variety of both open-source and in-house generated synthetic datasets. The overall technique employed to do the safety alignment is a combination of SFT (Supervised Fine-Tuning) and iterative DPO (Direct Preference Optimization), including publicly available datasets focusing on helpfulness and harmlessness as well as various questions and answers targeted to multiple safety categories.

Safety Evaluation and Red-Teaming#

Prior to release, phi-4 followed a multi-faceted evaluation approach. Quantitative evaluation was conducted with multiple open-source safety benchmarks and in-house tools utilizing adversarial conversation simulation. For qualitative safety evaluation, we collaborated with the independent AI Red Team (AIRT) at Microsoft to assess safety risks posed by phi-4 in both average and adversarial user scenarios. In the average user scenario, AIRT emulated typical single-turn and multi-turn interactions to identify potentially risky behaviors. The adversarial user scenario tested a wide range of techniques aimed at intentionally subverting the model’s safety training including jailbreaks, encoding-based attacks, multi-turn attacks, and adversarial suffix attacks.

Please refer to the technical report for more details on safety alignment.

Model Quality#

To understand the capabilities, we compare phi-4 with a set of models over OpenAI’s SimpleEval benchmark.

At the high-level overview of the model quality on representative benchmarks. For the table below, higher numbers indicate better performance:

CategoryBenchmarkphi-4 (14B)phi-3 (14B)Qwen 2.5 (14B instruct)GPT-4o-miniLlama-3.3 (70B instruct)Qwen 2.5 (72B instruct)GPT-4o
Popular Aggregated BenchmarkMMLU84.877.979.981.886.385.388.1
ScienceGPQA56.131.242.940.949.149.050.6
MathMGSM

MATH | 80.6 80.4 | 53.5 44.6 | 79.6 75.6 | 86.5 73.0 | 89.1 66.3* | 87.3 80.0 | 90.4 74.6 |

| Code Generation | HumanEval | 82.6 | 67.8 | 72.1 | 86.2 | 78.9* | 80.4 | 90.6 |

| Factual Knowledge | SimpleQA | 3.0 | 7.6 | 5.4 | 9.9 | 20.9 | 10.2 | 39.4 |

| Reasoning | DROP | 75.5 | 68.3 | 85.5 | 79.3 | 90.2 | 76.7 | 80.9 |

\* These scores are lower than those reported by Meta, perhaps because simple-evals has a strict formatting requirement that Llama models have particular trouble following. We use the simple-evals framework because it is reproducible, but Meta reports 77 for MATH and 88 for HumanEval on Llama-3.3-70B.

Usage#

Input Formats#

Given the nature of the training data, phi-4 is best suited for prompts using the chat format as follows:

<|im_start|>system<|im_sep|>
You are a medieval knight and must provide explanations to modern people.<|im_end|>
<|im_start|>user<|im_sep|>
How should I explain the Internet?<|im_end|>
<|im_start|>assistant<|im_sep|>
With llama.cpp#

Install llama.cpp according to their documentation and use the following code snippet to interact with phi-4 (4-bit quantized):

~/llama.cpp/build/bin/llama-cli -m phi-4-q4.gguf -cnv -c 16384 -p "You are a medieval knight and must provide explanations to modern people."

Responsible AI Considerations#

Like other language models, phi-4 can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:

  • Quality of Service: The model is trained primarily on English text. Languages other than English will experience worse performance. English language varieties with less representation in the training data might experience worse performance than standard American English. phi-4 is not intended to support multilingual use.
  • Representation of Harms & Perpetuation of Stereotypes: These models can over- or under-represent groups of people, erase representation of some groups, or reinforce demeaning or negative stereotypes. Despite safety post-training, these limitations may still be present due to differing levels of representation of different groups or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
  • Inappropriate or Offensive Content: These models may produce other types of inappropriate or offensive content, which may make it inappropriate to deploy for sensitive contexts without additional mitigations that are specific to the use case.
  • Information Reliability: Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
  • Limited Scope for Code: Majority of phi-4 training data is based in Python and uses common packages such as typing, math, random, collections, datetime, itertools. If the model generates Python scripts that utilize other packages or scripts in other languages, we strongly recommend users manually verify all API uses.

Developers should apply responsible AI best practices and are responsible for ensuring that a specific use case complies with relevant laws and regulations (e.g. privacy, trade, etc.). Using safety services like Azure AI Content Safety that have advanced guardrails is highly recommended. Important areas for consideration include:

  • Allocation: Models may not be suitable for scenarios that could have consequential impact on legal status or the allocation of resources or life opportunities (ex: housing, employment, credit, etc.) without further assessments and additional debiasing techniques.
  • High-Risk Scenarios: Developers should assess suitability of using models in high-risk scenarios where unfair, unreliable or offensive outputs might be extremely costly or lead to harm. This includes providing advice in sensitive or expert domains where accuracy and reliability are critical (ex: legal or health advice). Additional safeguards should be implemented at the application level according to the deployment context.
  • Misinformation: Models may produce inaccurate information. Developers should follow transparency best practices and inform end-users they are interacting with an AI system. At the application level, developers can build feedback mechanisms and pipelines to ground responses in use-case specific, contextual information, a technique known as Retrieval Augmented Generation (RAG).
  • Generation of Harmful Content: Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
  • Misuse: Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.
  • Data Summary: https://huggingface.co/microsoft/phi-4-gguf/blob/main/data_summary_card.md

Files

29 files · 211 GBWeights 3.59 GB (smallest of 23 GGUF variants). Sizes and sha256 from the signed manifest.
Show all 29 files with their sha256
FileSizesha256
.gitattributes1.56 KB2e8fee90afb8d255a457aa4d8ef05aa5315f32f233cd8024b5d46c463da4b6fe
CODE_OF_CONDUCT.md453 B539b1bfc810aa62738af95866bfe584d568b0dca71aebed0bd81db0bdaebade3
LICENSE1.10 KBc49419617a6070bcb197cfe272f7007fdec3e790dbb529cb995473bd69c0bd51
README.md13.6 KB56303278e2a944743135ab5a84f3c0ab355bbbbfa184802bec4a425729054634
SECURITY.md2.70 KB891c6326bdd8ea026af23af20fd7dd7167b666f4bd4f63cf22dfdef09d5e78b2
data_summary_card.md4.78 KBdfa269c811da425d5b3b7c093e4790b64b53fe23af07ef6c796b184f6957797b
phi-4-IQ3_M.gguf6.91 GBc9298fa6c9e927b257845a8057c74f2f4bd6bb7fbce35a0db933debdd777ae9a
phi-4-IQ3_S.gguf6.50 GB3f165ed951be668c9297e0721dc8a8fdab4916a8da7a6b83a3b47a2a174a9c0e
phi-4-IQ3_XS.gguf6.25 GB2bd63e342a7d5801f45cab2fb15522812e9c1f4731f92b5a349474743876121c
phi-4-IQ3_XXS.gguf6.08 GBb65f01aab058dc26f8f1d0a4fe84b68df58d29ea2f21c87972620a9869e57bc5
phi-4-IQ4_NL.gguf8.44 GB53aa11369a090f667dabf6b5877baa9f9947071bf7e7244a737b2d7b1d5c0379
phi-4-IQ4_XS.gguf8.01 GBf5c151b6e5ea5e5bfd699b40e4c6797d08a4c6c0136cad201fb03e1d3e6e5511
phi-4-Q2_K.gguf5.55 GB7ff048b61e9d6fc49bdd11affdb5e0d3365c08e55eb17ffd0f159f6e0de6f53e
phi-4-Q3_K.gguf7.36 GB570a44b43fd7bd87637586ac8d7fc47f5a2fde0376d4f58c22854960c43eb365
phi-4-Q3_K_L.gguf7.93 GB8fe8deaa431f877d7c9c3caf49f0e149c396b526c50558991ad87040cd43111e
phi-4-Q3_K_S.gguf6.50 GBdf1d679cf9c8f73471b661168310f736886a3dad01eb4be04a127b899f65a745
phi-4-Q4_0.gguf8.38 GB367a3576b66530fac1cee6c3f47b52e7bbfb003de6cc18e2e2c9a2cc2ad89fe6
phi-4-Q4_1.gguf9.27 GB312aeab892aa958c06188775125a011164990e9c07acef75c6bd5208bd9bbaaf
phi-4-Q4_K.gguf9.05 GB5652b9be0ea4ae2842130d04fe31bc869fcb99a2b7106c53b4e754a343fd688f
phi-4-Q4_K_S.gguf8.44 GB8a8189132ef70cd737e136d38b706e8cb832f9cdf3c744547694769e9313550e
phi-4-Q5_0.gguf10.2 GBb935eaeceeb165ac8c4786a6da44bcb713a8a253abccf01658bfb64acd4b8815
phi-4-Q5_1.gguf11.0 GB1bc2d63bd2fa376f510850365e6826247d211270fbbbde08629a4c52c0c7aad4
phi-4-Q5_K.gguf10.6 GB1cf76820e5b9b7ae11dafe82e0769e5564754616384c08fc3d1372eb06683aec
phi-4-Q5_K_S.gguf10.2 GB83bb97146ecfd800ad948da1578e01c40d5704011d6deebb15db6069327d24a5
phi-4-Q6_K.gguf12.0 GBa70147a8a8adb24d62a28e5038aca78c4c145a1c3043a38e8634738a9e6bbd93
phi-4-Q8_0.gguf15.6 GBf68df5d3a22a01ea9ec547741f42ee7fedbf949bf42ef526fb1944fa0cfaa110
phi-4-TQ1_0.gguf3.59 GBae08aeb1cb5da565300176b90c047d27d89dfe7d5f87a359ff95565c04a14102
phi-4-TQ2_0.gguf4.23 GBc3ed993354f92e1bd4bd1c64e879bb14c085811c817ca1aa9ffac4cc7f6fa665
phi-4-bf16.gguf29.3 GBc0cdb8adae6864ae0b29cbd38dad2ea5952fee36321924d694a29e7f2eea0650
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
6edc2ef666 pinned now2026-11-15 02:41 UTC29 files · 211 GB

Use it

$ fw get microsoft/phi-4-gguf
# manifest sha256 eeb83fbc6fbe… · 211 GB · 29 files
$ fw verify ./phi-4-gguf microsoft/phi-4-gguf
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-gguf.json --dir ./phi-4-gguf $ python3 fw.py verify ./phi-4-gguf ./microsoft__phi-4-gguf.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/phi-4-gguf --revision 6edc2ef6664b739a8e11e62f2672ff6afe0c15ac --local-dir ./phi-4-gguf
llama.cppDownload one GGUF variant (phi-4-TQ1_0, 3.59 GB), then serve it.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/phi-4-gguf --include "phi-4-TQ1_0*" --local-dir ./phi-4-gguf $ llama-server -m ./phi-4-gguf/phi-4-TQ1_0.gguf
OllamaMake an Ollama model from the downloaded file.
$ printf 'FROM ./phi-4-gguf/phi-4-TQ1_0.gguf\n' > Modelfile $ ollama create phi-4-gguf -f Modelfile

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-ggufDate: 2026-11-15Commit: 6edc2efSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/phi-4-gguf
Pinned commit
6edc2ef6664b739a8e11e62f2672ff6afe0c15ac
Manifest
phi-4-gguf.json · .minisig
Manifest sha256
eeb83fbc6fbed5004cc84d7e3189f7d09de872cd3de3200a014b657298fbebe9
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:41 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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