Instructions to use ShayanCyan/phi4-multimodal-quantisized-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ShayanCyan/phi4-multimodal-quantisized-gguf", filename="phi4-mm-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "\"cats.jpg\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
Use Docker
docker model run hf.co/ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with Ollama:
ollama run hf.co/ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
- Unsloth Studio new
How to use ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ShayanCyan/phi4-multimodal-quantisized-gguf to start chatting
- Pi new
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf ShayanCyan/phi4-multimodal-quantisized-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": "ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-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 ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with Docker Model Runner:
docker model run hf.co/ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
- Lemonade
How to use ShayanCyan/phi4-multimodal-quantisized-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ShayanCyan/phi4-multimodal-quantisized-gguf:Q4_K_M
Run and chat with the model
lemonade run user.phi4-multimodal-quantisized-gguf-Q4_K_M
List all available models
lemonade list
Phi-4 Multimodal – Quantized GGUF + Omni Projector
This repository provides pre-converted GGUF weights for running microsoft/Phi-4-multimodal-instruct with a quantized language model and a multimodal projector (mmproj) on top of a specialized llama.cpp fork.
- GitHub (code + server setup): Ahmed-Shayan-Arsalan/Phi4-multimodal-Quantisized-Llama.cpp
The goal is to make Phi‑4 multimodal practical to run locally for text, vision, and audio tasks. All weights here are format conversions of the original Microsoft model and do not introduce new training data.
Files in This Repository
- phi4-mm-Q4_K_M.gguf: Quantized Phi‑4 multimodal language model (LLM).
- Quantization: Q4_K_M (4‑bit group-wise).
- Usage: Your main
-mmodel in llama.cpp.
- phi4-mm-omni.gguf: Multimodal projector (mmproj).
- Contents: Vision encoder (SigLIP/Navit-style) and audio Conformer encoder.
- Precision: Stored in F16 / F32 to preserve multimodal quality.
- Usage: Your
--mmprojor-mmmodel in llama.cpp.
- (Optional variants):
phi4-mm-f16.gguf(unquantized ref),phi4-mm-vision-q8.gguf(alternative quantization).
Intended Use
These GGUF files are designed for:
- Local inference with llama.cpp or compatible runtimes.
- Research and experimentation on multimodal reasoning.
- Prototyping agents that consume text, images, and audio.
Not intended for:
- Training from scratch.
- Any use violating the original Microsoft Phi-4 License.
How These GGUFs Were Created
1. Download the Base Model
git lfs install
git clone [https://huggingface.co/microsoft/Phi-4-multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct) phi-4-multimodal
# Phi-4-Multimodal Deployment Guide (llama.cpp)
## 2. Export the text LLM to GGUF
python convert_hf_to_gguf.py \
/path/to/phi-4-multimodal \
--outtype f16 \
--outfile phi4-mm-f16.gguf
## 3. Quantize the LLM
./build/bin/llama-quantize \
phi4-mm-f16.gguf \
phi4-mm-Q4_K_M.gguf \
Q4_K_M
## 4. Export the Multimodal Projector (mmproj)
To extract the vision and audio encoders into a separate GGUF:
python convert_hf_to_gguf.py \
/path/to/phi-4-multimodal \
--mmproj \
--outtype f16 \
--outfile phi4-mm-omni.gguf
Technical Note: A custom MmprojModel path in the conversion script maps tensors from model.embed_tokens_extend.* to the CLIP-style and Conformer layouts expected by the llama.cpp runtime.
---
## How to Use (llama.cpp)
### Server Mode (Recommended)
This exposes an OpenAI-style HTTP API supporting multimodal prompts.
./build/bin/llama-server \
-m /path/to/phi4-mm-Q4_K_M.gguf \
-mm /path/to/phi4-mm-omni.gguf \
--host 0.0.0.0 \
--port 8080
Vision: Send image_url parts or MTMD markers.
Audio: Send audio content according to the multimodal documentation.
### CLI Mode
./build/bin/llama-cli \
-m /path/to/phi4-mm-Q4_K_M.gguf \
-mm /path/to/phi4-mm-omni.gguf \
--color \
--prompt "Explain this image in detail:"
---
## Example Capabilities
- Text: Instruction following, reasoning, coding, multi‑turn chat.
- Vision: Visual question answering (VQA), captioning, document/chart understanding.
- Audio: Automatic speech recognition (ASR), translation (EN → FR), and summarization (where Conformer path is enabled).
## Limitations & Risks
- Hallucinations: May misinterpret content or hallucinate facts.
- Verification: Not suitable for medical, legal, or safety-critical decisions without human verification.
- Compliance: You must comply with the original Microsoft license.
## Acknowledgements
- Base model: microsoft/Phi-4-multimodal-instruct
- Serving stack: llama.cpp and its contributors.
- Special thanks to the Microsoft Phi-4 team for the underlying pretraining.
- Downloads last month
- 524
4-bit
Model tree for ShayanCyan/phi4-multimodal-quantisized-gguf
Base model
microsoft/Phi-4-multimodal-instruct