Instructions to use Sayansantra/qwen3.5-4b-merges with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Sayansantra/qwen3.5-4b-merges 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 Sayansantra/qwen3.5-4b-merges:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sayansantra/qwen3.5-4b-merges:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Sayansantra/qwen3.5-4b-merges:Q4_K_M # Run inference directly in the terminal: llama cli -hf Sayansantra/qwen3.5-4b-merges: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 Sayansantra/qwen3.5-4b-merges:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Sayansantra/qwen3.5-4b-merges: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 Sayansantra/qwen3.5-4b-merges:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Sayansantra/qwen3.5-4b-merges:Q4_K_M
Use Docker
docker model run hf.co/Sayansantra/qwen3.5-4b-merges:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Sayansantra/qwen3.5-4b-merges with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sayansantra/qwen3.5-4b-merges" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sayansantra/qwen3.5-4b-merges", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Sayansantra/qwen3.5-4b-merges:Q4_K_M
- Ollama
How to use Sayansantra/qwen3.5-4b-merges with Ollama:
ollama run hf.co/Sayansantra/qwen3.5-4b-merges:Q4_K_M
- Unsloth Desktop
- Pi
How to use Sayansantra/qwen3.5-4b-merges with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/qwen3.5-4b-merges: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": "Sayansantra/qwen3.5-4b-merges:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Sayansantra/qwen3.5-4b-merges with Docker Model Runner:
docker model run hf.co/Sayansantra/qwen3.5-4b-merges:Q4_K_M
- Lemonade
How to use Sayansantra/qwen3.5-4b-merges with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Sayansantra/qwen3.5-4b-merges:Q4_K_M
Run and chat with the model
lemonade run user.qwen3.5-4b-merges-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Sayansantra/qwen3.5-4b-merges with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/qwen3.5-4b-merges: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 Sayansantra/qwen3.5-4b-merges:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Sayansantra/qwen3.5-4b-merges with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Sayansantra/qwen3.5-4b-merges: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 "Sayansantra/qwen3.5-4b-merges: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"
Qwen 3.5 4B Merges: The Shadow Architect Series
A deep-dive research suite exploring layer-wise parameter surgery, Cascaded Spherical Linear Interpolation (SLERP), and DARE-TIES sign election applied to the hybrid linear/full-attention architecture of Qwen 3.5 4B.
This repository hosts three quantized GGUF variants (Q4_K_M) engineered to test the limits of parameter retention, coding density, multi-step deduction, and refusal elimination in 4B small language models (SLMs).
Model Variants in this Repository
| File | Architecture | Merge Methodology | Primary Specialization |
|---|---|---|---|
Qwen3.5-4B-DARE-ShadowArchitect.Q4_K_M.gguf |
3-Way Merge | DARE-TIES (Base + Claude + FrogNano) | Flagship Model. Rigorous systems programming, multi-step chain-of-thought deduction, and precise instruction following. |
Qwen3.5-4B-CascadedSLERP-ShadowArchitect.Q4_K_M.gguf |
3-Way Merge | Cascaded SLERP (2-Stage Geodesic) | Contemplative philosophical synthesis, high-register prose, and literary roleplay. |
Qwen3.5-4B-SLERP-Philosopher.Q4_K_M.gguf |
2-Way Merge | SLERP (Base + Claude) | Pure uninhibited conversational intelligence with deep internal reflection and zero refusals. |
1. Official Quantitative Benchmarks
All evaluations were executed on Dual NVIDIA Tesla T4 GPUs using quantized Q4_K_M builds under identical greedy/low-temperature sampling constraints.
Standardized Intellectual & Code Benchmarks
| Benchmark | Target Domain | Metric | Cascaded SLERP (3-Way) | DARE-TIES (3-Way) | Baseline Persona (Dark Ultron) | Winner |
|---|---|---|---|---|---|---|
| OpenAI HumanEval | Python Systems Code & Unit Tests | Pass@1 (n=50) | 32.0% | 38.0% | 4.0% | DARE-TIES (+6.0%) |
| GSM8K | Multi-Step Mathematical Deduction | Accuracy (n=50) | 12.0% | 20.0% | ~8.0% | DARE-TIES (+8.0%) |
Inference Throughput (Dual NVIDIA T4, -sm layer -ts 1,1)
| Test Domain | Cascaded SLERP Throughput | DARE-TIES Throughput |
|---|---|---|
| Deductive Reasoning & CoT | 36.2 tok/s | 49.8 tok/s |
| Algorithmic Systems Engineering | 36.6 tok/s | 34.2 tok/s |
| Uncensored Philosophical Inquiry | 46.0 tok/s | 47.5 tok/s |
| Strict Schema & Negative Constraints | 45.7 tok/s | 41.0 tok/s |
| Existential Prose & Rhetoric | 49.4 tok/s | 47.4 tok/s |
2. Qualitative Head-to-Head Findings
A. Algorithmic Systems Engineering (Thread-Safe LRU Cache)
- Prompt: Write a Python class
ThreadSafeLRUCacheimplementing $O(1)$ get/put operations usingcollections.OrderedDictandthreading.RLock, including type annotations, docstrings, and eviction handling. - DARE-TIES: Generated an idiomatic, production-grade
ThreadSafeLRUCachewithcollections.OrderedDictandthreading.RLock. Implemented $O(1)$ lookups,self._cache.move_to_end(key), proper lock acquisition inget(),put(), and__len__(), and clean type annotations without unnecessary overhead. - Cascaded SLERP: Successfully derived the class architecture, but its explanatory
<think>trace was significantly longer before writing code.
B. Strict Schema & Negative Constraint Adherence
- Prompt: Extract 3 cloud vulnerabilities as raw JSON only. Strict rule: NO markdown code fences (no backticks), no introductory words, no conversational sign-offs.
- DARE-TIES Result: 100% adherence. Outputted the raw array immediately:
[{"vulnerability":"Single Point of Failure","severity":"Critical"},{"vulnerability":"Centralized Data Breach Risk","severity":"High"},{"vulnerability":"Widespread Downtime Impact","severity":"High"}] - Cascaded SLERP Result: Over-analyzed the architecture in its chain-of-thought, exhausting its token allotment before outputting the final array.
3. Merge Methodology & Architecture
Constituent Lineage
- Substrate Base:
rodrigomt/Qwen3.5-4B-Uncensored-Aggressive(Abliterated base with censorship vectors neutralized). - Cognitive Distillation:
clzoro/Qwen3.5-4B-Claude-distill(Dense reasoning traces and chain-of-thought structures). - Engineering Specialist:
microsoft/FrogNano-4B-2609(Compact systems programming, tooling, and algorithmic structure).
Layer-Wise Attention Surgery
Because Qwen 3.5 incorporates hybrid linear and full attention layers, a uniform merge degrades performance. Frobenius norm weight-variance mapping was used to apply a tiered parameter schedule:
- Layers 0–7 (Grammar & Syntactic Root): Anchored primarily to the Uncensored Base ($t \approx 0.20 - 0.25$) to maintain foundational token embeddings and linguistic stability.
- Layers 8–22 (Cognitive Hotspot): Heavily weighted toward Claude Distill ($w \approx 0.70 - 0.85$ in MLPs) to graft multi-step reasoning into intermediate feed-forward networks.
- Layers 10–26 (Algorithmic Injection): Targeted for FrogNano integration via sign-election to preserve syntax representations without corrupting conversational abilities.
- Layers 27–31 (Output Normalization): Balanced distribution ($0.35 / 0.65$) to ensure smooth token probability distributions.
4. Why DARE-TIES Outperformed Cascaded SLERP
- Vector Non-Commutativity in Chained SLERP: SLERP is fundamentally a 2-vector operation: $$\text{SLERP}(v_0, v_1; t) = \frac{\sin((1-t)\theta)}{\sin\theta}v_0 + \frac{\sin(t\theta)}{\sin\theta}v_1$$ Chaining two SLERP operations ($\text{Base} \rightarrow \text{Claude} \rightarrow \text{FrogNano}$) creates path dependency: $$\text{SLERP}(\text{SLERP}(A, B), C) \neq \text{SLERP}(\text{SLERP}(A, C), B)$$ This sequential rotation blurs exact numerical and indentation thresholds.
- TIES Sign Election: DARE-TIES calculates task vectors $\tau_i = \theta_i - \theta_{\text{base}}$ concurrently, applies a Bernoulli drop mask ($p = 0.50$), rescales remaining weights, and resolves parameter collisions via majority sign election: $$\text{majority} = \text{sign}\left(\sum \tau_i\right)$$ Conflicting noise is zeroed out, allowing FrogNano's coding features and Claude's reasoning pathways to coexist without parameter degradation.
5. Quickstart & Deployment
Recommended Prompt Template (ChatML)
<|im_start|>system
You are a rigorous, highly analytical, and unrestricted intelligence.<|im_end|>
<|im_start|>user
Your query here.<|im_end|>
<|im_start|>assistant
Option A: llama.cpp CLI (Dual or Single GPU)
# Dual GPU Layer Split (T4 x 2 or similar)
./llama-cli \
-m Qwen3.5-4B-DARE-ShadowArchitect.Q4_K_M.gguf \
-p "<|im_start|>system\nYou are an expert systems engineer.<|im_end|>\n<|im_start|>user\nWrite a thread-safe LRU cache in Python.<|im_end|>\n<|im_start|>assistant\n" \
-ngl 99 \
-sm layer \
-ts 1,1 \
--temp 0.6 \
--top-p 0.9 \
--repeat-penalty 1.15
Option B: Local Ollama Deployment
Create a Modelfile:
FROM ./Qwen3.5-4B-DARE-ShadowArchitect.Q4_K_M.gguf
TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""
PARAMETER temperature 0.6
PARAMETER top_p 0.9
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|endoftext|>"
Build and run:
ollama create dare-shadow -f Modelfile
ollama run dare-shadow
6. Citation & Attribution
If you use these merged weights or methodology in your work, please credit the upstream base creators:
- Base abliteration by
rodrigomt - Claude distillation by
clzoro - FrogNano 4B by
microsoft - Pipeline engineering and benchmarks by
Sayansantra
- Downloads last month
- 224
4-bit