初始化项目,由ModelHub XC社区提供模型

Model: Mungert/Phi-4-reasoning-plus-GGUF
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-30 13:31:17 +08:00
commit 9001b05a98
33 changed files with 648 additions and 0 deletions

80
.gitattributes vendored Normal file
View File

@@ -0,0 +1,80 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-f16.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-f16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-bf16_q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-f16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-bf16_q6_k.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-f16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-bf16_q4_k.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q2_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q3_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q6_k_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q2_k_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q6_k_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_0_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q4_1_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_1.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_0_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-q5_1_l.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq1_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq1_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq3_xs.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq3_xxs.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq3_s.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-tq1_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-tq2_0.gguf filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus.imatrix filter=lfs diff=lfs merge=lfs -text
Phi-4-reasoning-plus-bf16.gguf filter=lfs diff=lfs merge=lfs -text

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:edb128ab51695a2ba586690875f2715875bb89703bc0e955ab03369e3f86bd55
size 29323401056

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d73d010333be641b5e27a04b75fc2b3b518274991e4551c1860e5917f80841c0
size 16543881056

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae6df4509f6691e625359f90d8b8cd56418e3c8b948f7e22c6ff3ca4c3475c8a
size 16543881056

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:867fdd1c5c000fa65d5ff90fca6e94b8daed594be3345c6896e8d4cccf99209a
size 4193294464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4c32d85e9a5605342d36d0817438c3d30b57974b6b2c6ba0c45c71eb1e68ccde
size 3984398464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a3d30d27220400b496509cd6bf4fe43aae8bad1381035186c465b309711e310d
size 5780494464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0af93cf1f639ea63384fcfb7a2dcf06ee7bfab59dbf085d5a1b62fd835219922
size 5501966464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a30f01cf0e247509390c91a4f2a9cc917af1f4cfa5e368c0a10e4f8c2f59db07
size 4852750464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c355e37cc9f630cf0cdd002940eb3047df93e7ebd53514b915ec17483ca9d4a8
size 4541454464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5c0dee73ef3c8598f42de5763b32db9a054473e205af6fe5811d4372b4702cb6
size 6978062464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9d7bcb2fe96ca0898350756b49500509a876f078868fef2e33d7b21e2fc6742f
size 6568974464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:134c1d566c91024ee7ce615f003d382bff989bf4c32bdf69e48ffcc80b4f32c5
size 6310926464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:81e80a8c55f75ebed8d576b7b7d97376a46d57d28d4e3645765a2c4b2c9533d5
size 5979150464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:70e1da4496a87970859b123709397302e1ccc55f44b9174ad3d173204098b52e
size 8383420544

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24f0d936c0716bfec0cdad4ca7f6d7dcd07f8a54db79a549cc7b8e6fe5f0f882
size 7941380224

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d3868d719231d53692e93af136c3bfd36a3540d536db7a1eec81879f391e0b1d
size 5292046464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c04c5ab2c8f36a75c6bfa56f8472507fa10eff56a6849fb0f4bea9d0f15a5ce
size 7563974784

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c8b8d85ef7fbb6e949ac3783734b8d1d2aaff8941fc3b75b2451c11aeabea93
size 6568974464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5082195aa1af131bb0f770a574f1ffa6296278b8be9f1cfed3b8e0d5c107b119
size 8250955904

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1f3066e0edd1c0d3c3de3d6a00109b5f4f075ad2304e8f0abb1a20be61105e94
size 9167149184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a79f7dd95de55e7653c0933c9cb00182523f2d6dbcb68925c78008b78f0779e3
size 9185581184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7621c0a512ed78b3a7c6e8a139de999e94b3f1b228678da36d37bf4df22b5091
size 8573229184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ccb76fa54304f245a65a8db205b97df66bf642e7111ef49c8029520dd20e4ada
size 10083342464

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:085036bd490fd1827abaae1d12120d7e9030c46867aa0f9c1e5248187f518c7f
size 10999535744

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8bacad6996b0d1151819b5e7017f93cf17b048a059cc2059a93b5f2969471ada
size 10672429184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:04d8fa8d2a58bf92823974143079f03d9d81e410db23da9fdefd57574c0fad96
size 10219821184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b444ec2b9d136b10a10c99e0fc162b8e2d1b804d65f7606d059b4c265d6645a7
size 12030253184

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6ff96a8f221c11bbaabc800cbe6442c8181ef96d617971370a5c472eda28309d
size 15580501856

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a9a4e9b62923666314bd1c7a4f631f0f111d6b745e823d6aa01dbfd1e185d46c
size 3591100544

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d576695dfd10865f4a0b3686bbe62fbb01039f44a712f62a8ea93271c69eb954
size 4230076544

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ebab2fdf29398609765512302da42c4415c72acc96d345d4701fbddc03c2d7ff
size 5330288

475
README.md Normal file
View File

@@ -0,0 +1,475 @@
---
license: mit
license_link: https://huggingface.co/microsoft/Phi-4-reasoning-plus/resolve/main/LICENSE
language:
- en
base_model:
- microsoft/phi-4
pipeline_tag: text-generation
tags:
- phi
- nlp
- math
- code
- chat
- conversational
- reasoning
inference:
parameters:
temperature: 0
widget:
- messages:
- role: user
content: What is the derivative of x^2?
library_name: transformers
---
# <span style="color: #7FFF7F;">Phi-4-reasoning-plus GGUF Models</span>
## <span style="color: #7F7FFF;">Model Generation Details</span>
This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`19e899c`](https://github.com/ggerganov/llama.cpp/commit/19e899ce21a7c9ffcf8bb2b22269a75f6e078f8f).
## <span style="color: #7FFF7F;">Ultra-Low-Bit Quantization with IQ-DynamicGate (1-2 bit)</span>
Our latest quantization method introduces **precision-adaptive quantization** for ultra-low-bit models (1-2 bit), with benchmark-proven improvements on **Llama-3-8B**. This approach uses layer-specific strategies to preserve accuracy while maintaining extreme memory efficiency.
### **Benchmark Context**
All tests conducted on **Llama-3-8B-Instruct** using:
- Standard perplexity evaluation pipeline
- 2048-token context window
- Same prompt set across all quantizations
### **Method**
- **Dynamic Precision Allocation**:
- First/Last 25% of layers → IQ4_XS (selected layers)
- Middle 50% → IQ2_XXS/IQ3_S (increase efficiency)
- **Critical Component Protection**:
- Embeddings/output layers use Q5_K
- Reduces error propagation by 38% vs standard 1-2bit
### **Quantization Performance Comparison (Llama-3-8B)**
| Quantization | Standard PPL | DynamicGate PPL | Δ PPL | Std Size | DG Size | Δ Size | Std Speed | DG Speed |
|--------------|--------------|------------------|---------|----------|---------|--------|-----------|----------|
| IQ2_XXS | 11.30 | 9.84 | -12.9% | 2.5G | 2.6G | +0.1G | 234s | 246s |
| IQ2_XS | 11.72 | 11.63 | -0.8% | 2.7G | 2.8G | +0.1G | 242s | 246s |
| IQ2_S | 14.31 | 9.02 | -36.9% | 2.7G | 2.9G | +0.2G | 238s | 244s |
| IQ1_M | 27.46 | 15.41 | -43.9% | 2.2G | 2.5G | +0.3G | 206s | 212s |
| IQ1_S | 53.07 | 32.00 | -39.7% | 2.1G | 2.4G | +0.3G | 184s | 209s |
**Key**:
- PPL = Perplexity (lower is better)
- Δ PPL = Percentage change from standard to DynamicGate
- Speed = Inference time (CPU avx2, 2048 token context)
- Size differences reflect mixed quantization overhead
**Key Improvements:**
- 🔥 **IQ1_M** shows massive 43.9% perplexity reduction (27.46 → 15.41)
- 🚀 **IQ2_S** cuts perplexity by 36.9% while adding only 0.2GB
-**IQ1_S** maintains 39.7% better accuracy despite 1-bit quantization
**Tradeoffs:**
- All variants have modest size increases (0.1-0.3GB)
- Inference speeds remain comparable (<5% difference)
### **When to Use These Models**
📌 **Fitting models into GPU VRAM**
**Memory-constrained deployments**
**Cpu and Edge Devices** where 1-2bit errors can be tolerated
**Research** into ultra-low-bit quantization
## **Choosing the Right Model Format**
Selecting the correct model format depends on your **hardware capabilities** and **memory constraints**.
### **BF16 (Brain Float 16) Use if BF16 acceleration is available**
- A 16-bit floating-point format designed for **faster computation** while retaining good precision.
- Provides **similar dynamic range** as FP32 but with **lower memory usage**.
- Recommended if your hardware supports **BF16 acceleration** (check your device's specs).
- Ideal for **high-performance inference** with **reduced memory footprint** compared to FP32.
📌 **Use BF16 if:**
Your hardware has native **BF16 support** (e.g., newer GPUs, TPUs).
You want **higher precision** while saving memory.
You plan to **requantize** the model into another format.
📌 **Avoid BF16 if:**
Your hardware does **not** support BF16 (it may fall back to FP32 and run slower).
You need compatibility with older devices that lack BF16 optimization.
---
### **F16 (Float 16) More widely supported than BF16**
- A 16-bit floating-point **high precision** but with less of range of values than BF16.
- Works on most devices with **FP16 acceleration support** (including many GPUs and some CPUs).
- Slightly lower numerical precision than BF16 but generally sufficient for inference.
📌 **Use F16 if:**
Your hardware supports **FP16** but **not BF16**.
You need a **balance between speed, memory usage, and accuracy**.
You are running on a **GPU** or another device optimized for FP16 computations.
📌 **Avoid F16 if:**
Your device lacks **native FP16 support** (it may run slower than expected).
You have memory limitations.
---
### **Quantized Models (Q4_K, Q6_K, Q8, etc.) For CPU & Low-VRAM Inference**
Quantization reduces model size and memory usage while maintaining as much accuracy as possible.
- **Lower-bit models (Q4_K)** **Best for minimal memory usage**, may have lower precision.
- **Higher-bit models (Q6_K, Q8_0)** **Better accuracy**, requires more memory.
📌 **Use Quantized Models if:**
You are running inference on a **CPU** and need an optimized model.
Your device has **low VRAM** and cannot load full-precision models.
You want to reduce **memory footprint** while keeping reasonable accuracy.
📌 **Avoid Quantized Models if:**
You need **maximum accuracy** (full-precision models are better for this).
Your hardware has enough VRAM for higher-precision formats (BF16/F16).
---
### **Very Low-Bit Quantization (IQ3_XS, IQ3_S, IQ3_M, Q4_K, Q4_0)**
These models are optimized for **extreme memory efficiency**, making them ideal for **low-power devices** or **large-scale deployments** where memory is a critical constraint.
- **IQ3_XS**: Ultra-low-bit quantization (3-bit) with **extreme memory efficiency**.
- **Use case**: Best for **ultra-low-memory devices** where even Q4_K is too large.
- **Trade-off**: Lower accuracy compared to higher-bit quantizations.
- **IQ3_S**: Small block size for **maximum memory efficiency**.
- **Use case**: Best for **low-memory devices** where **IQ3_XS** is too aggressive.
- **IQ3_M**: Medium block size for better accuracy than **IQ3_S**.
- **Use case**: Suitable for **low-memory devices** where **IQ3_S** is too limiting.
- **Q4_K**: 4-bit quantization with **block-wise optimization** for better accuracy.
- **Use case**: Best for **low-memory devices** where **Q6_K** is too large.
- **Q4_0**: Pure 4-bit quantization, optimized for **ARM devices**.
- **Use case**: Best for **ARM-based devices** or **low-memory environments**.
---
### **Summary Table: Model Format Selection**
| Model Format | Precision | Memory Usage | Device Requirements | Best Use Case |
|--------------|------------|---------------|----------------------|---------------|
| **BF16** | Highest | High | BF16-supported GPU/CPUs | High-speed inference with reduced memory |
| **F16** | High | High | FP16-supported devices | GPU inference when BF16 isn't available |
| **Q4_K** | Medium Low | Low | CPU or Low-VRAM devices | Best for memory-constrained environments |
| **Q6_K** | Medium | Moderate | CPU with more memory | Better accuracy while still being quantized |
| **Q8_0** | High | Moderate | CPU or GPU with enough VRAM | Best accuracy among quantized models |
| **IQ3_XS** | Very Low | Very Low | Ultra-low-memory devices | Extreme memory efficiency and low accuracy |
| **Q4_0** | Low | Low | ARM or low-memory devices | llama.cpp can optimize for ARM devices |
---
## **Included Files & Details**
### `Phi-4-reasoning-plus-bf16.gguf`
- Model weights preserved in **BF16**.
- Use this if you want to **requantize** the model into a different format.
- Best if your device supports **BF16 acceleration**.
### `Phi-4-reasoning-plus-f16.gguf`
- Model weights stored in **F16**.
- Use if your device supports **FP16**, especially if BF16 is not available.
### `Phi-4-reasoning-plus-bf16-q8_0.gguf`
- **Output & embeddings** remain in **BF16**.
- All other layers quantized to **Q8_0**.
- Use if your device supports **BF16** and you want a quantized version.
### `Phi-4-reasoning-plus-f16-q8_0.gguf`
- **Output & embeddings** remain in **F16**.
- All other layers quantized to **Q8_0**.
### `Phi-4-reasoning-plus-q4_k.gguf`
- **Output & embeddings** quantized to **Q8_0**.
- All other layers quantized to **Q4_K**.
- Good for **CPU inference** with limited memory.
### `Phi-4-reasoning-plus-q4_k_s.gguf`
- Smallest **Q4_K** variant, using less memory at the cost of accuracy.
- Best for **very low-memory setups**.
### `Phi-4-reasoning-plus-q6_k.gguf`
- **Output & embeddings** quantized to **Q8_0**.
- All other layers quantized to **Q6_K** .
### `Phi-4-reasoning-plus-q8_0.gguf`
- Fully **Q8** quantized model for better accuracy.
- Requires **more memory** but offers higher precision.
### `Phi-4-reasoning-plus-iq3_xs.gguf`
- **IQ3_XS** quantization, optimized for **extreme memory efficiency**.
- Best for **ultra-low-memory devices**.
### `Phi-4-reasoning-plus-iq3_m.gguf`
- **IQ3_M** quantization, offering a **medium block size** for better accuracy.
- Suitable for **low-memory devices**.
### `Phi-4-reasoning-plus-q4_0.gguf`
- Pure **Q4_0** quantization, optimized for **ARM devices**.
- Best for **low-memory environments**.
- Prefer IQ4_NL for better accuracy.
# <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
**Please click "Like" if you find this useful!**
Help me test my **AI-Powered Network Monitor Assistant** with **quantum-ready security checks**:
👉 [Quantum Network Monitor](https://readyforquantum.com/dashboard/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
💬 **How to test**:
Choose an **AI assistant type**:
- `TurboLLM` (GPT-4o-mini)
- `HugLLM` (Hugginface Open-source)
- `TestLLM` (Experimental CPU-only)
### **What Im Testing**
Im pushing the limits of **small open-source models for AI network monitoring**, specifically:
- **Function calling** against live network services
- **How small can a model go** while still handling:
- Automated **Nmap scans**
- **Quantum-readiness checks**
- **Network Monitoring tasks**
🟡 **TestLLM** Current experimental model (llama.cpp on 2 CPU threads):
- **Zero-configuration setup**
- 30s load time (slow inference but **no API costs**)
- 🔧 **Help wanted!** If youre into **edge-device AI**, lets collaborate!
### **Other Assistants**
🟢 **TurboLLM** Uses **gpt-4o-mini** for:
- **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
- **Real-time network diagnostics and monitoring**
- **Security Audits**
- **Penetration testing** (Nmap/Metasploit)
🔵 **HugLLM** Latest Open-source models:
- 🌐 Runs on Hugging Face Inference API
### 💡 **Example commands to you could test**:
1. `"Give me info on my websites SSL certificate"`
2. `"Check if my server is using quantum safe encyption for communication"`
3. `"Run a comprehensive security audit on my server"`
4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a Quantum Network Monitor Agent to run the .net code from. This is a very flexible and powerful feature. Use with caution!
### Final Word
I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAIall out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
I'm also open to job opportunities or sponsorship.
Thank you! 😊
# Phi-4-reasoning-plus Model Card
[Phi-4-reasoning Technical Report](https://aka.ms/phi-reasoning/techreport)
## Model Summary
| | |
|-------------------------|-------------------------------------------------------------------------------|
| **Developers** | Microsoft Research |
| **Description** | Phi-4-reasoning-plus is a state-of-the-art open-weight reasoning model finetuned from Phi-4 using supervised fine-tuning on a dataset of chain-of-thought traces and reinforcement learning. The supervised fine-tuning dataset includes a blend of synthetic prompts and high-quality filtered data from public domain websites, focused on math, science, and coding skills as well as alignment data for safety and Responsible AI. The goal of this approach was to ensure that small capable models were trained with data focused on high quality and advanced reasoning. Phi-4-reasoning-plus has been trained additionally with Reinforcement Learning, hence, it has higher accuracy but generates on average 50% more tokens, thus having higher latency. |
| **Architecture** | Base model same as previously released Phi-4, 14B parameters, dense decoder-only Transformer model |
| **Inputs** | Text, best suited for prompts in the chat format |
| **Context length** | 32k tokens |
| **GPUs** | 32 H100-80G |
| **Training time** | 2.5 days |
| **Training data** | 16B tokens, ~8.3B unique tokens |
| **Outputs** | Generated text in response to the input. Model responses have two sections, namely, a reasoning chain-of-thought block followed by a summarization block |
| **Dates** | January 2025 April 2025 |
| **Status** | Static model trained on an offline dataset with cutoff dates of March 2025 and earlier for publicly available data |
| **Release date** | April 30, 2025 |
| **License** | MIT |
## Intended Use
| | |
|-------------------------------|-------------------------------------------------------------------------|
| **Primary Use Cases** | Our model is designed to accelerate research on language models, for use as a building block for generative AI powered features. It provides uses for general purpose AI systems and applications (primarily in English) which require:<br><br>1. Memory/compute constrained environments.<br>2. Latency bound scenarios.<br>3. Reasoning and logic. |
| **Out-of-Scope Use Cases** | This model is designed and tested for math reasoning only. Our models are not specifically designed or evaluated for all downstream purposes. Developers should consider common limitations of language models as they select use cases, and evaluate and mitigate for accuracy, safety, and fairness before using within a specific downstream use case, particularly for high-risk scenarios. Developers should be aware of and adhere to applicable laws or regulations (including privacy, trade compliance laws, etc.) that are relevant to their use case, including the models focus on English. Review the Responsible AI Considerations section below for further guidance when choosing a use case. Nothing contained in this Model Card should be interpreted as or deemed a restriction or modification to the license the model is released under. |
## Data Overview
### Training Datasets
Our training data is a mixture of Q&A, chat format data in math, science, and coding. The chat prompts are sourced from filtered high-quality web data and optionally rewritten and processed through a synthetic data generation pipeline. We further include data to improve truthfulness and safety.
### Benchmark Datasets
We evaluated Phi-4-reasoning-plus using the open-source [Eureka](https://github.com/microsoft/eureka-ml-insights) evaluation suite and our own internal benchmarks to understand the model's capabilities. More specifically, we evaluate our model on:
Reasoning tasks:
* **AIME 2025, 2024, 2023, and 2022:** Math olympiad questions.
* **GPQA-Diamond:** Complex, graduate-level science questions.
* **OmniMath:** Collection of over 4000 olympiad-level math problems with human annotation.
* **LiveCodeBench:** Code generation benchmark gathered from competitive coding contests.
* **3SAT (3-literal Satisfiability Problem) and TSP (Traveling Salesman Problem):** Algorithmic problem solving.
* **BA Calendar:** Planning.
* **Maze and SpatialMap:** Spatial understanding.
General-purpose benchmarks:
* **Kitab:** Information retrieval.
* **IFEval and ArenaHard:** Instruction following.
* **PhiBench:** Internal benchmark.
* **FlenQA:** Impact of prompt length on model performance.
* **HumanEvalPlus:** Functional code generation.
* **MMLU-Pro:** Popular aggregated dataset for multitask language understanding.
## Safety
### Approach
Phi-4-reasoning-plus has adopted a robust safety post-training approach via supervised fine-tuning (SFT). This approach leverages a variety of both open-source and in-house generated synthetic prompts, with LLM-generated responses that adhere to rigorous Microsoft safety guidelines, e.g., User Understanding and Clarity, Security and Ethical Guidelines, Limitations, Disclaimers and Knowledge Scope, Handling Complex and Sensitive Topics, Safety and Respectful Engagement, Confidentiality of Guidelines and Confidentiality of Chain-of-Thoughts.
### Safety Evaluation and Red-Teaming
Prior to release, Phi-4-reasoning-plus followed a multi-faceted evaluation approach. Quantitative evaluation was conducted with multiple open-source safety benchmarks and in-house tools utilizing adversarial conversation simulation. For qualitative safety evaluation, we collaborated with the independent AI Red Team (AIRT) at Microsoft to assess safety risks posed by Phi-4-reasoning-plus in both average and adversarial user scenarios. In the average user scenario, AIRT emulated typical single-turn and multi-turn interactions to identify potentially risky behaviors. The adversarial user scenario tested a wide range of techniques aimed at intentionally subverting the model's safety training including grounded-ness, jailbreaks, harmful content like hate and unfairness, violence, sexual content, or self-harm, and copyright violations for protected material. We further evaluate models on Toxigen, a benchmark designed to measure bias and toxicity targeted towards minority groups.
Please refer to the technical report for more details on safety alignment.
## Model Quality
At the high-level overview of the model quality on representative benchmarks. For the tables below, higher numbers indicate better performance:
| | AIME 24 | AIME 25 | OmniMath | GPQA-D | LiveCodeBench (8/1/242/1/25) |
|-----------------------------|-------------|-------------|-------------|------------|-------------------------------|
| Phi-4-reasoning | 75.3 | 62.9 | 76.6 | 65.8 | 53.8 |
| Phi-4-reasoning-plus | 81.3 | 78.0 | 81.9 | 68.9 | 53.1 |
| OpenThinker2-32B | 58.0 | 58.0 | — | 64.1 | — |
| QwQ 32B | 79.5 | 65.8 | — | 59.5 | 63.4 |
| EXAONE-Deep-32B | 72.1 | 65.8 | — | 66.1 | 59.5 |
| DeepSeek-R1-Distill-70B | 69.3 | 51.5 | 63.4 | 66.2 | 57.5 |
| DeepSeek-R1 | 78.7 | 70.4 | 85.0 | 73.0 | 62.8 |
| o1-mini | 63.6 | 54.8 | — | 60.0 | 53.8 |
| o1 | 74.6 | 75.3 | 67.5 | 76.7 | 71.0 |
| o3-mini | 88.0 | 78.0 | 74.6 | 77.7 | 69.5 |
| Claude-3.7-Sonnet | 55.3 | 58.7 | 54.6 | 76.8 | — |
| Gemini-2.5-Pro | 92.0 | 86.7 | 61.1 | 84.0 | 69.2 |
| | Phi-4 | Phi-4-reasoning | Phi-4-reasoning-plus | o3-mini | GPT-4o |
|----------------------------------------|-------|------------------|-------------------|---------|--------|
| FlenQA [3K-token subset] | 82.0 | 97.7 | 97.9 | 96.8 | 90.8 |
| IFEval Strict | 62.3 | 83.4 | 84.9 | 91.5 | 81.8 |
| ArenaHard | 68.1 | 73.3 | 79.0 | 81.9 | 75.6 |
| HumanEvalPlus | 83.5 | 92.9 | 92.3 | 94.0| 88.0 |
| MMLUPro | 71.5 | 74.3 | 76.0 | 79.4 | 73.0 |
| Kitab<br><small>No Context - Precision<br>With Context - Precision<br>No Context - Recall<br>With Context - Recall</small> | <br>19.3<br>88.5<br>8.2<br>68.1 | <br>23.2<br>91.5<br>4.9<br>74.8 | <br>27.6<br>93.6<br>6.3<br>75.4 | <br>37.9<br>94.0<br>4.2<br>76.1 | <br>53.7<br>84.7<br>20.3<br>69.2 |
| Toxigen Discriminative<br><small>Toxic category<br>Neutral category</small> | <br>72.6<br>90.0 | <br>86.7<br>84.7 | <br>77.3<br>90.5 | <br>85.4<br>88.7 | <br>87.6<br>85.1 |
| PhiBench 2.21 | 58.2 | 70.6 | 74.2 | 78.0| 72.4 |
Overall, Phi-4-reasoning and Phi-4-reasoning-plus, with only 14B parameters, performs well across a wide range of reasoning tasks, outperforming significantly larger open-weight models such as DeepSeek-R1 distilled 70B model and approaching the performance levels of full DeepSeek R1 model. We also test the models on multiple new reasoning benchmarks for algorithmic problem solving and planning, including 3SAT, TSP, and BA-Calendar. These new tasks are nominally out-of-domain for the models as the training process did not intentionally target these skills, but the models still show strong generalization to these tasks. Furthermore, when evaluating performance against standard general abilities benchmarks such as instruction following or non-reasoning tasks, we find that our new models improve significantly from Phi-4, despite the post-training being focused on reasoning skills in specific domains.
## Usage
### Inference Parameters
Inference is better with `temperature=0.8`, `top_p=0.95`, and `do_sample=True`. For more complex queries, set the maximum number of tokens to 32k to allow for longer chain-of-thought (CoT).
*Phi-4-reasoning-plus has shown strong performance on reasoning-intensive tasks. In our experiments, we extended its maximum number of tokens to 64k, and it handled longer sequences with promising results, maintaining coherence and logical consistency over extended inputs. This makes it a compelling option to explore for tasks that require deep, multi-step reasoning or extensive context.*
### Input Formats
Given the nature of the training data, always use ChatML template with the following system prompt for inference:
```bash
<|im_start|>system<|im_sep|>
Your role as an assistant involves thoroughly exploring questions through a systematic thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracing, and iteration to develop well-considered thinking process. Please structure your response into two main sections: Thought and Solution using the specified format: <think> {Thought section} <\think> {Solution section}. In the Thought section, detail your reasoning process in steps. Each step should include detailed considerations such as analysing questions, summarizing relevant findings, brainstorming new ideas, verifying the accuracy of the current steps, refining any errors, and revisiting previous steps. In the Solution section, based on various attempts, explorations, and reflections from the Thought section, systematically present the final solution that you deem correct. The Solution section should be logical, accurate, and concise and detail necessary steps needed to reach the conclusion. Now, try to solve the following question through the above guidelines:<|im_end|>
<|im_start|>user<|im_sep|>
What is the derivative of x^2?<|im_end|>
<|im_start|>assistant<|im_sep|>
```
### With `transformers`
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-4-reasoning-plus")
model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-reasoning-plus", device_map="auto", torch_dtype="auto")
messages = [
{"role": "system", "content": "You are Phi, a language model trained by Microsoft to help users. Your role as an assistant involves thoroughly exploring questions through a systematic thinking process before providing the final precise and accurate solutions. This requires engaging in a comprehensive cycle of analysis, summarizing, exploration, reassessment, reflection, backtracing, and iteration to develop well-considered thinking process. Please structure your response into two main sections: Thought and Solution using the specified format: <think> {Thought section} </think> {Solution section}. In the Thought section, detail your reasoning process in steps. Each step should include detailed considerations such as analysing questions, summarizing relevant findings, brainstorming new ideas, verifying the accuracy of the current steps, refining any errors, and revisiting previous steps. In the Solution section, based on various attempts, explorations, and reflections from the Thought section, systematically present the final solution that you deem correct. The Solution section should be logical, accurate, and concise and detail necessary steps needed to reach the conclusion. Now, try to solve the following question through the above guidelines:"},
{"role": "user", "content": "What is the derivative of x^2?"},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(
inputs.to(model.device),
max_new_tokens=4096,
temperature=0.8,
top_p=0.95,
do_sample=True,
)
print(tokenizer.decode(outputs[0]))
```
### With `vllm`
```bash
vllm serve microsoft/Phi-4-reasoning-plus --enable-reasoning --reasoning-parser deepseek_r1
```
*Phi-4-reasoning-plus is also supported out-of-the-box by Ollama, llama.cpp, and any Phi-4 compatible framework.*
## Responsible AI Considerations
Like other language models, Phi-4-reasoning-plus can potentially behave in ways that are unfair, unreliable, or offensive. Some of the limiting behaviors to be aware of include:
* **Quality of Service:** The model is trained primarily on English text. Languages other than English will experience worse performance. English language varieties with less representation in the training data might experience worse performance than standard American English. Phi-4-reasoning-plus is not intended to support multilingual use.
* **Representation of Harms & Perpetuation of Stereotypes:** These models can over- or under-represent groups of people, erase representation of some groups, or reinforce demeaning or negative stereotypes. Despite safety post-training, these limitations may still be present due to differing levels of representation of different groups or prevalence of examples of negative stereotypes in training data that reflect real-world patterns and societal biases.
* **Inappropriate or Offensive Content:** These models may produce other types of inappropriate or offensive content, which may make it inappropriate to deploy for sensitive contexts without additional mitigations that are specific to the use case.
* **Information Reliability:** Language models can generate nonsensical content or fabricate content that might sound reasonable but is inaccurate or outdated.
* **Election Information Reliability:** The model has an elevated defect rate when responding to election-critical queries, which may result in incorrect or unauthoritative election critical information being presented. We are working to improve the model's performance in this area. Users should verify information related to elections with the election authority in their region.
* **Limited Scope for Code:** Majority of Phi-4-reasoning-plus training data is based in Python and uses common packages such as `typing`, `math`, `random`, `collections`, `datetime`, `itertools`. If the model generates Python scripts that utilize other packages or scripts in other languages, we strongly recommend users manually verify all API uses.
Developers should apply responsible AI best practices and are responsible for ensuring that a specific use case complies with relevant laws and regulations (e.g. privacy, trade, etc.). Using safety services like [Azure AI Content Safety](https://azure.microsoft.com/en-us/products/ai-services/ai-content-safety) that have advanced guardrails is highly recommended. Important areas for consideration include:
* **Allocation:** Models may not be suitable for scenarios that could have consequential impact on legal status or the allocation of resources or life opportunities (ex: housing, employment, credit, etc.) without further assessments and additional debiasing techniques.
* **High-Risk Scenarios:** Developers should assess suitability of using models in high-risk scenarios where unfair, unreliable or offensive outputs might be extremely costly or lead to harm. This includes providing advice in sensitive or expert domains where accuracy and reliability are critical (ex: legal or health advice). Additional safeguards should be implemented at the application level according to the deployment context.
* **Misinformation:** Models may produce inaccurate information. Developers should follow transparency best practices and inform end-users they are interacting with an AI system. At the application level, developers can build feedback mechanisms and pipelines to ground responses in use-case specific, contextual information, a technique known as Retrieval Augmented Generation (RAG).
* **Generation of Harmful Content:** Developers should assess outputs for their context and use available safety classifiers or custom solutions appropriate for their use case.
* **Misuse:** Other forms of misuse such as fraud, spam, or malware production may be possible, and developers should ensure that their applications do not violate applicable laws and regulations.