This repository contains GGUF quantized versions of the Phi-4 DeepSeek R1 Distilled model. These GGUF files are optimized for local inference using frameworks like llama.cpp and Ollama and LM Studio.
Model Information
Base Model: Phi-4 DeepSeek R1 Distilled
Parameters: 14.7B
Architecture: Phi3
Context Length: 16384 tokens
Training Data: Improved version of Phi-4, distilled with DeepSeek R1 Reasoning
License: MIT
Available Quantizations
File
Quantization
Size
Use Case
phi4-deepseek-r1-distilled-v8-q8_0.gguf
Q8_0 (8-bit)
15.6 GB
High quality, requires more RAM
phi4-deepseek-r1-distilled-v8-q3_k_m.gguf
Q3_K_M (3-bit)
7.97 GB
Lower RAM usage, slight quality tradeoff
Chat Template
This model uses the ChatML format with the following structure:
TEMPLATE """{{ if .System }}<|im_start|>system<|im_sep|>{{ .System }}<|im_end|>{{ end }}{{ range .Messages }}{{ if eq .Role "user" }}<|im_start|>user<|im_sep|>{{ .Content }}<|im_en>"""
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
Then create and use your model:
ollama create phi4-deepseek-r1 -f Modelfile
ollama run phi4-deepseek-r1
Usage with LMStudio
Use the model search option to look up the model from huggingface
Download and Load the Model
Set the chat parameters (top_p, top_k, repeat_penalty etc...)
Chat with the model (LMStudio directly detects the chat template so there is no manual configuration here unlike Ollama)
Usage with llama.cpp
bash
1# Download the model from Hugging Face2wget https://huggingface.co/ykarout/phi4-deepseek-r1-distilled-v8-GGUF/resolve/main/phi4-deepseek-r1-distilled-v8-q8_0.gguf
34# Run the model with llama.cpp5./main -m phi4-deepseek-r1-distilled-v8-q8_0.gguf -n 1024 --color -i -ins --chatml
Benchmarks & Performance Notes
Q8_0: Best quality, requires ~16GB VRAM for 4K context
Q3_K_M: Good quality with 60% size reduction, suitable for systems with 8GB+ VRAM