microsoft / text-generation Open weights Also via API updated 3 months ago

phi-4

-------------------------------------------------------------------------------------------------------- Developers Microsoft Research Description phi-4 is a state-of-the-art open model built upon a blend of synthetic datasets, data from filtered public domain websites, and acquired academic books and Q&A datasets. The goal of this approach was to ensure that small capable models were trained with data focused on hig...

Params
14.7 B
Context
16,384
Downloads 30d
276 K
Likes
2,341
Commercial use: allowed mit Not gated SAFETENSORS 1 languages View on Hugging Face ↗

Download history

daily snapshots · 106 days
▲ 103 K in the last 30 days (27.3%)
714 K276 K
Jul 28Sep 1Oct 6Nov 10

Can you run it?

Estimated VRAM at 8K context unless noted. Pick your hardware to see the verdict per quantization.

FileQuantSizeEst. VRAMVerdict on RTX 4090 · 24 GB
model.safetensors bf16 29.3 GB 34.9 GB ❌ Won’t fit
model.safetensors (bf16, full) bf16 + 16K ctx 29.3 GB 37.1 GB ❌ Won’t fit
Estimate: file size × 1.1 + KV cache at 8K + 0.5 GB overhead. Not a benchmark — how we calculate this.

Run it

copy-paste, exact tags checked against the Hub
~ · curl · api/v1
$ curl -s https://aimodelscomparison.com/api/v1/models/phi-4
{
  "hf_id": "microsoft/phi-4",
  "params_b": 14.66,
  "context_length": 16384,
  "license": { "id": "mit", "commercial": "yes" },
  "downloads_30d": 275580,
  "vram_estimates": [
    { "quant": "bf16", "gb": 34.9 }
  ],
  "updated_at": "2026-07-28T18:04:14Z"
}
est. VRAM —on RTX 4090 · 24 GBJSON API →

Use via API

via OpenRouter · USD per 1M tokens · synced 2026-11-10
$0.07
input / 1M
$0.14
output / 1M
—
cached input / 1M
$0.21
1M in + 1M out
Context window
16,384 tokens
Max output
14,745 tokens
Providers
1
Cheapest provider
DeepInfra · $0.056 / $0.11
Best throughput
—
AA Intelligence / Coding / Agentic
— / — / —
✗ Tool calling ✗ Reasoning ✓ Structured outputs ✗ Image input ✗ File input ✗ Audio input ✗ Prompt caching

Specifications

Architecture
Phi3ForCausalLM
Parameters
14.7 B
Tensor type
BF16
Context length
16,384
Vocabulary
100,352
Layers / heads
40 / 40
Licence
mit
First seen on the Hub
2024-12-11
Training datasets
undisclosed
Added to our catalog
2026-07-28
Compare with any text-generation model