Skip to main content

Model guide

Phi-4 Mini Instruct

Phi-4 Mini Instruct is a compact multilingual text assistant for instruction-following tasks under a smaller memory budget. It is not the separate Mini Reasoning checkpoint or a multimodal Phi model. Try structured extraction or a short code explanation, then check whether the answer obeys all of your constraints.

3.8BText chat131,072 token contextView the model card →

At a glance

Parameters
3.8B
Accepts
Text
Returns
Text
Published context limit
131,072 tokens
Model format
safetensors · GGUF
Software and download hosts
Ollama · MLX. Follow the exact setup below; this list does not establish support for every format, input type or software version.
Suggested compression
Q4_K_M
Model-weight download
Q4_K_M weights · 2.49 GBbartowski (community conversion)microsoft_Phi-4-mini-instruct-Q4_K_M.gguf
Languages
Arabic · Chinese · Czech · Danish · Dutch · English · Finnish · French · German · Hebrew · Hungarian · Italian · Japanese · Korean · Norwegian · Polish · Portuguese · Russian · Spanish · Swedish · Thai · Turkish · Ukrainian
License
MIT

Will it fit?

Phi-4 Mini Instruct · Q4_K_M download. Fit depends on your computer, the app you run it in and the conversation length you need.

Check on your computer

Best for

  • Extract known fields from a short multilingual note. If your app needs function calls, separately inspect the function name and arguments it receives.

Choose something else when

  • A correctly formatted text reply cannot verify that a connected tool ran.

First setup

Check a representative task

Check compact instruction following with a record whose missing field is deliberate.

Use only this note. Return a JSON object with exactly these keys: item, quantity, due_date, tracking_number. Use a string for item, an integer for quantity, an ISO YYYY-MM-DD string for due_date, and null for a missing tracking_number. Do not add Markdown or commentary.
Note: Order R-17 contains three replacement keyboards. Delivery is due on 12 November 2026. No tracking number has been issued.

Check the result: Parse the result as JSON. It should contain exactly the four requested keys, with item="replacement keyboards" (equivalent wording is acceptable), quantity=3 as a number, due_date="2026-11-12", and tracking_number=null. Reject extra prose, a quoted quantity or a fabricated tracking number.

Correct JSON in this exercise does not establish API-level structured-output enforcement or native tool calling.

This creates a 4,096-token copy of phi4-mini named phi-4-mini-instruct-short-context. Save the following as a file named Modelfile in your working folder:

FROM phi4-mini
PARAMETER num_ctx 4096

Then run these commands from that folder:

ollama pull phi4-mini
ollama create phi-4-mini-instruct-short-context -f ./Modelfile
ollama run phi-4-mini-instruct-short-context

Run the task check. While the model is loaded, run ollama ps in another terminal and check CONTEXT and PROCESSOR.

The recorded Ollama package is Q4_K_M: 2.49 GB of model weights. Use Ollama 0.40.18 or a supporting newer release. A Hugging Face GGUF or MLX checkpoint is a separate representation; choose the matching source and runner in the memory calculator.

See Ollama context settings and the Modelfile instructions.

Other models for this task