phi-guide
Build with Microsoft's Phi small language models — compact reasoning models for edge and cost-efficient apps.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- phi-guide
- category
- ai-research
- description
- Build with Microsoft's Phi small language models — compact reasoning models for edge and cost-efficient apps.
03 SKILL.md 正文
Overview
Phi (Microsoft) is a family of small language models (roughly 3B–14B) known for punching far above their weight — particularly in reasoning, math, and code — thanks to training on high-quality synthetic and curated data rather than raw scale. The "textbook quality data" story is the differentiator: Phi demonstrates that data quality can substitute for parameters, producing small models with surprising capability.
For builders, Phi's niche overlaps Gemma's (small, efficient, deployable) with a reasoning emphasis: on-device copilots, cost-efficient RAG components, edge inference, and applications where a small model's reasoning ability matters. Microsoft's backing means good tooling integration (ONNX, Windows, Azure) and continued development.
The practical stance: Phi belongs in every small-model evaluation, especially when the task involves reasoning rather than just fluency.
When to use
- Small-model reasoning tasks: math, logic, code assistance at small scale.
- On-device and edge AI (Windows, mobile, browsers).
- Cost-efficient components in larger pipelines (classifiers, extractors, rerankers' assistants).
- Offline/air-gapped deployments needing capable small models.
- Educational and research use of compact models.
- Latency-critical inference where small models' speed matters.
Core concepts
- Data-quality thesis: Phi's capability comes from curated/synthetic training data, not scale. The lesson generalizes: for fine-tuning small models, invest in data quality over quantity.
- Size range: roughly 3B–14B across generations. Benchmark the range — newer generations improve the quality/size tradeoff.
- Reasoning emphasis: unusually strong reasoning for the size class. Test on reasoning benchmarks relevant to your task, not just chat fluency.
- Microsoft ecosystem: ONNX export, Windows AI integration, Azure deployment paths. If you're Microsoft-centric, the integration is smooth.
- Instruction-tuned variants: tuned for assistant behavior. Use IT variants for interactive use; base for fine-tuning.
- Edge deployment: small sizes + quantization = genuine on-device AI. Validate on target hardware with your latency budgets.
- Multimodal variants: vision-capable Phi versions for compact image+text tasks. Evaluate against alternatives at the size.
- Licensing: Microsoft's terms for Phi — read for your use case, as with any model family.
Practical workflow
- Benchmark reasoning at small scale. Your reasoning tasks on Phi vs. other small models (Gemma, Qwen small, Llama small). Phi's edge is reasoning — verify it on your problems.
- Test the size range. Newer Phi generations shift the optimum. Find the smallest adequate size for your task.
- Evaluate deployment targets. On-device: quantize and test on hardware. Cloud: compare API/self-host economics at your volume.
- Consider the Microsoft path. If you're on Azure/Windows: evaluate the integrated deployment options — they may simplify operations.
- Fine-tune where close. Small models + quality data = effective fine-tuning. If base Phi is near your bar, targeted training may close it.
- Check licensing. Confirm terms for your commercial or edge deployment scenario.
- Track generations. Phi improves rapidly per generation; re-benchmark on new releases.
Checklist for Phi in production:
- Reasoning advantage verified against small-model alternatives.
- Smallest adequate size selected.
- Edge deployment validated on target hardware (if applicable).
- License confirmed for your scenario.
- Fine-tuning evaluated where base is close.
Common pitfalls
- Fluency-only evals. Testing chat smoothness and missing Phi's reasoning differentiation. Evaluate reasoning specifically.
- Ignoring the data lesson. Fine-tuning Phi on sloppy data and wondering why it underperforms. The family's thesis is data quality — honor it.
- Generation blindness. Running an old Phi when newer generations are much better per parameter. Track releases.
- Edge assumptions. Assuming on-device works without testing on the actual hardware with real latency budgets.
- Wrong ecosystem. Fighting the tooling when another small model has better support for your stack. Match model to deployment reality.
- Overestimating small models. Phi is impressive for its size, not limitless. Honest task-difficulty assessment.
- Skipping quantization tests. Edge deployment without validating quantized quality on your evals.
- License not checked. Assuming terms from the general "open" narrative. Read the actual terms.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).