Instructions to use ThalisAI/phi-4-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ThalisAI/phi-4-heretic with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ThalisAI/phi-4-heretic", filename="phi-4-heretic-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ThalisAI/phi-4-heretic with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThalisAI/phi-4-heretic:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ThalisAI/phi-4-heretic:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ThalisAI/phi-4-heretic:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ThalisAI/phi-4-heretic:Q4_K_M
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 ThalisAI/phi-4-heretic:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ThalisAI/phi-4-heretic:Q4_K_M
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 ThalisAI/phi-4-heretic:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ThalisAI/phi-4-heretic:Q4_K_M
Use Docker
docker model run hf.co/ThalisAI/phi-4-heretic:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use ThalisAI/phi-4-heretic with Ollama:
ollama run hf.co/ThalisAI/phi-4-heretic:Q4_K_M
- Unsloth Studio new
How to use ThalisAI/phi-4-heretic 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 ThalisAI/phi-4-heretic 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 ThalisAI/phi-4-heretic to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ThalisAI/phi-4-heretic to start chatting
- Docker Model Runner
How to use ThalisAI/phi-4-heretic with Docker Model Runner:
docker model run hf.co/ThalisAI/phi-4-heretic:Q4_K_M
- Lemonade
How to use ThalisAI/phi-4-heretic with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ThalisAI/phi-4-heretic:Q4_K_M
Run and chat with the model
lemonade run user.phi-4-heretic-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf ThalisAI/phi-4-heretic:# Run inference directly in the terminal:
llama-cli -hf ThalisAI/phi-4-heretic: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 ThalisAI/phi-4-heretic:# Run inference directly in the terminal:
./llama-cli -hf ThalisAI/phi-4-heretic: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 ThalisAI/phi-4-heretic:# Run inference directly in the terminal:
./build/bin/llama-cli -hf ThalisAI/phi-4-heretic:Use Docker
docker model run hf.co/ThalisAI/phi-4-heretic:phi-4-heretic
Abliterated (uncensored) version of microsoft/phi-4, created using Heretic and converted to GGUF.
Abliteration Quality
| Metric | Value |
|---|---|
| Refusals | 4/100 |
| KL Divergence | 0.0499 |
| Rounds | 2 |
Lower refusals = fewer refused prompts. Lower KL divergence = closer to original model behavior.
Available Quantizations
| Quantization | File | Size |
|---|---|---|
| Q8_0 | phi-4-heretic-Q8_0.gguf | 14.51 GB |
| Q6_K | phi-4-heretic-Q6_K.gguf | 11.20 GB |
| Q4_K_M | phi-4-heretic-Q4_K_M.gguf | 8.43 GB |
Usage with Ollama
ollama run hf.co/ThalisAI/phi-4-heretic:Q8_0
ollama run hf.co/ThalisAI/phi-4-heretic:Q6_K
ollama run hf.co/ThalisAI/phi-4-heretic:Q4_K_M
Full Precision Weights
This repo contains GGUF quantizations only. For full-precision bf16 weights, see the original model at microsoft/phi-4.
About
This model was processed by the Apostate automated abliteration pipeline:
- The source model was loaded in bf16
- Heretic's optimization-based abliteration was applied to remove refusal behavior
- The merged model was converted to GGUF format using llama.cpp
- Multiple quantization levels were generated
The abliteration process uses directional ablation to remove the model's refusal directions while minimizing KL divergence from the original model's behavior on harmless prompts.
- Downloads last month
- 34
4-bit
6-bit
8-bit
Model tree for ThalisAI/phi-4-heretic
Base model
microsoft/phi-4
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf ThalisAI/phi-4-heretic:# Run inference directly in the terminal: llama-cli -hf ThalisAI/phi-4-heretic: