SuperAPIAI Directory

PhiCookBook

github.com · AI developer platforms

Microsoft's open-weight small language model (SLM) family — efficient small models for on-device and cloud deployment. Includes general, reasoning, multimodal, and vision variants (e.g., Phi-4-mini, Phi-4, Phi-4-multimodal, Phi-4-reasoning-vision).

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsiOS · Android · macOS · Linux

About this tool

PhiCookBook (Phi Cookbook) is a hands-on starter manual and sample collection provided by Microsoft for the Phi family of Small Language Models (SLMs), hosted on GitHub (https://github.com/microsoft/PhiCookBook)。

Purpose: To help developers quickly get started with Microsoft's Phi family of open-source AI models. Phi is officially described as a currently powerful and cost-effective small language model, performing well in benchmarks across multilingual, reasoning, text and dialogue generation, coding, image, audio, and other scenarios, and can be deployed to the cloud or edge devices to build generative AI applications under limited computing resources.

Main capabilities and content structure:

  • Getting started and background: Includes chapters such as Welcome to the Phi family, environment setup, understanding key technologies, AI safety for Phi models, Phi hardware support, availability of Phi models on various platforms, using Guidance-ai with Phi, GitHub Marketplace models, Azure AI model catalog, and more.
  • Inference: Covers running Phi in different environments, such as Hugging Face, GitHub Models, Microsoft Foundry model catalog, Ollama, AI Toolkit VSCode (AITK), NVIDIA NIM, Foundry Local; as well as inferring Phi family models in scenarios such as iOS, Android, Jetson, AI PC, Apple MLX framework, local servers, remote servers via AI Toolkit, Rust, local Phi-Vision, Kaito AKS, and Azure Containers (officially supported).
  • Quantifying: Quantizing Phi-3.5 / 4 using llama.cpp, the generative AI extensions for onnxruntime, Intel OpenVINO, and the Apple MLX framework.
  • Evaluation: Phi response evaluation, Microsoft Foundry evaluation, evaluation using Promptflow.
  • RAG: How to use Phi-4-mini and Phi-4-multimodal with Azure AI Search (RAG); and implementing zero-cloud local hybrid RAG using SQLite FTS5 with phi-4-mini.
  • Phi application development samples, by category including: text and dialogue applications (Phi-4, Phi-3/3.5 samples, such as ONNX model chat, .NET console application with Semantic Kernel, browser-local chatbot, OpenVino chat, multi-model interaction, MLFlow wrapper, model optimization, WinUI3 application, Prompt flow fine-tuning and integration, evaluating fine-tuned models in Microsoft Foundry, WebGPU RAG chatbot, Windows GPU Prompt flow, Android application, local ONNX question answering, etc.); Azure AI Inference SDK code-based samples (including using Phi-4-multimodal to generate project code, and building Visual Studio Code GitHub Copilot Chat / Chat Copilot Agent based on the Phi-3 family or Phi-3.5 via GitHub Models); advanced reasoning samples (Phi-4-mini-reasoning or Phi-4-reasoning samples, fine-tuning using Microsoft Olive, Apple MLX, combined with GitHub Models, Microsoft Foundry Models); demos (Phi-4-mini and Phi-4-multimodal demos hosted on Hugging Face Spaces); vision samples (Phi-4-multimodal reading images and generating code, Phi-3/3.5 image-to-text, ONNX, CLIP embeddings, recycling demo, vision-language assistant, NVIDIA NIM, OpenVINO, multi-frame or multi-image samples, local ONNX models, etc.); reasoning-vision samples (Phi-4-Reasoning-Vision-15B for detecting jaywalking, math, detecting UI); math samples (Phi-4-Mini-Flash-Reasoning-Instruct and its math demo); audio samples (using Phi-4-multimodal to extract audio transcription, audio samples, speech translation samples, and a .NET console application to analyze audio files and generate transcriptions); MOE samples (Phi-3.5 mixture-of-experts model social media sample, and using NVIDIA NIM Phi-3 MOE, Azure AI Search, and LlamaIndex to build a RAG pipeline); function calling examples (Phi-4-mini function calling, using function calling to build multi-agent systems, function calling combined with Ollama and ONNX).

How to use: The official steps are as follows: Fork the repository; clone the repository with the command git clone https://github.com/microsoft/PhiCookBook.git;加入 Microsoft AI Discord community to interact with experts and developers. The repository also provides multilingual support, listing translations for more than 50 languages, including Simplified Chinese, Traditional Chinese (Hong Kong, Macao, Taiwan), English, Japanese, Korean, French, German, Spanish, Portuguese, Russian, Arabic, etc. Since the repository containing translations for more than 50 languages significantly increases the download size, if you need to exclude translations when cloning, you can use sparse checkout; the official Bash / macOS / Linux examples are provided.

Applicable scenarios: Suitable for developers who want to get started with Microsoft's Phi series of small language models and carry out learning in inference, quantization, evaluation, RAG, function calling, and multimodal application development on local devices, edge devices, or the cloud; it is also suitable for complete learning as a course-style tutorial.

Limitations: Facts such as specific charges, pricing, licensing terms, and model accuracy values are not yet provided in the materials; some content is subject to the actual files in the official repository.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools