Image-Text-to-Text
MLX
Safetensors
English
phi4mm
apple-silicon
vision-language-model
multimodal
phi-4
quantized
4bit
siglip
document-understanding
chart-understanding
ocr
conversational
Eval Results (legacy)
Instructions to use Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit") config = load_config("Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit"
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 Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit
Run Hermes
hermes
- OpenClaw new
How to use Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Ferox-AI/Phi-4-multimodal-instruct-mlx-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Add 4-bit MLX conversion of Phi-4-multimodal-instruct
Browse files
README.md
CHANGED
|
@@ -145,7 +145,7 @@ pip install mlx-vlm>=0.1.0 mlx>=0.22.0
|
|
| 145 |
|
| 146 |
## Benchmark Results
|
| 147 |
|
| 148 |
-
|
| 149 |
|
| 150 |
| Benchmark | This Model (4-bit) | bf16 | Microsoft FP16 (full dataset) | Metric |
|
| 151 |
|-----------|:------------------:|:----:|:-----------------------------:|--------|
|
|
@@ -166,7 +166,7 @@ Across all benchmarks, 4-bit quantization produces a mean accuracy delta of −2
|
|
| 166 |
|
| 167 |
### Note on MMMU
|
| 168 |
|
| 169 |
-
The MMMU scores (24.0% 4-bit, 31.0% bf16)
|
| 170 |
|
| 171 |
## Architecture
|
| 172 |
|
|
@@ -190,7 +190,7 @@ Weights are converted from `microsoft/Phi-4-multimodal-instruct` using a determi
|
|
| 190 |
5. Quantize backbone to 4-bit (SigLIP excluded)
|
| 191 |
6. Serialize as MLX safetensors
|
| 192 |
|
| 193 |
-
|
| 194 |
|
| 195 |
## Intended Use
|
| 196 |
|
|
@@ -220,10 +220,10 @@ This model is designed for **local, on-device vision-language inference** on App
|
|
| 220 |
If you use this model in your work, please cite:
|
| 221 |
|
| 222 |
```bibtex
|
| 223 |
-
@misc{
|
| 224 |
title={Phi-4-Multimodal-Instruct MLX Conversion},
|
| 225 |
author={Ferox AI},
|
| 226 |
-
year={
|
| 227 |
url={https://huggingface.co/ferox-ai/Phi-4-multimodal-instruct-mlx-4bit},
|
| 228 |
note={4-bit quantized MLX port of microsoft/Phi-4-multimodal-instruct}
|
| 229 |
}
|
|
|
|
| 145 |
|
| 146 |
## Benchmark Results
|
| 147 |
|
| 148 |
+
Evaluated with our internal evaluation harness on a single Apple Silicon device. Scores are computed on a 100-sample subset of each benchmark. Microsoft's reference scores are reported on the full dataset using PyTorch FP16 — direct comparison should account for both the precision difference and sample-size variance.
|
| 149 |
|
| 150 |
| Benchmark | This Model (4-bit) | bf16 | Microsoft FP16 (full dataset) | Metric |
|
| 151 |
|-----------|:------------------:|:----:|:-----------------------------:|--------|
|
|
|
|
| 166 |
|
| 167 |
### Note on MMMU
|
| 168 |
|
| 169 |
+
The 100-sample MMMU scores (24.0% 4-bit, 31.0% bf16) fall well below Microsoft's reported 55.1%. To isolate the cause, we ran a **full 900-sample MMMU validation** on the lossless bf16 variant and obtained **27.9%** — consistent with the subset, which confirms the gap is **not** caused by quantization or weight conversion. We were unable to reproduce Microsoft's 55.1% and attribute the difference to evaluation-harness and answer-extraction handling for MMMU's multiple-choice format (prompt formatting and option parsing), rather than to the model's underlying capability — which is better reflected by the document-, chart-, OCR-, and science-focused benchmarks above.
|
| 170 |
|
| 171 |
## Architecture
|
| 172 |
|
|
|
|
| 190 |
5. Quantize backbone to 4-bit (SigLIP excluded)
|
| 191 |
6. Serialize as MLX safetensors
|
| 192 |
|
| 193 |
+
The conversion and quantization pipeline is deterministic and fully reproducible from the base model.
|
| 194 |
|
| 195 |
## Intended Use
|
| 196 |
|
|
|
|
| 220 |
If you use this model in your work, please cite:
|
| 221 |
|
| 222 |
```bibtex
|
| 223 |
+
@misc{feroxai2026phi4mlx,
|
| 224 |
title={Phi-4-Multimodal-Instruct MLX Conversion},
|
| 225 |
author={Ferox AI},
|
| 226 |
+
year={2026},
|
| 227 |
url={https://huggingface.co/ferox-ai/Phi-4-multimodal-instruct-mlx-4bit},
|
| 228 |
note={4-bit quantized MLX port of microsoft/Phi-4-multimodal-instruct}
|
| 229 |
}
|