Instructions to use bveiseh/phi4-magpie-reasoning-v4-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bveiseh/phi4-magpie-reasoning-v4-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("bveiseh/phi4-magpie-reasoning-v4-gguf", dtype="auto") - PEFT
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with PEFT:
Task type is invalid.
- llama-cpp-python
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="bveiseh/phi4-magpie-reasoning-v4-gguf", filename="phi4-magpie-reasoning-fp16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf bveiseh/phi4-magpie-reasoning-v4-gguf # Run inference directly in the terminal: llama-cli -hf bveiseh/phi4-magpie-reasoning-v4-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf bveiseh/phi4-magpie-reasoning-v4-gguf # Run inference directly in the terminal: llama-cli -hf bveiseh/phi4-magpie-reasoning-v4-gguf
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 bveiseh/phi4-magpie-reasoning-v4-gguf # Run inference directly in the terminal: ./llama-cli -hf bveiseh/phi4-magpie-reasoning-v4-gguf
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 bveiseh/phi4-magpie-reasoning-v4-gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf bveiseh/phi4-magpie-reasoning-v4-gguf
Use Docker
docker model run hf.co/bveiseh/phi4-magpie-reasoning-v4-gguf
- LM Studio
- Jan
- vLLM
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bveiseh/phi4-magpie-reasoning-v4-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bveiseh/phi4-magpie-reasoning-v4-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/bveiseh/phi4-magpie-reasoning-v4-gguf
- SGLang
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bveiseh/phi4-magpie-reasoning-v4-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bveiseh/phi4-magpie-reasoning-v4-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bveiseh/phi4-magpie-reasoning-v4-gguf" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bveiseh/phi4-magpie-reasoning-v4-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with Ollama:
ollama run hf.co/bveiseh/phi4-magpie-reasoning-v4-gguf
- Unsloth Studio new
How to use bveiseh/phi4-magpie-reasoning-v4-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 bveiseh/phi4-magpie-reasoning-v4-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 bveiseh/phi4-magpie-reasoning-v4-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for bveiseh/phi4-magpie-reasoning-v4-gguf to start chatting
- Docker Model Runner
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with Docker Model Runner:
docker model run hf.co/bveiseh/phi4-magpie-reasoning-v4-gguf
- Lemonade
How to use bveiseh/phi4-magpie-reasoning-v4-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bveiseh/phi4-magpie-reasoning-v4-gguf
Run and chat with the model
lemonade run user.phi4-magpie-reasoning-v4-gguf-{{QUANT_TAG}}List all available models
lemonade list
Phi-4 Magpie Reasoning GGUF v4
This is a GGUF format version of the Phi-4 model fine-tuned on the Magpie dataset (v4).
Model Details
- Base Model: Microsoft Phi-4 (14B parameters)
- Available Formats:
- GGUF FP16 (full precision)
- GGUF Q8 (8-bit quantization)
- Fine-tuning: LoRA with merged weights
- Training Dataset: Magpie Reasoning Dataset
- Version: 4
Training Data
- 2,200 excellent quality examples
- 3,000 good quality examples
- Total training samples: 5,200
Evaluation Dataset
- 5 very hard + excellent quality examples
- 5 medium + excellent quality examples
- 5 very easy + excellent quality examples
Technical Details
LoRA Parameters:
- Rank (r): 24
- Alpha: 48
- Target Modules: q_proj, k_proj, v_proj, o_proj
- Dropout: 0.05
Training Configuration:
- Epochs: 5
- Learning Rate: 3e-5
- Batch Size: 1 with gradient accumulation steps of 16
- Optimizer: AdamW (Fused)
- Precision: BFloat16 during training
- Available Formats: FP16 and 8-bit quantized GGUF
Usage with llama.cpp
For CPU inference with the Q8 model:
main -m phi4-magpie-reasoning-q8.gguf -n 512 --repeat_penalty 1.1 --color -i -r User:
For GPU inference with the FP16 model:
main -m phi4-magpie-reasoning-fp16.gguf -n 512 --repeat_penalty 1.1 --color -i -r User: --n-gpu-layers 35
Model Sizes
- GGUF FP16 Format: ~28GB
- GGUF Q8 Format: ~14GB
- Original Model (14B parameters)
License
This model inherits the license terms from Microsoft Phi-4 and the Magpie dataset.
- Downloads last month
- 15
We're not able to determine the quantization variants.
Model tree for bveiseh/phi4-magpie-reasoning-v4-gguf
Base model
microsoft/phi-4