ApX logoApX logo
CalculatorCoursesPricing

Phi-4-Mini

Open Source
Open Weights

Parameters

3.8B

Context Length

128K

Modality

Text

Architecture

Dense

KV Cache Rate

128 KB/tok

License

MIT License

Release Date

27 Feb 2025

Knowledge Cutoff

Jun 2024

API Pricing (per 1M)

Input: $0.07 · Output: $0.30

Hardware & System Requirements

Precision

Context

Workload Memory: 5.27 GB

vLLM

INT4 · 8K context · 1 user

Base Weights: 1.77 GB

KV Cache: 1.00 GB

Runtime & Graphs: 2.50 GB

Minimum Required Hardware

1x NVIDIA L4 24GB

vLLM

5.3 / 21.6 GB

1x RTX 3060 12GB

llama.cpp

5.3 / 11.2 GB

Apple M4 24GB

llama.cpp

5.3 / 18.0 GB

Determine requirements for concurrent users or multi-node clusters:

Runtime compatibility

Verified on hardware and checkpoint files.

Checkpoint format

BF16

CUDA

13.0

PyTorch

2.14.0

Transformers

≥ 4.40.1

ArchitecturePrecisionKernel

Hopper

Native BF16

FlashAttention-3

Architecture Diagram

Input TokensToken EmbeddingPosition: RoPEHidden: 3.1k · Context: 128K · Vocab: 200.1kx 32 layersRMSNormPre-AttentionGrouped-Query Attention24Q / 8KV heads · SW: 262.1kHead dim: 128+RMSNormPre-FFNFeed-Forward NetworkSwishIntermediate: 8.2k+Final RMSNormOutput Logits

Evaluation Benchmarks

Rank

#234

BenchmarkScoreRank

Professional Knowledge

MMLU Pro

0.528

#57

Graduate-Level QA

GPQA

0.252

#123

Intelligence Index

Artificial Analysis

0.06

#313

General Knowledge

Reference
MMLU

0.673

#28

Coding Index

Archived
Artificial Analysis

0.04

#155

Rankings

Overall Rank

#234

Coding Rank

-

About Phi-4-Mini

Phi-4-Mini is a compact 3.8B open model from Microsoft optimized for low-latency reasoning, function calling, and edge deployment via ONNX. It features an expanded 200K vocabulary and LongRoPE context management for on-device AI.

Specifications

Attention

Attention Structure

Grouped-Query Attention

Attention Heads

24

Key-Value Heads

8

Position Embedding

ROPE

RoPE Theta

10,000

Sliding Window Attention

Yes

Sliding Window Size

262,144

Normalization

RMS Normalization

Activation Function

Swish

Dimensions

Base Precision

BF16

Hidden Dimension Size

3,072

Number of Layers

32

FFN Intermediate Size (Dense)

8,192

Tokenizer

Vocabulary Size

200,064

About Phi-4

The Microsoft Phi-4 model family comprises small language models prioritizing efficient, high-capability reasoning. Its development emphasizes robust data quality and sophisticated synthetic data integration. This approach enables enhanced performance and on-device deployment capabilities.


Other Phi-4 Models
Phi-4-Mini Size, VRAM & Hardware Requirements