Phi-4 — Specifications
Compiled by Mustafa Ihsan from the vendor’s published documentation · Last updated
| المطوّر | مايكروسوفت |
|---|---|
| النوع | نموذج لغوي كبير (كثيف) |
| النمط | نص → نص |
| عدد المعايير (البارامترات) | 14 مليار معلّمة |
| نافذة السياق | 16 ألف رمز |
| الترخيص | ترخيص MIT (مفتوح المصدر) |
| أوزان مفتوحة المصدر | نعم |
| أُطلِقَ | 2025 |
| سعر الإدخال | $0.07 /1M |
| سعر الإخراج | $0.14 /1M |
| مقدمو واجهات برمجة التطبيقات (API) | أزور، أوبنروتر، أولاما |
تشغيله محليًّا
| ذاكرة الفيديو (VRAM) بتنسيق 4 بت | ~٩ جيجابايت |
|---|---|
| أقل وحدة معالجة رسومية (GPU) مطلوبة | RTX 4070 بسعة ١٢ جيجابايت / RTX 3060 بسعة ١٢ جيجابايت |
What is Phi-4?
Phi-4 is Microsoft’s compact 14B reasoning model, MIT-licensed, which punches well above
its size on mathematics and logic. It needs about 9 GB of VRAM at 4-bit, running comfortably
on an RTX 4070 or RTX 3060 12GB, and costs $0.07 in / $0.14 out per million tokens
hosted.
The Phi line’s whole thesis is that curated, textbook-quality training data beats raw
scale for reasoning tasks, and Phi-4 is the clearest evidence for it — a 14B model competing
on maths and logic benchmarks with models several times larger. The cost of that focus is the
16K context window, by far the narrowest in this database and a hard limit for any workload
involving documents, long conversations or retrieval. Read it as a specialist: excellent for
structured reasoning over short inputs — maths tutoring, logic and code puzzles, deterministic
extraction from small payloads — and the wrong tool the moment your prompt grows. If you need
Phi-4’s reasoning with room to work, a 128K-context model in the same hardware bracket such
as Qwen3 14B is the better trade.
Phi-4 pricing: API cost per 1M tokens
| المدخلات (لكل مليون رمز) | $0.0700 |
|---|---|
| المخرجات (لكل مليون رمز) | $0.140 |
| نسبة الإخراج إلى الإدخال | 2× |
| مدمجة (4:1 إدخال:إخراج) | $0.0840 لكل مليون رمز |
What Phi-4 costs per month
الإنفاق الشهري الفعلي عند نسبة إدخال إلى إخراج مقدارها 4:1 — وهي النسبة التي تولدها عادةً حمولات العمل الخاصة بالمحادثات أو أنظمة استرجاع المعلومات المعزَّزة (RAG).
| الحمل التشغيلي | الرموز شهريًّا | التكلفة شهريًّا |
|---|---|---|
| مشروع جانبي | 1 مليون رمز مدخلات / 0.25 مليون رمز مخرجات | $0.11 |
| فريق صغير | 20 مليون رمز مدخلات / 5 ملايين رمز مخرجات | $2.10 |
| الإنتاج | 200 مليون رمز مدخلات / 50 مليون رمز مخرجات | $21 |
احسب أرقامك الخاصة في حاسبة تكلفة واجهات برمجة تطبيقات الذكاء الاصطناعي (API).
Cheaper alternatives to Phi-4
| النموذج | المتوسط المُدمج بالدولار لكل مليون دولار | توفِّر |
|---|---|---|
| Mistral 7B تم تصميمه بالتعاون الوثيق مع نظام iOS وإطار عمل Core ML. ولا تسعى آبل إلى تحقيق أعلى رقم ممكن في وحدات العمليات التريليونية في الثانية (TOPS)، بل تسعى إلى تحقيق | $0.0220 | 74% cheaper |
| Llama 3.1 8B تم تصميمه بالتعاون الوثيق مع نظام iOS وإطار عمل Core ML. ولا تسعى آبل إلى تحقيق أعلى رقم ممكن في وحدات العمليات التريليونية في الثانية (TOPS)، بل تسعى إلى تحقيق | $0.0220 | 74% cheaper |
| Mistral NeMo 12B تم تصميمه بالتعاون الوثيق مع نظام iOS وإطار عمل Core ML. ولا تسعى آبل إلى تحقيق أعلى رقم ممكن في وحدات العمليات التريليونية في الثانية (TOPS)، بل تسعى إلى تحقيق | $0.0240 | أرخص بنسبة ٧١٪ |
هل تُشغِّله ذاتيًّا أم تدفع مقابل واجهة برمجية (API)؟
Phi-4 is open-weight, so you can run it yourself. It needs ~٩ جيجابايت of VRAM at 4-bit (RTX 4070 12GB / RTX 3060 12GB). Self-hosting only beats the API once your volume is high enough to keep that hardware busy — the حاسبة المقارنة بين الاستضافة الذاتية وواجهة برمجة التطبيقات (API) يحسب نقطة التعادل بالنسبة لحجم الرموز الذي تستخدمه.
الأسئلة الشائعة
How much does Phi-4 cost per 1M tokens?
Phi-4 costs $0.0700 per 1M input tokens and $0.140 per 1M output tokens. At a typical 4:1 input-to-output mix that blends to about $0.0840 per 1M tokens.
How much does Phi-4 cost per month?
A small-team workload of 20M input and 5M output tokens a month costs about $2.10 on Phi-4. A side project (1M in / 0.25M out) costs roughly $0.11.
What is a cheaper alternative to Phi-4?
Mistral 7B is the strongest cheaper option in our database at $0.0220 per 1M blended — about 74% less than Phi-4. It is also open-weight, so self-hosting is an option.
Can I run Phi-4 locally?
Yes. Phi-4 is open-weight and needs about ~9 GB of VRAM at 4-bit quantisation (RTX 4070 12GB / RTX 3060 12GB).
Why does Phi-4 charge more for output than input?
Output tokens are generated one at a time and cannot be batched the way a prompt can, so they cost the provider more to serve. Phi-4 charges 2× more for output, which is why prompt-heavy workloads are far cheaper to run than generation-heavy ones.
الأسعار هي الأسعار المنشورة المعمول بها لواجهة برمجة التطبيقات الأساسية لكل نموذج، وتتم مراجعتها دوريًّا عند تحديث المزوِّدين لها. ولا تشمل الخصومات المقدَّمة على أساس الحجم أو المعالجة الدُّفعية أو المدخلات المؤقَّتة (cached-input). وقارن كل النماذج جنبًا إلى جنب في قاعدة بيانات نماذج الذكاء الاصطناعي أو لوحة تصنيف النماذج اللغوية الكبيرة (LLM).
