Phi 2 by microsoft

 »  All LLMs  »  microsoft  »  Phi 2   URL Share it on

Phi 2 is an open-source language model by microsoft. Features: 2.8b LLM, VRAM: 5.6GB, Context: 2K, License: mit, LLM Explorer Score: 0.35, Arc: 61, HellaSwag: 74.9, MMLU: 57.9, GSM8K: 55.

  Code   Deploy:azure   En   Endpoints compatible   Phi   Region:us   Safetensors   Sharded   Tensorflow

Phi 2 Benchmarks

nn.n% — How the model compares to the reference models: Anthropic Sonnet 3.5 ("so35"), GPT-4o ("gpt4o") or GPT-4 ("gpt4").

Phi 2 Parameters and Internals

Model Type 
text generation, code generation
Use Cases 
Areas:
research
Applications:
QA, chat, code format
Primary Use Cases:
QA format, chat format, code format
Limitations:
Generate Inaccurate Code and Facts, Limited Scope for code, Unreliable Responses to Instruction, Language Limitations, Potential Societal Biases, Toxicity, Verbosity
Additional Notes 
Phi-2 is intended for QA, chat, and code purposes. Model-generated text/code should be treated as a starting point. Users should be cautious when employing these models in applications.
Supported Languages 
en (Standard English)
Training Details 
Data Sources:
Phi-1.5, NLP synthetic texts, filtered websites
Data Volume:
250B tokens
Methodology:
Transformer-based model with next-word prediction objective
Context Length:
2048
Training Time:
14 days
Hardware Used:
96xA100-80G GPUs
Model Architecture:
Transformer-based model with next-word prediction objective
Input Output 
Accepted Modalities:
text
Performance Tips:
Phi-2 has an attention overflow issue (with FP16). If encountering this issue, enable/disable autocast on the PhiAttention.forward() function.
LLM NamePhi 2
Repository 🤗https://huggingface.co/microsoft/phi-2 
Model Size2.8b
Required VRAM5.6 GB
Updated2026-06-01
Maintainermicrosoft
Model Typephi
Model Files  5.0 GB: 1-of-2   0.6 GB: 2-of-2
Supported Languagesen
Model ArchitecturePhiForCausalLM
Licensemit
Context Length2048
Model Max Length2048
Transformers Version4.37.0
Tokenizer ClassCodeGenTokenizer
Vocabulary Size51200
Torch Data Typefloat16

Quantized Models of the Phi 2

Model
Likes
Downloads
VRAM
Phi 2 GGUF232245491 GB
Phi2 Bunny39395 GB
Damysus 2.7B Chat GGUF0971 GB
Phi 2 GGUF63401 GB
Phi 2 GGUF31881 GB
Phi 2 GPTQ301351 GB

Best Alternatives to Phi 2

Best Alternatives
Context / RAM
Downloads
Likes
MFANN3bv0.24128K / 11.1 GB80
MFANN3b128K / 11.1 GB670
MFANN3bv1.4128K / 11.1 GB50
MFANN Phigments Slerp V3.2128K / 5.6 GB70
MFANN3bv1.3128K / 11.1 GB90
MFANN3bv0.23128K / 11.1 GB50
MFANN3bv1.1128K / 11.1 GB50
MFANN3bv1.5128K / 11.1 GB50
MFANN Liminerity Slerp 4a128K / 5.6 GB70
MFANN3b Rebase128K / 11.1 GB70

Rank the Phi 2 Capabilities

🆘 Have you tried this model? Rate its performance. This feedback would greatly assist ML community in identifying the most suitable model for their needs. Your contribution really does make a difference! 🌟

Instruction Following and Task Automation  
Factuality and Completeness of Knowledge  
Censorship and Alignment  
Data Analysis and Insight Generation  
Text Generation  
Text Summarization and Feature Extraction  
Code Generation  
Multi-Language Support and Translation  

What open-source LLMs or SLMs are you in search of? 54415 in total.

Our Social Media →  
Original data from HuggingFace, OpenCompass and various public git repos.
Check out Ag3ntum — our secure, self-hosted AI agent for server management.
Release v20260328a