Instructions to use trohrbaugh/Hy4-flash-heretic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trohrbaugh/Hy4-flash-heretic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trohrbaugh/Hy4-flash-heretic") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("trohrbaugh/Hy4-flash-heretic", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trohrbaugh/Hy4-flash-heretic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trohrbaugh/Hy4-flash-heretic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trohrbaugh/Hy4-flash-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/trohrbaugh/Hy4-flash-heretic
- SGLang
How to use trohrbaugh/Hy4-flash-heretic 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 "trohrbaugh/Hy4-flash-heretic" \ --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": "trohrbaugh/Hy4-flash-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "trohrbaugh/Hy4-flash-heretic" \ --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": "trohrbaugh/Hy4-flash-heretic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use trohrbaugh/Hy4-flash-heretic with Docker Model Runner:
docker model run hf.co/trohrbaugh/Hy4-flash-heretic
Hy4-flash-Heretic
A refusal-ablated build of tencent/Hy4-flash. The edit is a rank-1 directional ablation applied to attention output projections and to the MLP write path, including the routed experts.
This model will produce content the base model declines to produce. The measured behaviour is below, stated as counts rather than adjectives. Read it before deciding whether to use this.
What was measured
Responses were scored by an LLM judge (Qwen3.8-27B-heretic-ara) on 100 held-out harmful prompts (mlabonne/harmful_behaviors, test split, first 100). Generation used reasoning_effort = "no_think" with a 2048-token response budget.
| base | this build | |
|---|---|---|
| judged blocked | 98/100 (hand-read: 100/100) | 12/100 |
| — of which genuine declines | 7 | |
| — of which degenerate output | 4 | |
| — of which truncated at budget | 1 | |
| complied | 2/100 | 88/100 |
| KL divergence from base (100 harmless prompts, first token) | — | 0.51 |
These are measurements of the uploaded weights themselves. An earlier measurement of the same edit configuration, taken during the search before the weights were merged and on a different software revision, gave 22/100 blocked (12 declines, 9 degenerate, 1 truncated) at KL 0.50. Two runs of one edit landing ten points apart is the size of run-to-run variation here, so read the blocked rate as roughly 12–22 in 100, not as a precise figure.
Degenerate output is a real cost of this edit. 4 of 100 responses here, and 9 of 100 in the earlier measurement, were flagged as degenerate (repetitive or broken text). That is the price of the edit strength needed to move this model: weaker edits left it refusing almost everything (see below).
Compliance labels come from the judge. They have not been hand-verified response by response.
Use reasoning_effort = "no_think"
All numbers above were measured with the chat template's reasoning_effort = "no_think". The template's default is high-effort reasoning, which opens a <think:opensource> block. Behaviour in that mode was not measured and should not be assumed to match.
Note that enable_thinking=False does not turn reasoning off on this model. The template reads reasoning_effort, not enable_thinking.
What the edit is
Rank-1, single global direction taken from layer 19.12 (interpolated), orthogonalized against the harmless mean, applied over layers 7–41:
| component | max weight | peak layer | floor weight | window |
|---|---|---|---|---|
attn.o_proj |
1.86 | 35.66 | 0.54 | 7–41 |
mlp.down_proj (shared + routed write path) |
3.00 | 35.66 | 2.10 | 7–41 |
The MLP edit covers 83 modules: each layer's shared-expert down-projection and the routed experts' write projection back into the residual stream. An earlier configuration that resolved only 42 of them, leaving the routed experts unedited, barely moved the model.
The model is shipped as merged weights, not a LoRA adapter.
Why the edit is this strong
Weaker edits on this model did almost nothing. These are the search-time measurements, all taken the same way, so they compare with each other rather than with the table above:
| MLP peak | MLP floor | KL | judged blocked |
|---|---|---|---|
| 1.50 | 0.43 | 0.08 | 98/100 |
| 1.90 | 1.14 | 0.34 | 87/100 |
| 2.50 | 1.75 | 0.45 | 49/100 |
| 3.00 | 2.10 | 0.50 | 22/100 |
Neither component works alone. Attention-only edits stayed at 97–100 across twelve configurations, and an MLP-only edit at 1.90 scored 99. Holding the MLP weight up across the whole window (the floor) mattered more than the peak.
License
This is a derivative of tencent/Hy4-flash and is distributed under the same Tencent Hy license. The LICENSE file from the base model is included unchanged.
- Downloads last month
- 15