Text Generation
GGUF
qwen
qwen3.5
on-device
ios
mobile
thinking
hybrid-attention
deltanet
imatrix
conversational
Instructions to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF 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 jc-builds/Qwen3.5-9B-Q4_K_M-GGUF 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 jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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 jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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 jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
Use Docker
docker model run hf.co/jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jc-builds/Qwen3.5-9B-Q4_K_M-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jc-builds/Qwen3.5-9B-Q4_K_M-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
- Ollama
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with Ollama:
ollama run hf.co/jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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": "jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with Docker Model Runner:
docker model run hf.co/jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
- Lemonade
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-9B-Q4_K_M-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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 jc-builds/Qwen3.5-9B-Q4_K_M-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jc-builds/Qwen3.5-9B-Q4_K_M-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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 "jc-builds/Qwen3.5-9B-Q4_K_M-GGUF: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"
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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nl
|
| 17 |
+
- hi
|
| 18 |
+
tags:
|
| 19 |
+
- qwen
|
| 20 |
+
- qwen3.5
|
| 21 |
+
- gguf
|
| 22 |
+
- on-device
|
| 23 |
+
- ios
|
| 24 |
+
- mobile
|
| 25 |
+
- thinking
|
| 26 |
+
- hybrid-attention
|
| 27 |
+
- deltanet
|
| 28 |
+
model_name: Qwen3.5-9B Q4_K_M GGUF
|
| 29 |
+
base_model: Qwen/Qwen3.5-9B
|
| 30 |
+
quantized_by: jc-builds
|
| 31 |
+
pipeline_tag: text-generation
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
# Qwen3.5-9B Q4_K_M GGUF
|
| 35 |
+
|
| 36 |
+
> **4-bit quantized GGUF** of [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) optimized for **on-device iOS inference** via [llama.cpp](https://github.com/ggml-org/llama.cpp). The most capable model you can run on an iPhone.
|
| 37 |
+
|
| 38 |
+
| Property | Value |
|
| 39 |
+
|---|---|
|
| 40 |
+
| **Parameters** | 9 billion |
|
| 41 |
+
| **Quantization** | Q4_K_M (4-bit, medium quality) |
|
| 42 |
+
| **File Size** | 5.3 GB |
|
| 43 |
+
| **Context Window** | 262,144 tokens (native) |
|
| 44 |
+
| **Architecture** | Hybrid Gated DeltaNet + Attention |
|
| 45 |
+
| **License** | Apache 2.0 |
|
| 46 |
+
| **Languages** | 201 languages/dialects |
|
| 47 |
+
|
| 48 |
+
## Key Features
|
| 49 |
+
|
| 50 |
+
- **Best-in-Class On-Device AI**: Matches or beats models 9-13x its size
|
| 51 |
+
- **Thinking Mode**: `<think>...</think>` chain-of-thought reasoning
|
| 52 |
+
- **Hybrid Architecture**: Gated DeltaNet + Attention for efficient, high-quality inference
|
| 53 |
+
- **Natively Multimodal**: Trained with early vision fusion
|
| 54 |
+
- **Massive Context**: 262K native, extendable to 1M+ with YaRN
|
| 55 |
+
|
| 56 |
+
## Benchmarks
|
| 57 |
+
|
| 58 |
+
### Qwen3.5-9B vs Models 9-13x Larger
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
|
| 62 |
+
The 9B model **beats Qwen3-80B** on GPQA Diamond (81.7 vs 77.2), IFEval (91.5 vs 88.9), and HMMT math (83.2 vs 73.7). It also **outperforms GPT-OSS-120B** on MMLU-Pro (82.5 vs 80.8) and GPQA Diamond (81.7 vs 80.1).
|
| 63 |
+
|
| 64 |
+
### MMLU-Pro: Size Class Comparison
|
| 65 |
+
|
| 66 |
+
| Model | Params | MMLU-Pro |
|
| 67 |
+
|---|---|---|
|
| 68 |
+
| **Qwen3.5-9B** | **9B** | **82.5** |
|
| 69 |
+
| Qwen3-30B | 30B | 80.9 |
|
| 70 |
+
| GPT-OSS-120B | 120B | 80.8 |
|
| 71 |
+
| Qwen3.5-4B | 4B | 79.1 |
|
| 72 |
+
| Gemma2-9B | 9B | ~55* |
|
| 73 |
+
| Phi-4-mini | 3.8B | 52.8 |
|
| 74 |
+
|
| 75 |
+
### On-Device Inference Speed
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
|
| 79 |
+
### Vision Capabilities
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
|
| 83 |
+
The 9B model outperforms the dedicated Qwen3-VL-30B (3x its size) on MMMU, MMMU-Pro, MathVision, OmniDocBench, and VideoMME.
|
| 84 |
+
|
| 85 |
+
### Full Benchmark Table
|
| 86 |
+
|
| 87 |
+
| Benchmark | Qwen3.5-9B | Qwen3-30B | Qwen3-80B | GPT-OSS-120B |
|
| 88 |
+
|---|---|---|---|---|
|
| 89 |
+
| **MMLU-Pro** | 82.5 | 80.9 | 82.7 | 80.8 |
|
| 90 |
+
| **MMLU-Redux** | 91.1 | 91.4 | 92.5 | 91.0 |
|
| 91 |
+
| **GPQA Diamond** | 81.7 | 73.4 | 77.2 | 80.1 |
|
| 92 |
+
| **IFEval** | 91.5 | 88.9 | 88.9 | - |
|
| 93 |
+
| **HMMT Feb 25** | 83.2 | 63.1 | 73.7 | 76.7 |
|
| 94 |
+
| **HMMT Nov 25** | 82.9 | 73.8 | 81.2 | 81.8 |
|
| 95 |
+
| **LiveCodeBench v6** | 65.6 | 66.0 | 68.7 | 82.7 |
|
| 96 |
+
| **BFCL-V4 (Tool Use)** | 66.1 | 42.4 | - | - |
|
| 97 |
+
| **C-Eval** | 88.2 | 87.4 | 89.7 | 76.2 |
|
| 98 |
+
| **SuperGPQA** | 58.2 | 56.8 | 60.8 | 54.6 |
|
| 99 |
+
|
| 100 |
+
### Vision Benchmarks
|
| 101 |
+
|
| 102 |
+
| Benchmark | Qwen3.5-9B | Qwen3-VL-30B | GPT-5-Nano |
|
| 103 |
+
|---|---|---|---|
|
| 104 |
+
| **MMMU** | 78.4 | 76.0 | 75.8 |
|
| 105 |
+
| **MMMU-Pro** | 70.1 | 63.0 | 57.2 |
|
| 106 |
+
| **MathVision** | 78.9 | 65.7 | 62.2 |
|
| 107 |
+
| **OmniDocBench** | 87.7 | 86.8 | 55.9 |
|
| 108 |
+
| **VideoMME** | 84.5 | 79.9 | 71.7 |
|
| 109 |
+
| **OSWorld** | 41.8 | 30.6 | - |
|
| 110 |
+
|
| 111 |
+
## Device Compatibility
|
| 112 |
+
|
| 113 |
+
| Device | RAM | Compatible | Speed |
|
| 114 |
+
|---|---|---|---|
|
| 115 |
+
| iPhone 16 Pro Max | 8 GB | Yes | ~22-28 tok/s |
|
| 116 |
+
| iPhone 16 Pro | 8 GB | Yes | ~20-25 tok/s |
|
| 117 |
+
| iPhone 16 / 15 Pro | 8 GB | Possible (tight) | ~15-20 tok/s |
|
| 118 |
+
| iPhone 15 and older | 6 GB | Not recommended | - |
|
| 119 |
+
| iPad Pro (M-series) | 8-16 GB | Yes | ~25-40 tok/s |
|
| 120 |
+
| Mac (Apple Silicon) | 16+ GB | Yes | ~30-50 tok/s |
|
| 121 |
+
|
| 122 |
+
> **Note**: The 9B model at 5.3 GB requires devices with 8 GB+ RAM. For older devices, use the [Qwen3.5-4B](https://huggingface.co/jc-builds/Qwen3.5-4B-Q4_K_M-GGUF) instead.
|
| 123 |
+
|
| 124 |
+
## Usage
|
| 125 |
+
|
| 126 |
+
### With llama.cpp
|
| 127 |
+
|
| 128 |
+
```bash
|
| 129 |
+
# Download
|
| 130 |
+
huggingface-cli download jc-builds/Qwen3.5-9B-Q4_K_M-GGUF Qwen3.5-9B-Q4_K_M.gguf
|
| 131 |
+
|
| 132 |
+
# Run (with thinking mode)
|
| 133 |
+
./llama-cli -m Qwen3.5-9B-Q4_K_M.gguf -p "Prove that there are infinitely many primes." -ngl 99
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
### With Ollama
|
| 137 |
+
|
| 138 |
+
```bash
|
| 139 |
+
ollama run qwen3.5:9b
|
| 140 |
+
```
|
| 141 |
+
|
| 142 |
+
### In HaploAI (iOS)
|
| 143 |
+
|
| 144 |
+
This model is available directly in the [HaploAI](https://apps.apple.com/app/haploai/id6503772307) iOS app (v1.18+). Download it from the model selection page.
|
| 145 |
+
|
| 146 |
+
## Prompt Format
|
| 147 |
+
|
| 148 |
+
Uses ChatML format:
|
| 149 |
+
|
| 150 |
+
```
|
| 151 |
+
<|im_start|>system
|
| 152 |
+
You are a helpful assistant.<|im_end|>
|
| 153 |
+
<|im_start|>user
|
| 154 |
+
Hello!<|im_end|>
|
| 155 |
+
<|im_start|>assistant
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
### Thinking Mode
|
| 159 |
+
|
| 160 |
+
```
|
| 161 |
+
<|im_start|>assistant
|
| 162 |
+
<think>
|
| 163 |
+
Let me reason through this carefully...
|
| 164 |
+
First, assume there are finitely many primes p1, p2, ..., pn.
|
| 165 |
+
Consider N = p1 * p2 * ... * pn + 1.
|
| 166 |
+
N is not divisible by any pi, so either N is prime or has a prime factor not in our list.
|
| 167 |
+
This contradicts our assumption.
|
| 168 |
+
</think>
|
| 169 |
+
There are infinitely many primes. Here is Euclid's classic proof...
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
## Architecture Details
|
| 173 |
+
|
| 174 |
+
Qwen3.5 introduces a **hybrid Gated DeltaNet + Gated Attention** architecture:
|
| 175 |
+
|
| 176 |
+
- **3:1 ratio**: 3 layers of Gated DeltaNet (linear attention) per 1 layer of full softmax attention
|
| 177 |
+
- **32 total layers**: 8 blocks x (3 DeltaNet + 1 Attention)
|
| 178 |
+
- **Hidden dimension**: 4,096
|
| 179 |
+
- **Near-constant memory**: DeltaNet layers maintain bounded memory
|
| 180 |
+
- **GQA**: 16 query heads, 4 KV heads for attention layers
|
| 181 |
+
- **FFN intermediate**: 12,288
|
| 182 |
+
- **RoPE**: `theta=10,000,000` with YaRN extension
|
| 183 |
+
|
| 184 |
+
## Why Qwen3.5-9B?
|
| 185 |
+
|
| 186 |
+
This model represents a paradigm shift in on-device AI:
|
| 187 |
+
|
| 188 |
+
1. **9B params that beat 80B**: On GPQA Diamond, IFEval, and math benchmarks
|
| 189 |
+
2. **Hybrid attention is the future**: DeltaNet layers provide near-constant memory, enabling huge context on mobile
|
| 190 |
+
3. **Natively multimodal**: No separate vision encoder needed for basic image understanding
|
| 191 |
+
4. **201 languages**: Broadest language support in its class
|
| 192 |
+
5. **Apache 2.0**: Fully open, commercially usable
|
| 193 |
+
|
| 194 |
+
## Credits
|
| 195 |
+
|
| 196 |
+
- **Original model**: [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) by Alibaba Cloud
|
| 197 |
+
- **GGUF conversion**: [Unsloth](https://huggingface.co/unsloth/Qwen3.5-9B-GGUF)
|
| 198 |
+
- **Quantization**: Q4_K_M via llama.cpp
|
| 199 |
+
- **Optimized for iOS**: [jc-builds](https://huggingface.co/jc-builds)
|