# Phi-3-mini-4k-instruct GPU requirements

Phi-3-mini-4k-instruct has 3.8B parameters. To serve it, plan for about 9.2 GB of GPU memory in 16-bit, 4.6 GB in 8-bit or 2.3 GB in 4-bit, including about 20% for the KV cache and activations.

[Deploy it on Arrakis](/console/#/models?model=microsoft/Phi-3-mini-4k-instruct).

## What it takes to serve it

| Precision | Memory and the smallest setup |
|---|---|
| 16-bit | 9.2 GB: one [RTX 4090](/gpus/rtx-4090.html.md) or [RTX 3090](/gpus/rtx-3090.html.md), RTX 3090 from $0.19 per GPU-hour |
| 8-bit | 4.6 GB: one [RTX 4090](/gpus/rtx-4090.html.md) or [RTX 3090](/gpus/rtx-3090.html.md), RTX 3090 from $0.19 per GPU-hour |
| 4-bit | 2.3 GB: one [RTX 4090](/gpus/rtx-4090.html.md) or [RTX 3090](/gpus/rtx-3090.html.md), RTX 3090 from $0.19 per GPU-hour |

## What it takes to fine-tune it

| Method | Memory and the smallest setup |
|---|---|
| QLoRA | 2.7 GB: one [RTX 4090](/gpus/rtx-4090.html.md) or [RTX 3090](/gpus/rtx-3090.html.md), RTX 3090 from $0.19 per GPU-hour |
| LoRA | 9.2 GB: one [RTX 4090](/gpus/rtx-4090.html.md) or [RTX 3090](/gpus/rtx-3090.html.md), RTX 3090 from $0.19 per GPU-hour |
| Full fine-tuning | 61 GB: one [H100](/gpus/h100.html.md) or [A100](/gpus/a100.html.md), H100 from $1.65 per GPU-hour |

## About the model

| | |
|---|---|
| Parameters | `3.8B` |
| Context window (tokens) | `4,096` |
| Published in | `BF16` |
| License | `mit` |
| Released | `2024-04-22` |
| Weights | [microsoft/Phi-3-mini-4k-instruct](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) |

## Serve it yourself

```
vllm serve microsoft/Phi-3-mini-4k-instruct --tensor-parallel-size 1
```

## Questions

**How much GPU memory does Phi-3-mini-4k-instruct need?** To serve it, about 9 GB in 16-bit, 5 GB in 8-bit, 2 GB in 4-bit, including about 20% for the KV cache and activations. To fine-tune it, about 3 GB with QLoRA, 9 GB with LoRA and 61 GB for full fine-tuning with Adam, before activations.

**Can I run Phi-3-mini-4k-instruct on one GPU?** Yes. In 16-bit it needs about 9.2 GB, which fits on one RTX 4090 or RTX 3090.

**What does it cost to run Phi-3-mini-4k-instruct?** In 16-bit it needs one RTX 4090 or RTX 3090; in 4-bit, one RTX 4090 or RTX 3090. Each setup on this page shows the lowest price per GPU-hour on Arrakis right now, and you pay by the hour from a prepaid balance.

**How do I deploy Phi-3-mini-4k-instruct on Arrakis?** Open Models in the Arrakis console, paste microsoft/Phi-3-mini-4k-instruct, choose vLLM, SGLang or llama.cpp, and rent a GPU it fits on. You get an OpenAI-compatible endpoint with its own API key, and root SSH to the machine.


More models: [/models](/models.html.md).
