MicrosoftMITPhi端侧 开源模型
Phi-4 Mini Phi-4 Mini
Phi-4 Mini系列 · Microsoft · 2025-02发布
模型介绍
微软 Phi-4 系列的小尺寸版本,3.8B/14B 参数,MIT 开源,端侧可跑,推理与数学能力超出同体积模型。
模型基础信息
模型系列Phi-4 Mini系列
开发机构Microsoft
发布时间2025-02
参数规模3.8B / 14B
上下文窗口128K
模型类型多模态(文本/图像)
中文能力一般
使用方式网页体验 / API调用 / 本地部署
免费额度与收费政策
开源免费
免费规则详情
MIT 自由商用。
收费标准简介
本地零成本。
模型能力介绍
✅ 核心优势
- MIT 开源
- 小巧
- 端侧
- 数学强
⚠️ 短板与局限
- 中文弱
- 能力有限
🎯 适用场景
- 端侧
- 教育
- 数学
- 轻量
模型使用教程
本章节整理 Phi-4 Mini 的在线体验、API调用、本地部署全套入门教程,快速上手使用该模型。
- 本地体验:
ollama run phi-4-mini或 Transformers / vLLM 加载。 - 云端:HF 托管模型可在线体验。
ollama run phi-4-mini "用中文介绍一下Phi-4 Mini"
HF_ENDPOINT=https://hf-mirror.com huggingface-cli download Microsoft/Phi-4 Mini --local-dir ./phi-4-mini
或 ModelScope 国内直连下载。
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('Microsoft/Phi-4 Mini')
tok = AutoTokenizer.from_pretrained('Microsoft/Phi-4 Mini')
code = tok.apply_chat_template([{'role':'user','content':'你好'}], tokenize=False)
print(model.generate(**tok(code, return_tensors='pt')))
Phi-4 Mini 是微软 3.8B/14B 的小模型(MIT),端侧可跑,推理与数学强,CPU 也能流畅使用。
- Ollama:
ollama pull phi4-mini
- 交互使用:
ollama run phi4-mini
- transformers 加载:
python -c "from transformers import AutoModelForCausalLM; AutoModelForCausalLM.from_pretrained('microsoft/Phi-4-mini-instruct', device_map='auto')"
Tips:3.8B 量化后 3GB 级,笔记本/手机可跑;中文弱,英文与数学场景最佳。
💡 使用小技巧
手机/笔记本直接跑。
❓ 常见问题 FAQ
Q1:Phi-4 Mini?\nA1:MIT 开源小模型。
访问备注与注意事项
- 权重可下
Aitishiku.com