Model reference · open weights

phi-1_5

LLMs microsoft Text gen 1 build Open weights 57k dl/mo

phi-1_5 is an open-weight language model from microsoft. phi-1_5 (FP16) weighs 2.8 GB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • Phi-1.5 is a 1.4B parameter text-generation model developed by Microsoft.
  • It supports a 2048 token context length and is designed for English language tasks.
  • The model is released under the MIT license.

Summary of the microsoft/phi-1_5 model card, 2026-10-01

What it is

Released bymicrosoft
Released2023-09-10
Parameters1.4B
VRAM2.8 GB for the weights

What it runs on

Memory and cards for phi-1_5 (FP16)

2.8 GBweights, file size
197 MBcache per 1K tokens
583 MBruntime overhead, at least
2,048 tokenscontext max
CardRequests at onceContext maxMemory
2K each
RTX 3060 12 GB20all 2K11.6 GB
RTX 4060 Ti 16 GB29all 2K15.4 GB
RTX 3090 24 GB49all 2K23.4 GB
RTX 4090 24 GB49all 2K23.4 GB
RTX 5090 32 GB68all 2K31.0 GB
L40S 48 GB100all 2K44.0 GB
A100 80 GB185all 2K78.2 GB
H100 80 GB178all 2K78.1 GB
RTX PRO 6000 Blackwell 96 GB217all 2K93.8 GB
DGX Spark (GB10) 128 GB unified250all 2K107 GB
H200 141 GB326all 2K138 GB
B200 180 GB420all 2K176 GB
Memory needed at each load
Requests at once2K tokens each
13.8 GB
55.4 GB
86.6 GB
169.9 GB
3216.3 GB
6429.2 GB

One card, with vLLM's small-card settings.

From the model card

What microsoft says about phi-1_5

Read the model card

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 harm

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms