microsoft

Phi-4-mini-instruct

3.8B parameters · Instruct · Phi family

mit hash verified source matched revision pinned

Which version should I download?

Default pick: GGUF · Q4_K_M — Balanced size/quality — good default.

Set your rig to confirm it fits and to see if a higher-quality quant runs fully on your hardware.

Set your rig

GGUF · Q4_K_M

2.32 GB

Est. speed
Swarm
2S / 0L webseed OK

Balanced size/quality — good default.

GGUF · Q8_0

3.80 GB

Est. speed
Swarm
2S / 0L webseed OK

Bartowski Q8_0 quant of Phi-4-mini-instruct (3.836B dense) — high-quality option. MIT.

Want a different quant? Request it on the board →

Runs fully on

Green = the model's best quant fits fully in GPU/unified memory at 8K context. Tap a card for its full "what runs on it" page.

Context

Advertised 128k · usable ≈ 128k (reported — model card)

How we know

Evidence grade: reported — a maintainer claim with no independent evaluation.

Card: 128K context via LongRoPE. Tech report describes the mechanism but discloses no numeric long-context scores.

Reviewed on Jul 18, 2026.

Capabilities (as declared by the maintainer): tool calling

Run it

Runtime completeness (Q4_K_M torrent): llama.cpp ✅ Ollama – vision sidecar –

  • Ollama — runs the GGUF directly; no Modelfile bundled
  • vision sidecar — not a vision model

Context / KV 8,192 tokens · FP16 set above the quant table

Generic commands (no rig set). GPU-offload values assume the model fits on your GPU — set your rig for values tuned to your hardware.

Start the server
llama-server -m Phi-4-mini-instruct-Q4_K_M.gguf -c 8192 -ngl 999

Use llama-cli in place of llama-server for a one-shot prompt.

Save as Modelfile next to the GGUF (Modelfile)
FROM ./Phi-4-mini-instruct-Q4_K_M.gguf
PARAMETER num_ctx 8192
PARAMETER num_gpu 999
PARAMETER stop "<|endoftext|>"
PARAMETER stop "<|end|>"
# Chat template: Ollama uses the template embedded in the GGUF (no TEMPLATE directive needed).
Create
ollama create microsoft-phi-4-mini-instruct -f Modelfile
Run
ollama run microsoft-phi-4-mini-instruct

GGUF is not a first-class vLLM format.

vLLM GGUF support is experimental and single-file only; prefer safetensors/GPTQ/AWQ for production. If you must, pass the .gguf path to `vllm serve` with --load-format gguf on a recent vLLM.

transformers does not load GGUF weights.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Load Phi-4-mini-instruct-Q4_K_M.gguf, set the context length to 8192 tokens. Set GPU offload to Max (all layers).

MLX runs MLX-format weights only (Apple Silicon). This quant is a GGUF build.

GGUF weights run under llama.cpp, Ollama or LM Studio.

Technical details

Chat template

{% for message in messages %}{% if message['role'] == 'system' and 'tools' in message and message['tools'] is not none %}{{ '<|' + message['role'] + '|>' + message['content'] + '<|tool|>' + message['tools'] + '<|/tool|>' + '<|end|>' }}{% else %}{{ '<|' + message['role'] + '|>' + message['content'] + '<|end|>' }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<|assistant|>' }}{% else %}{{ eos_token }}{% endif %}

Stop strings

<|endoftext|> <|end|>

Evidence & provenance

Source

Revision pin
cfbefacb99257ffa30c83adab238a50856ac3083
Manifest
Present

License

Name
mit
Commercial use
yes
Access
Open

How verification works →

File hashes (SHA-256)

  • phi-4-mini-instruct-q4-k-m/LICENSE 7df20dcdf9197e9945c14858d41c60f11b52b93e5b69e2b63416b874d598d322
  • phi-4-mini-instruct-q4-k-m/Phi-4-mini-instruct-Q4_K_M.gguf 88c00229914083cd112853aab84ed51b87bdf6b9ce42f532d8c85c7c63b1730a
  • phi-4-mini-instruct-q4-k-m/README.md 60aca40771f3c5eda04387117e45ba9c32f9941369afffc466cc9e0b7dfc789b
  • phi-4-mini-instruct-q8-0/LICENSE 7df20dcdf9197e9945c14858d41c60f11b52b93e5b69e2b63416b874d598d322
  • phi-4-mini-instruct-q8-0/README.md 60aca40771f3c5eda04387117e45ba9c32f9941369afffc466cc9e0b7dfc789b
  • phi-4-mini-instruct-q8-0/microsoft_Phi-4-mini-instruct-Q8_0.gguf a12f242c4ee379b9da91673e5d78b30bfacfe4fd86a0b2259d2ecad5d93cb6c7

Explore further

Get an email when a better quant fits your rig.

Set your rig once; we'll alert you when a new or better-fitting build lands.

Set your rig

Performance reports

Real-world throughput reported by the community (and scraped sources).

Community

Reviews, sampler presets and community runtime reports. Be the first to contribute.

Reviews (0)

Log in to write a structured review of this model.

No reviews yet.

Sampler presets

Log in to share a sampler preset or vote on presets.

No presets yet.

Community runtime reports

Unofficial, community-submitted "it loads for me" reports. These are not the official verified-working badge — an admin reviews reports before anything is marked officially verified.

Log in to report whether a quant loads in your runtime.

No community reports yet.

selected to compare · pick at least 2