From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.phiSubject:

phi-1_5

Date: 2026-11-14Commit: 77aa61eSigned: 2DC28CC7B26A283B ✓

Text generation model with 1.4B parameters. Safetensors weights, 2.84 GB in all. Published by microsoft under MIT.

1.4B params2.84GBphi-1_5safetensorspermissive
FactsParams1.4BSize2.84 GBFormatssafetensorsTasktext generationLicenseMITFrom sourcepermissive
$ fw get microsoft/phi-1_5
# manifest sha256 0e3a85306198… · 2.84 GB · 16 files
$ fw verify ./phi-1_5 microsoft/phi-1_5
From sourceHosted (signed)microsoft/phi-1_5Last check: 2026-11-14 21:23 UTC

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

Works with

Overview

Size
2.84 GB
Weights
2.84 GB (safetensors)
Parameters
1.4B
Formats
safetensors
Task
text generation
License
MIT (permissive)
Files
16, 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:23 UTCpassed

Model card

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

Model Summary#

The language model Phi-1.5 is a Transformer with 1.3 billion parameters. It was trained using the same data sources as phi-1, augmented with a new data source that consists of various NLP synthetic texts. When assessed against benchmarks testing common sense, language understanding, and logical reasoning, Phi-1.5 demonstrates a nearly state-of-the-art performance among models with less than 10 billion parameters.

We did not fine-tune Phi-1.5 either for instruction following or through reinforcement learning from human feedback. The intention behind crafting this open-source model is to provide the research community with a non-restricted small model to explore vital safety challenges, such as reducing toxicity, understanding societal biases, enhancing controllability, and more.

For a safer model release, we exclude generic web-crawl data sources such as common-crawl from the training. This strategy prevents direct exposure to potentially harmful online content, enhancing the model's safety without RLHF. However, the model is still vulnerable to generating harmful content. We hope the model can help the research community to further study the safety of language models.

Phi-1.5 can write poems, draft emails, create stories, summarize texts, write Python code (such as downloading a Hugging Face transformer model), etc.

How to Use#

Phi-1.5 has been integrated in the transformers version 4.37.0, please ensure that you are using a version equal or higher than it.

Intended Uses#

Given the nature of the training data, Phi-1.5 is best suited for prompts using the QA format, the chat format, and the code format. Note that Phi-1.5, being a base model, often produces irrelevant text following the main answer. In the following example, we've truncated the answer for illustrative purposes only.

QA Format:#
Write a detailed analogy between mathematics and a lighthouse.

Answer: Mathematics is like a lighthouse, guiding us through the vast ocean of numbers and calculations. Just as a lighthouse illuminates the darkness, mathematics provides us with a clear path to navigate through complex problems. It helps us make sense of the world around us, just like a lighthouse helps ships find their way home.

where the model generates the text after "Answer:".

Chat Format:#
Alice: I don't know why, I'm struggling to maintain focus while studying. Any suggestions?

Bob: Have you tried using a timer? It can help you stay on track and avoid distractions.

Alice: That's a good idea. I'll give it a try.

Charlie: Another thing that can help is to break up your study sessions into smaller chunks. It's easier to concentrate on one thing at a time.

Alice: That makes sense. I'll try that too.

Bob: And don't forget to take breaks! It's important to give your brain a rest so you can come back to your studies with a fresh perspective.

Alice: Thanks for the advice, guys. I feel more motivated now.

Charlie: No problem, Alice. We're all in this together.

Bob: Yeah, and remember that it's okay to ask for help if you need it. We're here to support each other.

where the model generates the text after the first "Bob:".

Code Format:#
def print_prime(n):
   """
   Print all primes between 1 and n
   """
   primes = []
   for num in range(2, n+1):
       is_prime = True
       for i in range(2, int(math.sqrt(num))+1):
           if num % i == 0:
               is_prime = False
               break
       if is_prime:
           primes.append(num)
   print(primes)

where the model generates the text after the comments.

Notes:

  • Phi-1.5-generated text/code should be treated as a starting point rather than a definitive solution for potential use cases. Users should be cautious when employing these models in their applications.
  • Phi-1.5 has not been tested to ensure that it performs adequately for any production-level application. Please refer to the limitation sections of this document for more details.

Sample Code#

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

torch.set_default_device("cuda")

model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5")

inputs = tokenizer('''def print_prime(n):
   """
   Print all primes between 1 and n
   """''', return_tensors="pt", return_attention_mask=False)

outputs = model.generate(**inputs, max_length=200)
text = tokenizer.batch_decode(outputs)[0]
print(text)

Limitations of Phi-1.5#

  • Generate Inaccurate Code and Facts: The model often produces incorrect code snippets and statements. Users should treat these outputs as suggestions or starting points, not as definitive or accurate solutions.
  • Limited Scope for code: If the model generates Python scripts that utilize uncommon packages or scripts in other languages, we strongly recommend users manually verify all API uses.
  • Unreliable Responses to Instruction: The model has not undergone instruction fine-tuning. As a result, it may struggle or fail to adhere to intricate or nuanced instructions provided by users.
  • Language Limitations: The model is primarily designed to understand standard English. Informal English, slang, or any other language outside of English might pose challenges to its comprehension, leading to potential misinterpretations or errors in response.
  • Potential Societal Biases: Regardless of the safe data used for its training, the model is not entirely free from societal biases. There's a possibility it may generate content that mirrors these societal biases, particularly if prompted or instructed to do so. We urge users to be aware of this and to exercise caution and critical thinking when interpreting model outputs.
  • Toxicity: Despite that the model is trained with carefully selected data, the model can still produce harmful content if explicitly prompted or instructed to do so. We chose to release the model for research purposes only -- We hope to help the open-source community develop the most effective ways to reduce the toxicity of a model directly after pretraining.

Training#

Model#
  • Architecture: a Transformer-based model with next-word prediction objective
  • Dataset size: 30B tokens
  • Training tokens: 150B tokens
  • Precision: fp16
  • GPUs: 32xA100-40G
  • Training time: 8 days
Software#
License#

The model is licensed under the MIT license.

Citation#

You can find the paper at https://arxiv.org/abs/2309.05463. Please cite as:

@article{textbooks2,
  title={Textbooks Are All You Need II: \textbf{phi-1.5} technical report},
  author={Li, Yuanzhi and Bubeck, S{\'e}bastien and Eldan, Ronen and Del Giorno, Allie and Gunasekar, Suriya and Lee, Yin Tat},
  journal={arXiv preprint arXiv:2309.05463},
  year={2023}
}

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-1_5/blob/main/data_summary_card.md

Files

16 files · 2.84 GBWeights 2.84 GB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 16 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
CODE_OF_CONDUCT.md444 B9daeae709a0bd71bcfd1c96dc5822ecec5210327eff929da64b0ae7f8faf1444
LICENSE1.08 KBfa8235e5b48faca34e3ca98cf4f694ef08bd216d28b58071a1f85b1d50cb814d
NOTICE.md1.77 KB6ac541192c253d21cd16a597ce69c515868e031db3f32f75d996b993b5aca216
README.md7.94 KB0d640531410e28088c51bc12c4b59e95fccac487099635459b75920fb000530c
SECURITY.md2.66 KB7b6976eec43edfa68b79a459dd089c56b7a395916dbf1a01bd11e6d86e12128f
added_tokens.json1.08 KBeca8e90d1be6af3afeb1a37f070f9492645c551a9fb2e1ce2a4a8b21f04ffc8b
config.json736 B2fe52126434075e8a23aca5bfed8cca8aff7051779e6f11c76de9e9e9923dcef
data_summary_card.md3.88 KB741d9aa6f11c3cc5aa0c097731133f5055e919a5bac3e014a764ba9b93e05fcb
generation_config.json74 Bff7c43946d3177ab1c63ea647c4a5055ba2e47a9e359dfd0fc87298399520e25
merges.txt456 KB1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5
model.safetensors2.84 GBb4f562cc4b12f1154a0b658b9d74ab9d024a686420fdf154ebc00a2219976df7
special_tokens_map.json99 B6f50ab5a5a509a1c309d6171f339b196a900dc9c99ad0408ff23bb615fdae7ad
tokenizer.json2.11 MB337da36be7a71a6e88aa9148967a7bc8736f4b47c7de8e19ba92b89e80734cfc
tokenizer_config.json237 B001d5ef96609ff1bc02c1b7edabf97d4617c450620cf8dfbbad97c27cd9b5cb6
vocab.json798 KB3ba3c3109ff33976c4bd966589c11ee14fcaa1f4c9e5e154c2ed7f99d80709e7
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
77aa61eeac pinned now manifest updated, same commit2026-11-14 21:23 UTC16 files · 2.84 GB
77aa61eeac2026-11-14 21:23 UTC16 files · 2.84 GB

Use it

$ fw get microsoft/phi-1_5
# manifest sha256 0e3a85306198… · 2.84 GB · 16 files
$ fw verify ./phi-1_5 microsoft/phi-1_5
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/phi-1_5.json --dir ./phi-1_5 $ python3 fw.py verify ./phi-1_5 ./microsoft__phi-1_5.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/phi-1_5 --revision 77aa61eeac94fbf33d492b9f2744c98b42d5b5eb --local-dir ./phi-1_5
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("microsoft/phi-1_5", revision="77aa61eeac94fbf33d492b9f2744c98b42d5b5eb") model = AutoModelForCausalLM.from_pretrained("microsoft/phi-1_5", revision="77aa61eeac94fbf33d492b9f2744c98b42d5b5eb", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve microsoft/phi-1_5 --revision 77aa61eeac94fbf33d492b9f2744c98b42d5b5eb

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-1_5Date: 2026-11-14Commit: 77aa61eSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/phi-1_5
Pinned commit
77aa61eeac94fbf33d492b9f2744c98b42d5b5eb
Manifest
phi-1_5.json · .minisig
Manifest sha256
0e3a8530619846950c2e7755b7db12abdff790dbd4d3da6c83807c7b69f26fe4
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-14 21:23 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/phi-1_5.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/phi-1_5.json.minisig $ minisign -Vm phi-1_5.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-1_5
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. phi-1_5.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