Instructions to use TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use TheStageAI/Qwen3.5-4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheStageAI/Qwen3.5-4B-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": "TheStageAI/Qwen3.5-4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
- Ollama
How to use TheStageAI/Qwen3.5-4B-GGUF with Ollama:
ollama run hf.co/TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
- Unsloth Studio
How to use TheStageAI/Qwen3.5-4B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TheStageAI/Qwen3.5-4B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TheStageAI/Qwen3.5-4B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for TheStageAI/Qwen3.5-4B-GGUF to start chatting
- Pi
How to use TheStageAI/Qwen3.5-4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use TheStageAI/Qwen3.5-4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf TheStageAI/Qwen3.5-4B-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 "TheStageAI/Qwen3.5-4B-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"
- Docker Model Runner
How to use TheStageAI/Qwen3.5-4B-GGUF with Docker Model Runner:
docker model run hf.co/TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
- Lemonade
How to use TheStageAI/Qwen3.5-4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-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 TheStageAI/Qwen3.5-4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Refine checkpoint pipeline and card layout
Browse files- README.md +42 -11
- release-manifest.json +1 -1
README.md
CHANGED
|
@@ -79,21 +79,52 @@ XS targets minimum footprint for non-thinking chat and instruction following. Fo
|
|
| 79 |
|
| 80 |
</details>
|
| 81 |
|
| 82 |
-
## How
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
-
| --- | --- |
|
| 88 |
-
| **1 · Pin the source** | Lock the upstream weights, tokenizer metadata, and model topology. |
|
| 89 |
-
| **2 · Build the bank** | Produce native Q2_K–Q8_0 candidates for each quantizable tensor group and record their exact byte costs. |
|
| 90 |
-
| **3 · Select and assemble** | Choose a model-specific XS/S assignment under an exact size cap; assemble M/L with fixed Q4_K/Q8_0 assignments. |
|
| 91 |
-
| **4 · Tune scales** | Optimize representable scales and minima against teacher outputs while packed codes, dense weights, and tensor layout remain frozen. |
|
| 92 |
-
| **5 · Validate the release** | Export GGUF, verify size and payload integrity, load with pinned llama.cpp, and run held-out KL before downstream benchmarks. |
|
| 93 |
|
| 94 |
-
|
| 95 |
|
| 96 |
-
|
| 97 |
|
| 98 |
<details>
|
| 99 |
<summary><b>Technical file details</b></summary>
|
|
|
|
| 79 |
|
| 80 |
</details>
|
| 81 |
|
| 82 |
+
## How the compression pipeline works
|
| 83 |
+
|
| 84 |
+
The adaptive tiers separate precision allocation from final weight reconstruction:
|
| 85 |
+
|
| 86 |
+
```text
|
| 87 |
+
Q2_K … Q8_0 PTQ lanes
|
| 88 |
+
↓
|
| 89 |
+
per-group candidate bank + native byte costs
|
| 90 |
+
↓
|
| 91 |
+
ANNA-DIAG-BYTES or RCO allocation
|
| 92 |
+
↓
|
| 93 |
+
fresh scheduled GPTQ / QuantEase + QEP
|
| 94 |
+
↓
|
| 95 |
+
scale/min distillation with codes frozen
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### 1. Build native candidates
|
| 99 |
+
|
| 100 |
+
For every quantizable tensor group, TorsionQuant produces six native K-quant candidates. Each lane uses the same Hessian-aware GPTQ stack: **QuantEase** optimizes the blockwise weight codes, **QEP** propagates reconstruction error through the layer, and native K refinement keeps the solver aligned with the GGUF layouts that will actually ship.
|
| 101 |
+
|
| 102 |
+
- A **uniform bank** runs each Q2/Q3/Q4/Q5/Q6/Q8 lane independently.
|
| 103 |
+
- An **anchor bank** builds every candidate from activations propagated along one concrete quantized trajectory.
|
| 104 |
+
|
| 105 |
+
### 2. Allocate the byte budget
|
| 106 |
+
|
| 107 |
+
The scheduler sees the exact native GGUF cost of every `(tensor group, qtype)` choice, rather than a nominal average bit width.
|
| 108 |
+
|
| 109 |
+
- **ANNA-DIAG-BYTES** installs one candidate at a time in the BF16 model, measures full-vocabulary next-token KL against the teacher while every other group remains dense, and solves an exact multiple-choice knapsack over that isolated-loss table.
|
| 110 |
+
- **RCO** optimizes the choices jointly: projected-Gumbel search minimizes end-to-end teacher KL on the interpolated model under the byte constraint, then exact integer rounding produces the hard assignment.
|
| 111 |
+
|
| 112 |
+
| Adaptive tier | Bank / selector | Byte target |
|
| 113 |
+
| --- | --- | --- |
|
| 114 |
+
| XS | `RCO` · anchor bank | Compact model-specific cap |
|
| 115 |
+
| S | `RCO` · anchor bank | Exact size of a pinned `UD-Q2_K_XL` reference |
|
| 116 |
+
|
| 117 |
+
The S reference is used only as an external byte-budget authority.
|
| 118 |
+
|
| 119 |
+
### 3. Requantize and refine
|
| 120 |
|
| 121 |
+
The bank determines the qtype map; the release weights are regenerated from the original dense model in a **fresh full-model PTQ pass**. Activation propagation and error compensation therefore follow the final mixed-precision trajectory.
|
| 122 |
|
| 123 |
+
A short affine distillation pass then tunes only the native scales and minima against cached teacher logits. Qtypes, packed integer codes, dense weights, and tensor layouts remain frozen, so the size and runtime contract cannot drift. M and L use the same reconstruction and refinement path with fixed Q4_K and Q8_0 assignments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
|
| 125 |
+
Only after these stages is the final GGUF exported and measured on the untouched 3,072-sequence KL set and the downstream benchmarks above. The recommendation is based on those end-to-end results, not on the scheduler's calibration objective.
|
| 126 |
|
| 127 |
+
**Base model:** [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) at revision [`851bf6e8`](https://huggingface.co/Qwen/Qwen3.5-4B/tree/851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a).
|
| 128 |
|
| 129 |
<details>
|
| 130 |
<summary><b>Technical file details</b></summary>
|
release-manifest.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
| 36 |
},
|
| 37 |
"display_name": "Qwen3.5 4B",
|
| 38 |
"family": "Qwen 3.5",
|
| 39 |
-
"generated_at": "2026-07-21T10:
|
| 40 |
"license": "apache-2.0",
|
| 41 |
"model_key": "qwen3p5_4b",
|
| 42 |
"reasoning_policy": {
|
|
|
|
| 36 |
},
|
| 37 |
"display_name": "Qwen3.5 4B",
|
| 38 |
"family": "Qwen 3.5",
|
| 39 |
+
"generated_at": "2026-07-21T10:44:31.264168+00:00",
|
| 40 |
"license": "apache-2.0",
|
| 41 |
"model_key": "qwen3p5_4b",
|
| 42 |
"reasoning_policy": {
|