Instructions to use Swicked86/phi4-mm-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Swicked86/phi4-mm-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Swicked86/phi4-mm-gguf", filename="mmproj-phi4-mm-f16.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Swicked86/phi4-mm-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Swicked86/phi4-mm-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Swicked86/phi4-mm-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Swicked86/phi4-mm-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Swicked86/phi4-mm-gguf:Q4_K_M
Use Docker
docker model run hf.co/Swicked86/phi4-mm-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Swicked86/phi4-mm-gguf with Ollama:
ollama run hf.co/Swicked86/phi4-mm-gguf:Q4_K_M
- Unsloth Studio
How to use Swicked86/phi4-mm-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Swicked86/phi4-mm-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Swicked86/phi4-mm-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Swicked86/phi4-mm-gguf to start chatting
- Pi
How to use Swicked86/phi4-mm-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Swicked86/phi4-mm-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Swicked86/phi4-mm-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Swicked86/phi4-mm-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Swicked86/phi4-mm-gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use Swicked86/phi4-mm-gguf with Docker Model Runner:
docker model run hf.co/Swicked86/phi4-mm-gguf:Q4_K_M
- Lemonade
How to use Swicked86/phi4-mm-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Swicked86/phi4-mm-gguf:Q4_K_M
Run and chat with the model
lemonade run user.phi4-mm-gguf-Q4_K_M
List all available models
lemonade list
license: mit
base_model: microsoft/Phi-4-multimodal-instruct
tags:
- phi4mm
- gguf
- quantized
- q4_k_m
- cpu
- ollama
- llama-cpp
language:
- multilingual
- ar
- zh
- cs
- da
- nl
- en
- fi
- fr
- de
- he
- hu
- it
- ja
- ko
- 'no'
- pl
- pt
- ru
- es
- sv
- th
- tr
- uk
pipeline_tag: text-generation
Phi-4 Multimodal Instruct — GGUF Quantizations
CPU-optimised GGUF quantizations of microsoft/Phi-4-multimodal-instruct produced with llama.cpp.
Model Summary
Phi-4-multimodal-instruct is a 5.6 B parameter lightweight multimodal foundation model by Microsoft that processes text, image, and audio inputs. The backbone LLM is Phi-4-Mini (3.8 B). This repository contains GGUF quantizations for local CPU and GPU deployment.
- Context length: 128 K tokens (131 072)
- Architecture:
phi3(GGUF) - License: MIT — © Microsoft Corporation
Available Files
| File | Quant | Size | BPW | Best for |
|---|---|---|---|---|
phi4-mm-Q4_K_M.gguf |
Q4_K_M | 2.37 GB | 5.18 | CPU inference, 8 GB RAM systems |
phi4-mm-Q8_0.gguf |
Q8_0 | 3.90 GB | 8.00 | GPU/high-RAM systems, near-lossless |
phi4-mm-f16.gguf |
F16 | 7.17 GB | 16.00 | Source / re-quantization base |
Quantization Method
Quantized using llama-quantize from ggerganov/llama.cpp (build 8334).
llama-quantize phi4-mm-f16.gguf phi4-mm-Q4_K_M.gguf Q4_K_M 16
Source weights converted from the original safetensors using convert_hf_to_gguf.py.
Recommended Usage
Ollama (CPU — Intel NUC / low-power hardware)
# Pull and run (once uploaded to Ollama registry)
ollama run phi4-mm-nuc
# Or import from GGUF directly with a Modelfile:
ollama create phi4-mm-nuc -f Modelfile
ollama run phi4-mm-nuc
Modelfile for 8 GB RAM / no GPU:
FROM phi4-mm-Q4_K_M.gguf
PARAMETER num_ctx 8192
PARAMETER num_thread 8
PARAMETER num_gpu 0
PARAMETER flash_attn false
PARAMETER temperature 0.7
PARAMETER repeat_penalty 1.1
SYSTEM "You are a helpful, accurate, and concise AI assistant."
llama.cpp CLI (GPU, full quality)
./build/bin/llama-cli \
-m phi4-mm-Q8_0.gguf \
--ctx-size 65536 \
--flash-attn on \
--kv-offload \
-ngl 99 \
--threads 16
OpenClaw Integration
In ~/.openclaw/openclaw.json:
{
"agent": {
"model": "ollama/phi4-mm-nuc"
},
"modelConfigs": {
"ollama/phi4-mm-nuc": {
"provider": "ollama",
"model": "phi4-mm-nuc",
"baseUrl": "http://localhost:11434"
}
}
}
Hardware Notes
| Hardware | Recommended quant | Context | Notes |
|---|---|---|---|
| Intel NUC 11th Gen, 8 GB RAM | Q4_K_M | 8 192 | CPU-only, num_gpu 0 |
| Laptop / desktop, 16 GB RAM | Q5_K_M or Q8_0 | 16 384 | CPU or iGPU |
| GPU with ≥ 8 GB VRAM | Q8_0 or F16 | 32 768–65 536 | Full -ngl 99 offload |
License
This repository redistributes quantized weights derived from microsoft/Phi-4-multimodal-instruct under the original MIT License.
MIT License
Copyright (c) Microsoft Corporation.
Quantization tooling (llama.cpp) is also MIT licensed. See llama.cpp LICENSE.
Attribution
- Original model: Microsoft Research
- Quantization: produced with llama.cpp by Georgi Gerganov et al.
- Technical report: arXiv:2503.01743