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

Model: Mungert/Phi-4-mini-instruct.gguf
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-07-13 04:58:05 +08:00
commit a0a99f5549
29 changed files with 385 additions and 0 deletions

74
.gitattributes vendored Normal file
View File

@@ -0,0 +1,74 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bin.* filter=lfs diff=lfs merge=lfs -text
*.bz2 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
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack 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
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
saved_model/**/* 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
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zstandard filter=lfs diff=lfs merge=lfs -text
*.tfevents* filter=lfs diff=lfs merge=lfs -text
*.db* filter=lfs diff=lfs merge=lfs -text
*.ark* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ggml filter=lfs diff=lfs merge=lfs -text
*.llamafile* filter=lfs diff=lfs merge=lfs -text
*.pt2 filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.wasm 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-mini-q4_1.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q3_k_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq2_s.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-bf16.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq3_s.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-bf16-q8.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q4_0.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq2_xs.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-tq2_0.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q4_k_s.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q3_k_s.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-tq1_0.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq2_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q8.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q6_k_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q5_k_s.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq3_xs.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq4_nl.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-f16-q8.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq4_xs.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q2_k_s.guuf filter=lfs diff=lfs merge=lfs -text
phi-4-mini-q2_k_m.gguf filter=lfs diff=lfs merge=lfs -text
phi-4-mini.imatrix filter=lfs diff=lfs merge=lfs -text
phi-4-mini-iq3_m.gguf filter=lfs diff=lfs merge=lfs -text

232
README.md Normal file
View File

@@ -0,0 +1,232 @@
---
license: mit
base_model:
- microsoft/Phi-4-mini-instruct
pipeline_tag: text-generation
tags:
- Demo
- Phi 4 Mini
- multilingual
- reasoning
- code generation
- function calling
- chat completion
- memory efficient
- low latency
- 128k context
---
# Model Summary
Phi-4-mini-instruct is a lightweight open model built upon synthetic data and filtered publicly available websites - with a focus on high-quality, reasoning dense data. The model belongs to the Phi-4 model family and supports 128K token context length. The model underwent an enhancement process, incorporating both supervised fine-tuning and direct preference optimization to support precise instruction adherence and robust safety measures.
📰 [Phi-4-mini Microsoft Blog](https://aka.ms/phi4-feb2025) <br>
📖 [Phi-4-mini Technical Report](https://aka.ms/phi-4-multimodal/techreport) <br>
👩‍🍳 [Phi Cookbook](https://github.com/microsoft/PhiCookBook) <br>
🏡 [Phi Portal](https://azure.microsoft.com/en-us/products/phi) <br>
🖥️ Try It [Azure](https://aka.ms/phi-4-mini/azure), [Huggingface](https://huggingface.co/spaces/microsoft/phi-4-mini) <br>
**Phi-4**:
[[mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct) | [onnx](https://huggingface.co/microsoft/Phi-4-mini-instruct-onnx)];
[multimodal-instruct](https://huggingface.co/microsoft/Phi-4-multimodal-instruct); [gguf](https://huggingface.co/Mungert/Phi-4-mini-instruct.gguf)
## Usage
### Chat format
This format is used for general conversation and instructions:
```yaml
<|system|>Insert System Message<|end|><|user|>Insert User Message<|end|><|assistant|>
```
### Tool-Enabled Function-Calling Format
This format is used when the user wants the model to provide function calls based on the given tools. The user should define the available tools in the system prompt, wrapped by `<|tool|>` and `<|/tool|>` tokens. The tools must be specified in JSON format using a structured JSON dump.
```plaintext
<|system|>
You are a helpful assistant with some tools.
<|tool|>
[
{
"name": "get_weather_updates",
"description": "Fetches weather updates for a given city using the RapidAPI Weather API.",
"parameters": {
"city": {
"description": "The name of the city for which to retrieve weather information.",
"type": "str",
"default": "London"
}
}
}
]
<|/tool|>
<|end|>
<|user|>
What is the weather like in Paris today?
<|end|>
<|assistant|>
```
---
# <span style="color: #FF7F7F;">Unsloth Bug Fixes for Better Performance</span>
***Update (March 1, 2025)***
Applying all [Unsloth](https://huggingface.co/unsloth) fixes improved inference stability.
| # | Fix | Reason for Fix |
|----|--------------------------------------------------|------------------------------------------------|
| 1 | Changed the padding tag | The old padding tag could cause training issues. |
| 2 | Removed `{% else %}{{ eos_token }}` from chat template | Prevented extra EOS tokens that could degrade inference performance. |
| 3 | Replaced EOS with <\|end\|> | Avoided potential inference glitches. |
| 4 | Changed `unk_token` from EOS to `<60>` | Stopped unknown tokens from breaking inference. |
# <span id="testllm" style="color: #7F7FFF;">🚀 Phi 4 Mini Function Calling Test!</span>
If you have a minute, Id really appreciate it if you could test my Phi-4-Mini-Instruct Demo at 👉 [Quantum Network Monitor](https://readyforquantum.com).
💬 Click the **chat icon** (bottom right of the main and dashboard pages) . Then toggle between the LLM Types Phi-4-Mini-Instruct is called TestLLM : TurboLLM -> FreeLLM -> TestLLM.
### What I'm Testing
I'm experimenting with **function calling** against my network monitoring service. Using small open source models. I am into the question "How small can it go and still function".
🟡 **TestLLM** Runs **Phi-4-mini-instruct** using phi-4-mini-q4_0.gguf , llama.cpp on 6 threads of a Cpu VM (Should take about 15s to load. Inference speed is quite slow and it only processes one user prompt at a time—still working on scaling!). If you're curious, I'd be happy to share how it works! .
### The other Available AI Assistants
🟢 **TurboLLM** Uses **gpt-4o-mini** Fast! . Note: tokens are limited since OpenAI models are pricey, but you can [Login](https://readyforquantum.com) or [Download](https://readyforquantum.com/download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) the Quantum Network Monitor agent to get more tokens, Alternatively use the TestLLM .
🔵 **HugLLM** Runs **open-source Hugging Face models** Fast, Runs small models (≈8B) hence lower quality, Get 2x more tokens (subject to Hugging Face API availability)
# <span style="color: #7FFF7F;">Phi-4-mini-instruct GGUF Models</span>
## **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 devices 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 limtations.
---
### **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).
---
### **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 isnt available |
| **Q4_K** | Low | Very Low | CPU or Low-VRAM devices | Best for memory-constrained environments |
| **Q6_K** | Medium Low | Low | CPU with more memory | Better accuracy while still being quantized |
| **Q8** | Medium | Moderate | CPU or GPU with enough VRAM | Best accuracy among quantized models |
## **Included Files & Details**
### `phi-4-mini-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-mini-f16.gguf`
- Model weights stored in **F16**.
- Use if your device supports **FP16**, especially if BF16 is not available.
### `phi-4-mini-bf16-q8.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-mini-f16-q8.gguf`
- **Output & embeddings** remain in **F16**.
- All other layers quantized to **Q8_0**.
### `phi-4-mini-q4_k_l.gguf`
- **Output & embeddings** quantized to **Q8_0**.
- All other layers quantized to **Q4_K**.
- Good for **CPU inference** with limited memory.
### `phi-4-mini-q4_k_m.gguf`
- Similar to Q4_K.
- Another option for **low-memory CPU inference**.
### `phi-4-mini-q4_k_s.gguf`
- Smallest **Q4_K** variant, using less memory at the cost of accuracy.
- Best for **very low-memory setups**.
### `phi-4-mini-q6_k_l.gguf`
- **Output & embeddings** quantized to **Q8_0**.
- All other layers quantized to **Q6_K** .
### `phi-4-mini-q6_k_m.gguf`
- A mid-range **Q6_K** quantized model for balanced performance .
- Suitable for **CPU-based inference** with **moderate memory**.
### `phi-4-mini-q8.gguf`
- Fully **Q8** quantized model for better accuracy.
- Requires **more memory** but offers higher precision.
## Credits
Thanks [Bartowski](https://huggingface.co/bartowski) for imartix upload. And your guidance on quantization that has enabled me to produce these gguf file.
Thanks [Unsloth](https://huggingface.co/unsloth) for bug fixing many models.
Thanks for your support! 🙌

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}

3
phi-4-mini-bf16-q8.gguf Normal file
View File

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

3
phi-4-mini-bf16.gguf Normal file
View File

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

3
phi-4-mini-f16-q8.gguf Normal file
View File

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

3
phi-4-mini-iq2_m.gguf Normal file
View File

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

3
phi-4-mini-iq2_s.gguf Normal file
View File

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

3
phi-4-mini-iq2_xs.gguf Normal file
View File

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

3
phi-4-mini-iq3_m.gguf Normal file
View File

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

3
phi-4-mini-iq3_s.gguf Normal file
View File

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

3
phi-4-mini-iq3_xs.gguf Normal file
View File

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

3
phi-4-mini-iq4_nl.gguf Normal file
View File

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

3
phi-4-mini-iq4_xs.gguf Normal file
View File

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

3
phi-4-mini-q2_k_m.gguf Normal file
View File

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

3
phi-4-mini-q2_k_s.guuf Normal file
View File

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

3
phi-4-mini-q3_k_m.gguf Normal file
View File

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

3
phi-4-mini-q3_k_s.gguf Normal file
View File

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

3
phi-4-mini-q4_0.gguf Normal file
View File

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

3
phi-4-mini-q4_1.gguf Normal file
View File

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

3
phi-4-mini-q4_k_m.gguf Normal file
View File

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

3
phi-4-mini-q4_k_s.gguf Normal file
View File

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

3
phi-4-mini-q5_k_m.gguf Normal file
View File

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

3
phi-4-mini-q5_k_s.gguf Normal file
View File

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

3
phi-4-mini-q6_k_m.gguf Normal file
View File

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

3
phi-4-mini-q8.gguf Normal file
View File

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

3
phi-4-mini-tq1_0.gguf Normal file
View File

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

3
phi-4-mini-tq2_0.gguf Normal file
View File

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

3
phi-4-mini.imatrix Normal file
View File

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