Phi Models › Deployment and Practical Use
Language AI HandbookAll chapters Phi Models › Deployment and Practical UseOne section · Sections in this chapter10 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Phi models are designed for efficient deployment. Their small size enables scenarios that would be impractical with larger models.
Edge deployment: Phi-3-mini can run on smartphones and laptops without cloud connectivity. This enables privacy-preserving applications where user data never leaves the device.
Quantization: The small parameter count makes quantization more effective. Quantization reduces memory by representing weights with fewer bits. For a model with parameters, the memory requirement scales as:
where:
- : the number of model parameters
- : the number of bits per parameter (e.g., 16 for FP16, 4 for INT4)
A 4-bit quantized Phi-3-mini (3.8B parameters) requires approximately of memory while maintaining most of its capabilities.
Batched inference: The smaller memory footprint allows processing more requests simultaneously on a single GPU, reducing per-query costs.
Fine-tuning: With fewer parameters, fine-tuning Phi models requires less compute and memory, making customization accessible to more users.
# Deployment scenarios
deployment_specs = {
"Phi-3-mini (FP16)": {
"memory_gb": 7.6,
"smartphone": False,
"laptop_gpu": True,
"server_gpu": True,
},
"Phi-3-mini (INT4)": {
"memory_gb": 2.0,
"smartphone": True,
"laptop_gpu": True,
"server_gpu": True,
},
"LLaMA-2-7B (FP16)": {
"memory_gb": 14,
"smartphone": False,
"laptop_gpu": False,
"server_gpu": True,
},
"LLaMA-2-70B (FP16)": {
"memory_gb": 140,
"smartphone": False,
"laptop_gpu": False,
"server_gpu": True,
},
}Deployment Feasibility by Platform ================================================================= Model Memory Phone Laptop Server ----------------------------------------------------------------- Phi-3-mini (FP16) 7.6 GB ✗ ✓ ✓ Phi-3-mini (INT4) 2.0 GB ✓ ✓ ✓ LLaMA-2-7B (FP16) 14.0 GB ✗ ✗ ✓ LLaMA-2-70B (FP16) 140.0 GB ✗ ✗ ✓
