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

Phi-3-mini-4k-instruct-gguf

Date: 2026-11-14Commit: a641133Signed: 2DC28CC7B26A283B ✓

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

phi10.0GBPhi-3-mini-4k-instruct-ggufggufpermissive
FactsParamsnot statedSize10.0 GBFormatsggufTasktext generationLicenseMITFrom sourcepermissive
$ fw get microsoft/Phi-3-mini-4k-instruct-gguf
# manifest sha256 1d1289e12638… · 10.0 GB · 11 files
$ fw verify ./Phi-3-mini-4k-instruct-gguf microsoft/Phi-3-mini-4k-instruct-gguf
From sourceHosted (signed)microsoft/Phi-3-mini-4k-instruct-ggufLast check: 2026-11-14 21:17 UTC

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

Works with

Convert with

Overview

Size
10.0 GB
Weights
2.39 GB (smallest of 2 GGUF variants)
Parameters
not stated
Formats
gguf
Task
text generation
License
MIT (permissive)
Files
11, each with a sha256
Publisher
microsoft
Added
2026-11-14
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-14 21:17 UTCpassed

Model card

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

Model Summary#

This repo provides the GGUF format for the Phi-3-Mini-4K-Instruct. The Phi-3-Mini-4K-Instruct is a 3.8B parameters, lightweight, state-of-the-art open model trained with the Phi-3 datasets that includes 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 Mini version in two variants 4K and 128K which is the context length (in tokens) it can support. The model has underwent a post-training process that incorporates both supervised fine-tuning and direct preference optimization to ensure precise instruction adherence and robust safety measures. When assessed against benchmarks testing common sense, language understanding, math, code, long context and logical reasoning, Phi-3 Mini-4K-Instruct showcased a robust and state-of-the-art performance among models with less than 13 billion parameters.

Resources and Technical Documentation:

This repo provides GGUF files for the Phi-3 Mini-4K-Instruct model.

NameQuant methodBitsSizeUse case
Phi-3-mini-4k-instruct-q4.ggufQ4_K_M42.2 GBmedium, balanced quality - recommended
Phi-3-mini-4k-instruct-fp16.ggufNone167.2 GBminimal quality loss

Intended Uses#

Primary use cases

The model is intended for commercial and research use in English. The model provides uses for applications which require

  1. memory/compute constrained environments
  2. latency bound scenarios
  3. strong reasoning (especially math and logic)
  4. long context

Our model is designed to accelerate research on language and multimodal models, for use as a building block for generative AI powered features.

Use case considerations

Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fariness before using within a specific downstream use case, particularly for high risk scenarios. 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. Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under.

Chat Format:#

Given the nature of the training data, the Phi-3-Mini-4K-instruct model is best suited for prompts using the chat format as follows. You can provide the prompt as a question with a generic template as follow:

<|user|>\nQuestion <|end|>\n<|assistant|>

For example:

<|user|>
How to explain Internet for a medieval knight?<|end|>
<|assistant|>

where the model generates the text after "<|assistant|>" . In case of few-shots prompt, the prompt can be formatted as the following:

<|user|>
I am going to Paris, what should I see?<|end|>
<|assistant|>
Paris, the capital of France, is known for its stunning architecture, art museums, historical landmarks, and romantic atmosphere. Here are some of the top attractions to see in Paris:\n\n1. The Eiffel Tower: The iconic Eiffel Tower is one of the most recognizable landmarks in the world and offers breathtaking views of the city.\n2. The Louvre Museum: The Louvre is one of the world's largest and most famous museums, housing an impressive collection of art and artifacts, including the Mona Lisa.\n3. Notre-Dame Cathedral: This beautiful cathedral is one of the most famous landmarks in Paris and is known for its Gothic architecture and stunning stained glass windows.\n\nThese are just a few of the many attractions that Paris has to offer. With so much to see and do, it's no wonder that Paris is one of the most popular tourist destinations in the world."<|end|>
<|user|>
What is so great about #1?<|end|>
<|assistant|>

How to download GGUF files#

  1. Install Hugging Face CLI:
pip install huggingface-hub>=0.17.1
  1. Login to Hugging Face:
huggingface-cli login
  1. Download the GGUF model:
huggingface-cli download microsoft/Phi-3-mini-4k-instruct-gguf Phi-3-mini-4k-instruct-q4.gguf --local-dir . --local-dir-use-symlinks False

How to use with Ollama#

  1. Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
  1. **Run the phi3 model:**
ollama run phi3
Building from Modelfile#

Assuming that you have already downloaded GGUF files, here is how you can use them with Ollama:

  1. Get the Modelfile:
huggingface-cli download microsoft/Phi-3-mini-4k-instruct-gguf Modelfile_q4 --local-dir /path/to/your/local/dir
  1. Build the Ollama Model:

Use the Ollama CLI to create your model with the following command:

ollama create phi3 -f Modelfile_q4
  1. **Run the phi3 model:**

Now you can run the Phi-3-Mini-4k-Instruct model with Ollama using the following command:

ollama run phi3 "Your prompt here"

Replace "Your prompt here" with the actual prompt you want to use for generating responses from the model.

How to use with Llamafile:#

Assuming that you already have GGUF files downloaded. Here is how you can use the GGUF model with Llamafile:

  1. Download Llamafile-0.7.3
wget https://github.com/Mozilla-Ocho/llamafile/releases/download/0.7.3/llamafile-0.7.3
  1. Run the model with chat format prompt:
<|user|>\nHow to explain Internet for a medieval knight?\n<|end|>\n<|assistant|>
./llamafile-0.7.3 -ngl 9999 -m Phi-3-mini-4k-instruct-q4.gguf --temp 0.6 -p "<|user|>\nHow to explain Internet for a medieval knight?\n<|end|>\n<|assistant|>"
  1. Run with a chat interface:
./llamafile-0.7.3 -ngl 9999 -m Phi-3-mini-4k-instruct-q4.gguf

Your browser should open automatically and display a chat interface. (If it doesn't, just open your browser and point it at http://localhost:8080)

How to run on Python:#

  1. Install llama-cpp-python:
! CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
  1. Run the model:
from llama_cpp import Llama


llm = Llama(
  model_path="./Phi-3-mini-4k-instruct-q4.gguf",  # path to GGUF file
  n_ctx=4096,  # The max sequence length to use - note that longer sequence lengths require much more resources
  n_threads=8, # The number of CPU threads to use, tailor to your system and the resulting performance
  n_gpu_layers=35, # The number of layers to offload to GPU, if you have GPU acceleration available. Set to 0 if no GPU acceleration is available on your system.
)

prompt = "How to explain Internet to a medieval knight?"

# Simple inference example
output = llm(
  f"<|user|>\n{prompt}<|end|>\n<|assistant|>",
  max_tokens=256,  # Generate up to 256 tokens
  stop=["<|end|>"], 
  echo=True,  # Whether to echo the prompt
)

print(output['choices'][0]['text'])

Responsible AI Considerations#

Like other language models, the Phi series models 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 Phi models are 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.
  • 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-3 training data is based in Python and use 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.). 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.

Training#

Model#
  • Architecture: Phi-3 Mini has 3.8B parameters and is a dense decoder-only Transformer model. The model is fine-tuned with Supervised fine-tuning (SFT) and Direct Preference Optimization (DPO) to ensure alignment with human preferences and safety guidlines.
  • Inputs: Text. It is best suited for prompts using chat format.
  • Context length: 4K tokens
  • GPUS: 512 H100-80G
  • Training time: 7 days
  • Training data: 3.3T tokens
  • Outputs: Generated text in response to the input
  • Dates: Our models were trained between February and April 2024
  • Status: This is a static model trained on an offline dataset with cutoff date October 2023. Future versions of the tuned models may be released as we improve models.
Datasets#

Our training data includes a wide variety of sources, totaling 3.3 trillion tokens, and is a combination of

  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. high quality chat format supervised data covering various topics to reflect human preferences on different aspects such as instruct-following, truthfulness, honesty and helpfulness.
Software#
License#

The model is licensed under the MIT license.

Trademarks#

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

Data Summary#

https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/blob/main/data_summary_card.md

Files

11 files · 10.0 GBWeights 2.39 GB (smallest of 2 GGUF variants). Sizes and sha256 from the signed manifest.
Hide all 11 files with their sha256
FileSizesha256
.gitattributes1.66 KB1124f28dcbe6b5550a1d151d064c6bdcf354ba0cd41d45146534e0a425d35cc5
CODE_OF_CONDUCT.md444 B9daeae709a0bd71bcfd1c96dc5822ecec5210327eff929da64b0ae7f8faf1444
LICENSE1.08 KBfa8235e5b48faca34e3ca98cf4f694ef08bd216d28b58071a1f85b1d50cb814d
Modelfile_fp16253 Bb375cf6f3354674ab0c601c5de3b864a8fff01f37eb8c16b5d75880df6d0c456
Modelfile_q4251 B3f5350433024ff0bde181ce3c82ed5d9985550fb3245bc4d0f30c4f187cfcbb1
NOTICE.md1.77 KB6ac541192c253d21cd16a597ce69c515868e031db3f32f75d996b993b5aca216
Phi-3-mini-4k-instruct-fp16.gguf7.64 GB5d99003e395775659b0dde3f941d88ff378b2837a8dc3a2ea94222ab1420fad3
Phi-3-mini-4k-instruct-q4.gguf2.39 GB8a83c7fb9049a9b2e92266fa7ad04933bb53aa1e85136b7b30f1b8000ff2edef
README.md13.6 KBed4125f0206ab1f622f6b95c6a02a1db1bda7ffa6721dbc9804c2f2b6cce742d
SECURITY.md2.66 KB7b6976eec43edfa68b79a459dd089c56b7a395916dbf1a01bd11e6d86e12128f
data_summary_card.md4.62 KB7d7a019ce5fe4953e2ea99dc094b4eda9c2e07ce3fb10e82b0a57aa4bce2e348
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
a64113399c pinned now manifest updated, same commit2026-11-14 21:17 UTC11 files · 10.0 GB
a64113399c2026-11-14 21:17 UTC11 files · 10.0 GB

Use it

$ fw get microsoft/Phi-3-mini-4k-instruct-gguf
# manifest sha256 1d1289e12638… · 10.0 GB · 11 files
$ fw verify ./Phi-3-mini-4k-instruct-gguf microsoft/Phi-3-mini-4k-instruct-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-3-mini-4k-instruct-gguf.json --dir ./Phi-3-mini-4k-instruct-gguf $ python3 fw.py verify ./Phi-3-mini-4k-instruct-gguf ./microsoft__Phi-3-mini-4k-instruct-gguf.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-3-mini-4k-instruct-gguf --revision a64113399c2f6b8ad3e11c394733a2ddadaa7f33 --local-dir ./Phi-3-mini-4k-instruct-gguf
llama.cppDownload one GGUF variant (Phi-3-mini-4k-instruct-q4, 2.39 GB), then serve it.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Phi-3-mini-4k-instruct-gguf --include "Phi-3-mini-4k-instruct-q4*" --local-dir ./Phi-3-mini-4k-instruct-gguf $ llama-server -m ./Phi-3-mini-4k-instruct-gguf/Phi-3-mini-4k-instruct-q4.gguf
OllamaMake an Ollama model from the downloaded file.
$ printf 'FROM ./Phi-3-mini-4k-instruct-gguf/Phi-3-mini-4k-instruct-q4.gguf\n' > Modelfile $ ollama create phi-3-mini-4k-instruct-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-14
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-3-mini-4k-instruct-ggufDate: 2026-11-14Commit: a641133Signed: 2DC28CC7B26A283B ✓
Upstream
microsoft/Phi-3-mini-4k-instruct-gguf
Pinned commit
a64113399c2f6b8ad3e11c394733a2ddadaa7f33
Manifest
Phi-3-mini-4k-instruct-gguf.json · .minisig
Manifest sha256
1d1289e12638102c49867d911b22c9aaa846e4417c235793f33e07ef8ae85fe1
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:17 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

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