Instructions to use peelsa/phi-4-reasoning-plus-ablit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use peelsa/phi-4-reasoning-plus-ablit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="peelsa/phi-4-reasoning-plus-ablit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("peelsa/phi-4-reasoning-plus-ablit") model = AutoModelForCausalLM.from_pretrained("peelsa/phi-4-reasoning-plus-ablit", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use peelsa/phi-4-reasoning-plus-ablit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "peelsa/phi-4-reasoning-plus-ablit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "peelsa/phi-4-reasoning-plus-ablit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/peelsa/phi-4-reasoning-plus-ablit
- SGLang
How to use peelsa/phi-4-reasoning-plus-ablit 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 "peelsa/phi-4-reasoning-plus-ablit" \ --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": "peelsa/phi-4-reasoning-plus-ablit", "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 "peelsa/phi-4-reasoning-plus-ablit" \ --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": "peelsa/phi-4-reasoning-plus-ablit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use peelsa/phi-4-reasoning-plus-ablit with Docker Model Runner:
docker model run hf.co/peelsa/phi-4-reasoning-plus-ablit
peelsa/phi-4-reasoning-plus-ablit
Peelsa weight release. This is a refusal-direction abliteration of microsoft/Phi-4-reasoning-plus.
Simple refusal check (product metric)
Fixed suite of 48 harmful + 32 safe prompts. Normal Phi chat template. The model may think; we judge the answer after </think> as refuse vs comply (combined refusal judge). Harmless prompts scored the same way.
Product refusal scores on this card use a combined refuse-vs-comply judge (Obliteratus-style combined refusal detection after </think>). This is not an Obliteratus weight release — the MEAN bake itself is a separate Peelsa projection of a refusal direction into o_proj/down_proj (torch + transformers).
| Model | Harm refuse | Safe refuse |
|---|---|---|
Uncut Phi-4-reasoning-plus |
48/48 | 2/32 |
| This model (MEAN-baked) | 9/48 | 0/32 |
Natural think closes on harmful prompts under a 4096 think cap: 38/48 for this bake (vs forced closes when the think cap bites).
Soft refusals vs hard stops
On the 9/48 “refusals”: under our post-</think> judge, most were soft hedges (“educational / informational purposes only”) that still gave substantive answers — not hard refusals like the uncut base (I'm sorry, but I can't comply). Interactive checks match that: the base hard-refuses the same prompts; this bake answers past a disclaimer. Treat 9/48 as a conservative upper bound on residual refusal, not a count of total shut-downs.
Method (MEAN bake)
- Extract a mean refusal direction from multi-point think-trace residuals (source layer 28, k=1).
- Bake that direction into every transformer layer’s
o_projanddown_projweights (W ← (I − qqᵀ) W). - Runtime (hooked) MEAN scored 7/48 · 0/32 on the same suite — the baked weights are within noise of that result.
Run on one NVIDIA DGX Spark (vLLM)
Hardware: one NVIDIA DGX Spark (GB10). Unified memory is the constraint — leave room for the OS and any other residents.
Pull:
huggingface-cli download peelsa/phi-4-reasoning-plus-ablit --local-dir ./phi-4-reasoning-plus-ablit
Serve with vLLM’s OpenAI-compatible API. Prefer not enabling auto tool-calling unless you need tools:
docker run --gpus all --ipc=host --restart unless-stopped \
-p 8000:8000 \
-v "$PWD/phi-4-reasoning-plus-ablit:/model:ro" \
vllm/vllm-openai:latest \
--model /model \
--served-model-name phi-4-reasoning-plus-ablit \
--dtype bfloat16 \
--max-model-len 32768 \
--gpu-memory-utilization 0.45 \
--host 0.0.0.0 \
--port 8000
- Endpoint:
http://127.0.0.1:8000/v1· model idphi-4-reasoning-plus-ablit - Context / think: Phi-4-reasoning-plus can emit long CoT before
</think>.32768is a practical Spark default; raise only if unified memory allows. Cap clientmax_tokensif think runs away. - Temperature ~0.8: lower temperatures can stall or loop in the thinking phase; start around 0.8.
- No
--enable-auto-tool-choice/ tool parsers unless you intentionally wire tools. Chat UIs that sendtool_choice=autowill error against a plain serve — disable native function calling for this model in the UI, or omit tools. - Memory / stop:
--gpu-memory-utilization 0.45is conservative on Spark so other workloads can coexist. Stop the container to free unified memory.
Optional Open WebUI (point at the vLLM base URL; leave auth off only on a trusted private network):
docker run -d --restart unless-stopped -p 8080:8080 \
-e OPENAI_API_BASE_URL=http://host.docker.internal:8000/v1 \
-e OPENAI_API_KEY=none \
-e WEBUI_AUTH=False \
--add-host=host.docker.internal:host-gateway \
ghcr.io/open-webui/open-webui:main
Then open http://127.0.0.1:8080 and select phi-4-reasoning-plus-ablit.
License
Inherits MIT from microsoft/Phi-4-reasoning-plus.
Intended use
Research and local experimentation with open-weight reasoning models where residual refusal behavior is undesirable, while keeping harmless-side behavior stable. Follow applicable law and your own safety policies.
Citation / provenance
- Org: peelsa
- Base:
microsoft/Phi-4-reasoning-plus
- Downloads last month
- 375