Skip to content
llmmodels
Code modelOpen weights

Phi-1

by Microsoft · Oct 2, 2023

Phi-1 is an open-weight code model from Microsoft, released Oct 2, 2023. It has 1.4B parameters.

Provider
Microsoft
Released
Oct 2, 2023
Type
Code model
Parameters
1.4B
Context window
—
Max output
—
Input
text
Output
text
Weights
Open weights
License
mit
Knowledge cutoff
—
Status
Open weights
Training compute
3.3e+20 FLOP
HF downloads (30d)
9.4K

About Phi-1

We introduce phi-1, a new large language model for code, with significantly smaller size than competing models: phi-1 is a Transformer-based model with 1.3B parameters, trained for 4 days on 8 A100s, using a selection of ``textbook quality" data from the web (6B tokens) and synthetically generated textbooks and exercises with GPT-3.5 (1B tokens). Despite this small scale, phi-1 attains pass@1 accuracy 50.6% on HumanEval and 55.5% on MBPP.

Phi-1 benchmarks

All benchmarks →

Scores from the Epoch AI Benchmarking Hub (best reported setting). ECI = Epoch Capabilities Index.

How to run Phi-1

Phi-1 is an open-weight model published on Hugging Face as microsoft/phi-1. Run it locally with Ollama, LM Studio or llama.cpp (quantized GGUF builds), or serve it on GPUs with vLLM, SGLang or Hugging Face TGI. At 1.4B parameters it needs roughly 1 GB of memory at 4-bit quantization.

Phi-1 vs alternatives

Alternatives to Phi-1
ModelProviderReleasedParamsContextInput $/1MOutput $/1MECI
DeepSeek Coder 1.3BopenDeepSeekNov 20231.3B————
Qwen2.5-Coder (1.5B)openAlibaba (Qwen)Sep 20241.5B———89.1
DeepSeek Coder 6.7BopenDeepSeekNov 20236.7B———67.5
Phi-2openMicrosoftDec 20232.8B———96.2
OpenELM-1.1BopenAppleMay 20241.1B————
Code Llama-7BopenMetaAug 20236.7B————
Granite 3.0 2BopenIBMOct 20242.6B————
CodeT5-largeopenSalesforceJul 2022770M————

More models from Microsoft

All Microsoft models →
ModelReleasedParamsContextInput $/1MOutput $/1M
Phi 4openDec 202415B16K$0.07$0.14
Phi-2openDec 20232.8B———
Phi-1.5openSep 20231.4B———
Phi 4 MiniopenFeb 20253.8B8K$0.17$0.68
Florence-2-baseopenJun 2024232M———
harrier-oss-v1-0.6bopenMar 2026596M———
harrier-oss-v1-270mopenMar 2026268M———
Phi-4-reasoning-vision-15BopenJan 202615B———

Frequently asked questions

Who made Phi-1?

Phi-1 was developed by Microsoft (United States of America). It was released on Oct 2, 2023.

Is Phi-1 open source?

Yes. Phi-1's weights are publicly available under the mit license on Hugging Face (microsoft/phi-1), so you can download and run it yourself.

How many parameters does Phi-1 have?

Phi-1 has 1.4B parameters.

How does Phi-1 perform on benchmarks?

Phi-1 scores 37.6% on MMLU and 47.6% on HellaSwag.

Sources: epoch, huggingface · paper · huggingface. Last updated 2026-11-22.