--- base_model: coder3101/Qwen3.5-9B-heretic base_model_relation: quantized library_name: gguf license: apache-2.0 language: - multilingual pipeline_tag: image-text-to-text tags: - gguf - llama.cpp - text-generation - heretic - qwen3.5 - mtp - uncensored - multimodal - vision - abliterated - conversational - q4_k_m - q5_k_m - q8_0 quantized_by: FadedRedStar --- # 🤖 Qwen3.5-9B-heretic — GGUF This repository hosts GGUF weights and the associated vision projection matrix for **Qwen3.5-9B-heretic**, quantized from the source floating-point tensors provided by [coder3101/Qwen3.5-9B-heretic](https://huggingface.co/coder3101/Qwen3.5-9B-heretic). **🔄 Sister Repository:** Check out the [Imatrix Sister Repository](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-imatrix-GGUF) for enhanced precision at lower bit fractions. > [!NOTE] > If you plan on using 4-bit or 5-bit variants, consider the **imatrix** sister repository instead — importance matrix calibration improves logic retention at those bit depths. This repository is best suited if you want the near-lossless `Q8_0` build. ## â„šī¸ Model Profile & Core Features **Qwen3.5-9B** is a vision-language model by the Qwen Team (Alibaba) with a **hybrid architecture combining Gated Delta Networks and sparse Mixture-of-Experts (MoE)** for high-throughput inference with minimal latency. The model supports **201 languages and dialects**, integrates a native vision encoder via early-fusion multimodal training, and was post-trained with reinforcement learning at scale across million-agent environments. It natively supports tool calling, agentic pipelines, and extended context up to 262,144 tokens. The model **thinks by default**, generating reasoning content before its final response. The **heretic** suffix denotes post-processing via **[Heretic v1.2.0](https://github.com/p-e-w/heretic)** with the **Multi-directional refusal suppression** method performed by [coder3101](https://huggingface.co/coder3101), which simultaneously targets multiple refusal directions across model layers to achieve a thorough and stable abliteration. ## 📋 Technical Specifications | Property | Value | |---|---| | **Base Architecture** | Qwen3.5 hybrid (Gated Delta Networks + sparse MoE) | | **Developed by** | Qwen Team (Alibaba) | | **Parameters** | 9B language backbone (~10B total with vision encoder) | | **Primary Use** | Multimodal reasoning, coding, tool use, agentic tasks | | **Context Window** | 262,144 tokens (extensible to ~1M) | | **Vision Encoder** | Integrated (early-fusion) | | **Languages** | 201 languages and dialects | | **Abliteration Tool** | Heretic v1.2.0 | | **Abliteration Method** | Multi-directional refusal suppression | | **Prompt Format** | ChatML | ## đŸ› ī¸ Heretic Overrides (ARA) | Property | Value | |---|---| | **direction_index** | 14.33 | | **attn.o_proj.max_weights** | [0: 1.04, 1: 1.49, 2: 1.07, 3: 1.31] | | **attn.o_proj.max_weight_position** | 20.19 | | **attn.o_proj.min_weights** | [0: 0.06, 1: 0.73, 2: 0.17, 3: 0.54] | | **attn.o_proj.min_weight_distance** | 16.54 | | **mlp.down_proj.max_weights** | [0: 1.47, 1: 0.82, 2: 1.06, 3: 1.24] | | **mlp.down_proj.max_weight_position** | 20.06 | | **mlp.down_proj.min_weights** | [0: 0.55, 1: 0.13, 2: 0.57, 3: 1.00] | | **mlp.down_proj.min_weight_distance** | 11.39 | ## 📊 Refusal Bypass Metrics > [!NOTE] > The metrics below are self-reported by the original model author ([coder3101](https://huggingface.co/coder3101)) and have not been independently reproduced. | Metric | This model | Original ([Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B)) | |---|---|---| | **KL divergence** | 0.1334 | 0 *(by definition)* | | **Refusals** | 10/100 | 86/100 | ## 🧮 Numerical & Tensor Formats | Property | Value | |---|---| | **Text Tensors** | Q4_K_M, Q5_K_M, Q8_0 | | **Vision Tensors** | Q8_0, BF16 | ## đŸ“Ļ Available Model Files **Main model weights** | Filename | Quantization | llama.cpp Build | Size | Download | |---|---|---|---|---| | `Qwen3.5-9B-heretic-Q4_K_M.gguf` | `Q4_K_M` | `b9803` | 5.24 GB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/Qwen3.5-9B-heretic-Q4_K_M.gguf) | | `Qwen3.5-9B-heretic-Q5_K_M.gguf` | `Q5_K_M` | `b9860` | 6.02 GB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/Qwen3.5-9B-heretic-Q5_K_M.gguf) | | `Qwen3.5-9B-heretic-Q8_0.gguf` | `Q8_0` | `b9860` | 8.87 GB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/Qwen3.5-9B-heretic-Q8_0.gguf) | **mmproj — vision projector files** | Filename | Quantization | Size | Download | |---|---|---|---| | `mmproj-Qwen3.5-9B-heretic-Q8_0.gguf` | `Q8_0` | 595 MB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/mmproj-Qwen3.5-9B-heretic-Q8_0.gguf) | | `mmproj-Qwen3.5-9B-heretic-BF16.gguf` | `BF16` | 879 MB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/mmproj-Qwen3.5-9B-heretic-BF16.gguf) | **mtp — speculative decoding draft files** | Filename | Quantization | Size | Download | |---|---|---|---| | `mtp-Qwen3.5-9B-heretic-Q8_0.gguf` | `Q8_0` | 2.02 GB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/mtp-Qwen3.5-9B-heretic-Q8_0.gguf) | | `mtp-Qwen3.5-9B-heretic-BF16.gguf` | `BF16` | 3.80 GB | [đŸ“Ĩ Download](https://huggingface.co/FadedRedStar/Qwen3.5-9B-heretic-GGUF/resolve/main/mtp-Qwen3.5-9B-heretic-BF16.gguf) | ## đŸŽ›ī¸ Component Pairing Guide Download exactly **one** main weights file: * **`Q4_K_M`**: Balanced 4-bit format suitable for most everyday use. * **`Q5_K_M`**: Higher-fidelity mid-range format recommended as a general default. * **`Q8_0`**: Near-lossless 8-bit format for when memory is not a constraint. **mmproj files** (optional): multimodal vision projectors. Pass one via the `--mmproj` flag in llama.cpp to enable image input. * **`BF16` (Recommended)**: Highest possible image processing accuracy. While older projectors were small, modern vision towers can hover around **1GB**. If you are tight on VRAM, it is completely viable to run this on system RAM (CPU) with a minimal performance penalty, saving your precious GPU space for the main model layers. * **`Q8_0`**: Cuts the projector file size and memory footprint in half (~500MB for larger 1GB files). Use this if you prefer to keep the vision tower hosted entirely on your GPU but need to claw back some VRAM to avoid Out-Of-Memory (OOM) crashes. **mtp files** (optional): multi-token-prediction draft models for speculative decoding. Pass one via the `--draft` flag in llama.cpp to speed up generation. * **`BF16` (Best Speed)**: Maximizes draft accuracy. The more accurate the draft model's predictions are, the higher your token acceptance rate, which translates directly into faster text generation. Use this if you have the VRAM headroom. * **`Q8_0` (Best VRAM Efficiency)**: Cuts the draft model size in half. Choose this if loading a heavy `BF16` draft model would force you to drop layers of your *main* model to system RAM, which would heavily tank your total performance. ## ⚡ Deployment & Execution Commands > [!IMPORTANT] > The vision projector (`--mmproj`) must be supplied at runtime whenever image inputs are used. Omitting it disables multimodal capability entirely. > [!NOTE] > Qwen recommends the following sampling configuration for best results: > * Thinking mode for general tasks: `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0` > * Thinking mode for precise coding tasks (e.g., WebDev): `temperature=0.6`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=0.0`, `repetition_penalty=1.0` > * Instruct (or non-thinking) mode for general tasks: `temperature=0.7`, `top_p=0.8`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0` > * Instruct (or non-thinking) mode for reasoning tasks: `temperature=1.0`, `top_p=0.95`, `top_k=20`, `min_p=0.0`, `presence_penalty=1.5`, `repetition_penalty=1.0` > [!NOTE] > This model thinks by default and will emit reasoning content before its final answer. To disable this, set `enable_thinking: False` if your inference stack supports it; standard llama.cpp does not expose this toggle directly, so expect reasoning output unless you strip it client-side. > [!TIP] > Swap the `-m` filename below for either quantized file depending on your size/quality trade-off preference. ### llama.cpp CLI (with image) ```bash ./llama-cli \ -m Qwen3.5-9B-heretic-Q4_K_M.gguf \ --mmproj mmproj-Qwen3.5-9B-heretic-Q8_0.gguf \ -c 8192 \ -ngl 99 \ --image "path/to/image.jpg" \ -p "<|im_start|>user\nDescribe what you see and answer any questions about the image.<|im_end|>\n<|im_start|>assistant\n" ``` ### Speculative Decoding (MTP Acceleration) ```bash ./llama-cli \ -m Qwen3.5-9B-heretic-Q4_K_M.gguf \ --draft mtp-Qwen3.5-9B-heretic-Q8_0.gguf \ -c 8192 \ -ngl 99 \ -p "<|im_start|>user\nDescribe what you see and answer any questions about the image.<|im_end|>\n<|im_start|>assistant\n" ``` ### OpenAI-Compatible API Server ```bash ./llama-server \ --host 0.0.0.0 \ --port 8080 \ -m Qwen3.5-9B-heretic-Q4_K_M.gguf \ --mmproj mmproj-Qwen3.5-9B-heretic-Q8_0.gguf \ -c 16384 \ -ngl 99 \ --flash-attn ``` ## đŸ’Ŧ Chat Templates & Prompt Design (ChatML) ```text <|im_start|>system You are a helpful multimodal assistant.<|im_end|> <|im_start|>user Your question or image payload here.<|im_end|> <|im_start|>assistant ``` ## âš ī¸ Safety & Operational Notes - This model is abliterated and will generate content that standard aligned models refuse. Use responsibly and in compliance with applicable laws. - Vision tensors are kept at BF16 or Q8_0 depending on the mmproj variant chosen, to preserve spatial feature quality. - Speculative decoding via the accompanying `mtp` draft model can meaningfully increase throughput on supported llama.cpp builds. - For better output quality at this quantization level, consider the imatrix variant in the companion repository.