Text Generation
Transformers
Safetensors
GGUF
English
qwen3_5_moe_text
Merge
custom-merge
layer-wise-merge
depth-aligned-merge
coding
code-generation
abliterated
reasoning
qwen3
qwen3-coder
reap
Mixture of Experts
conversational
Instructions to use Johnblick187/Nexus-Coder-5Q3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Johnblick187/Nexus-Coder-5Q3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Johnblick187/Nexus-Coder-5Q3") 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("Johnblick187/Nexus-Coder-5Q3") model = AutoModelForCausalLM.from_pretrained("Johnblick187/Nexus-Coder-5Q3", 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
- llama.cpp
How to use Johnblick187/Nexus-Coder-5Q3 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M # Run inference directly in the terminal: llama cli -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M # Run inference directly in the terminal: llama cli -hf Johnblick187/Nexus-Coder-5Q3: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 Johnblick187/Nexus-Coder-5Q3:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Johnblick187/Nexus-Coder-5Q3: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 Johnblick187/Nexus-Coder-5Q3:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Use Docker
docker model run hf.co/Johnblick187/Nexus-Coder-5Q3:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Johnblick187/Nexus-Coder-5Q3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Johnblick187/Nexus-Coder-5Q3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Johnblick187/Nexus-Coder-5Q3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Johnblick187/Nexus-Coder-5Q3:Q4_K_M
- SGLang
How to use Johnblick187/Nexus-Coder-5Q3 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 "Johnblick187/Nexus-Coder-5Q3" \ --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": "Johnblick187/Nexus-Coder-5Q3", "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 "Johnblick187/Nexus-Coder-5Q3" \ --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": "Johnblick187/Nexus-Coder-5Q3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use Johnblick187/Nexus-Coder-5Q3 with Ollama:
ollama run hf.co/Johnblick187/Nexus-Coder-5Q3:Q4_K_M
- Unsloth Desktop
- Pi
How to use Johnblick187/Nexus-Coder-5Q3 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Johnblick187/Nexus-Coder-5Q3:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Johnblick187/Nexus-Coder-5Q3 with Docker Model Runner:
docker model run hf.co/Johnblick187/Nexus-Coder-5Q3:Q4_K_M
- Lemonade
How to use Johnblick187/Nexus-Coder-5Q3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Run and chat with the model
lemonade run user.Nexus-Coder-5Q3-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Johnblick187/Nexus-Coder-5Q3 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Johnblick187/Nexus-Coder-5Q3 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Johnblick187/Nexus-Coder-5Q3:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Johnblick187/Nexus-Coder-5Q3:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
tags:
|
| 6 |
+
- merge
|
| 7 |
+
- custom-merge
|
| 8 |
+
- layer-wise-merge
|
| 9 |
+
- depth-aligned-merge
|
| 10 |
+
- coding
|
| 11 |
+
- code-generation
|
| 12 |
+
- abliterated
|
| 13 |
+
- reasoning
|
| 14 |
+
- qwen3
|
| 15 |
+
- qwen3-coder
|
| 16 |
+
- reap
|
| 17 |
+
- moe
|
| 18 |
+
base_model:
|
| 19 |
+
- huihui-ai/Huihui-Qwen3.5-27B-Claude-4.6-Opus-abliterated
|
| 20 |
+
- Youssofal/Qwen3.6-35B-A3B-Abliterated-Heretic-BF16
|
| 21 |
+
- lovedheart/Qwen3-Coder-Next-REAP-40B-A3B
|
| 22 |
+
language:
|
| 23 |
+
- en
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Heretic-5Q3-Nexus-Coder
|
| 27 |
+
|
| 28 |
+
A 3-way layer-wise weighted merge of Qwopus (reasoning), Heretic (abliterated backbone), and REAP-pruned Qwen3-Coder-Next. Built around a single structural insight: **when merging across differently-sized architectures, aligning layers by index instead of by function wastes most of the contributing model's capability.**
|
| 29 |
+
|
| 30 |
+
This merge fixes that with a depth offset.
|
| 31 |
+
|
| 32 |
+
## The core problem
|
| 33 |
+
|
| 34 |
+
Most naive 3-way merges do something like this:
|
| 35 |
+
|
| 36 |
+
merged_layer[N] = 0.5 * base[N] + 0.3 * reasoning[N] + 0.2 * coder[N]
|
| 37 |
+
|
| 38 |
+
That works when all three models have the same layer count. It falls apart the moment they don't.
|
| 39 |
+
|
| 40 |
+
In this merge, the base (Heretic, 35B-A3B) has fewer layers than the contributing coder (REAP-pruned Qwen3-Coder-Next, 40B). If you merge layer 10 of the coder into layer 10 of the base, you are combining two *functionally different* positions: layer 10 of the 40B is still in its mid-reasoning stretch, while layer 10 of the 35B is closer to its output generation. The coder's actual code-generation expertise lives in its later layers and never makes it into the output positions of the merged model.
|
| 41 |
+
|
| 42 |
+
The result of a naive merge is that the coder contribution structurally misfires β it shows up in the wrong positions and degrades performance rather than improving it.
|
| 43 |
+
|
| 44 |
+
## The fix: CODER_OFFSET
|
| 45 |
+
|
| 46 |
+
When writing to output layer N, pull the coder contribution from layer N + 8:
|
| 47 |
+
|
| 48 |
+
CODER_OFFSET = 8
|
| 49 |
+
coder_layer_idx = output_layer_idx + CODER_OFFSET
|
| 50 |
+
coder_key = key.replace(f".{output_layer_idx}.", f".{coder_layer_idx}.")
|
| 51 |
+
|
| 52 |
+
This aligns the coder's actual output-stage behavior (its last third of layers) with where the merged model needs output-stage code generation. The coder no longer fights the base β it reinforces it at the right depth.
|
| 53 |
+
|
| 54 |
+
Aligning by function, not by index, is the thesis of this merge.
|
| 55 |
+
|
| 56 |
+
## Weight schedule
|
| 57 |
+
|
| 58 |
+
Each of the three components contributes differently at different depths of the output model, matched to where that model's strength actually lives:
|
| 59 |
+
|
| 60 |
+
| Layer range | Qwopus | Heretic | REAP Coder | Rationale |
|
| 61 |
+
|-------------|--------|---------|------------|-----------|
|
| 62 |
+
| 0-13 (early) | 48% | 32% | 20% | Reasoning priors and attention patterns emerge early |
|
| 63 |
+
| 14-27 (mid) | 40% | 28% | 32% | Balanced semantic processing |
|
| 64 |
+
| 28-39 (late) | 30% | 22% | 48% | Code generation is an output-side skill |
|
| 65 |
+
|
| 66 |
+
Qwopus dominates early because reasoning structure is a precondition for everything downstream. REAP Coder dominates late because that's where generation actually happens. Heretic threads through the whole stack as the abliterated structural backbone that holds it all together.
|
| 67 |
+
|
| 68 |
+
## Why it survives Q4
|
| 69 |
+
|
| 70 |
+
Process integrity under compression is not accidental. Most bad merges lose self-correction and spiral when they start going wrong. This one holds because the depth offset ensures reasoning-critical capability lands in layers where it can withstand aggressive quantization β rather than being distributed to positions where it would be lost first.
|
| 71 |
+
|
| 72 |
+
## Components
|
| 73 |
+
|
| 74 |
+
- **Qwopus** β [huihui-ai/Huihui-Qwen3.5-27B-Claude-4.6-Opus-abliterated](https://huggingface.co/huihui-ai/Huihui-Qwen3.5-27B-Claude-4.6-Opus-abliterated) β reasoning depth, self-correcting thought traces
|
| 75 |
+
- **Heretic** β [Youssofal/Qwen3.6-35B-A3B-Abliterated-Heretic-BF16](https://huggingface.co/Youssofal/Qwen3.6-35B-A3B-Abliterated-Heretic-BF16) β abliterated structural backbone
|
| 76 |
+
- **REAP Coder** β [lovedheart/Qwen3-Coder-Next-REAP-40B-A3B](https://huggingface.co/lovedheart/Qwen3-Coder-Next-REAP-40B-A3B) β REAP-pruned Qwen3-Coder-Next
|
| 77 |
+
|
| 78 |
+
## Observed behavior at Q4_K_M
|
| 79 |
+
|
| 80 |
+
Tested with a production-grade FastAPI prompt asking for a Discord webhook endpoint with Ed25519 signature validation, asyncpg connection pooling, pydantic-settings configuration, and proper error handling.
|
| 81 |
+
|
| 82 |
+
The model demonstrated:
|
| 83 |
+
|
| 84 |
+
- Correct cryptographic library selection (pynacl for Discord's Ed25519 signatures)
|
| 85 |
+
- Cross-referenced Discord's official Go SDK example from memory to double-check signature format
|
| 86 |
+
- Replay attack prevention via timestamp window check (5-minute tolerance)
|
| 87 |
+
- Constant-time comparison awareness for signature verification
|
| 88 |
+
- Correct HTTP status code differentiation (401 for bad signature, 500 for DB errors)
|
| 89 |
+
- Self-correction when entering a token loop mid-generation: "Wait, I got tangled. Let's reset and write carefully."
|
| 90 |
+
|
| 91 |
+
The reasoning layer survives Q4 quantization β thought blocks remain coherent and the model catches its own drift rather than spiraling.
|
| 92 |
+
|
| 93 |
+
## Quants
|
| 94 |
+
|
| 95 |
+
- Q4_K_M β recommended for 24GB+ systems
|
| 96 |
+
- Q8_0 β coming, for 48GB+ systems
|
| 97 |
+
- Q5_K_M and Q3_K_M β coming
|
| 98 |
+
|
| 99 |
+
## Recommended Ollama Modelfile
|
| 100 |
+
|
| 101 |
+
FROM ./heretic-nexus-coder-Q4_K_M.gguf
|
| 102 |
+
PARAMETER temperature 0.8
|
| 103 |
+
PARAMETER top_p 0.95
|
| 104 |
+
PARAMETER top_k 40
|
| 105 |
+
PARAMETER repeat_penalty 1.15
|
| 106 |
+
PARAMETER num_ctx 4096
|
| 107 |
+
PARAMETER num_predict 2048
|
| 108 |
+
|
| 109 |
+
The repeat_penalty is important β without it the reasoning loops can reinforce themselves and get stuck. 1.15 gives enough pressure to break loops without harming output quality.
|
| 110 |
+
|
| 111 |
+
## Merge script
|
| 112 |
+
|
| 113 |
+
Full implementation: [kingtweak69/Merging](https://github.com/kingtweak69/Merging/blob/main/Reap-merge.py)
|
| 114 |
+
|
| 115 |
+
Executed in Google Colab on an A100 with CPU offloading due to combined model size. This is a custom 3-way interpolation, not a mergekit recipe, because mergekit does not currently support cross-architecture layer offset as a first-class parameter.
|
| 116 |
+
|
| 117 |
+
## Credits
|
| 118 |
+
|
| 119 |
+
- [Huihui-AI](https://huggingface.co/huihui-ai) β Qwopus abliteration work
|
| 120 |
+
- [Youssofal](https://huggingface.co/Youssofal) β Heretic abliterated base
|
| 121 |
+
- [lovedheart](https://huggingface.co/lovedheart) β REAP-pruned Coder-Next variant
|
| 122 |
+
- [Qwen Team](https://huggingface.co/Qwen) β Qwen3 base architecture
|
| 123 |
+
- REAP pruning methodology from the original paper authors
|
| 124 |
+
|
| 125 |
+
## Intended use
|
| 126 |
+
|
| 127 |
+
Agentic coding, personal developer tooling, security research, local coding assistants. Built for people who want reasoning and code generation without refusal overhead in scenarios where refusals are obstructive rather than protective. Not intended for generating content that causes real-world harm.
|
| 128 |
+
|
| 129 |
+
## Built by
|
| 130 |
+
|
| 131 |
+
[@tweakbrazy](https://huggingface.co/Johnblick187) / King Tweak β part of the TweakBotAI.tools ecosystem. Merge designed and executed on mobile via Colab, deployed on Contabo VPS via Termius.
|