How to use from
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 AGofficial/Qwen4-9b-Preview
# Run inference directly in the terminal:
llama cli -hf AGofficial/Qwen4-9b-Preview
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf AGofficial/Qwen4-9b-Preview
# Run inference directly in the terminal:
llama cli -hf AGofficial/Qwen4-9b-Preview
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-app
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama serve -hf AGofficial/Qwen4-9b-Preview
# Run inference directly in the terminal:
./build/bin/llama cli -hf AGofficial/Qwen4-9b-Preview
Use Docker
docker model run hf.co/AGofficial/Qwen4-9b-Preview
Quick Links

Qwen4-9B-Preview

Qwen4-9B-Preview is an experimental, standalone 9B-parameter (8.9998B stored parameters, 3.27 GB GGUF) model created via zero-training weight surgery directly from Qwen/Qwen4-35B-A3B (retrieved December 3, 2026).

No gradient updates, no backpropagation, no distillation training, and no fine-tuning were used. Every retained weight tensor in this checkpoint is copied byte-for-byte from the released Qwen4-35B-A3B weights, reassembled into a compact standalone architecture that runs natively on consumer CPUs and edge hardware via llama.cpp.

Preview Notice: This is an early preview checkpoint released while full-family scaling (9B, 4B, 2B, 1B, 0.5B) and expanded benchmarks are actively being completed.

Why This Matters

  • Democratizing Frontier AI on Edge Hardware: Brings Qwen4's hybrid Gated DeltaNet + Qwen Sparse Attention + <think> reasoning capabilities down to a 3.27 GB standalone file that runs smoothly on standard laptops and CPUs.
  • Native Speculative Decoding Draft Model: Shares the exact Qwen4 tokenizer, 40-layer residual stream, and representation geometry with Qwen4-35B-A3B, making it a natural draft model to accelerate Qwen4-35B-A3B inference via speculative decoding.
  • Zero-Training Neural Weight Transfer: Demonstrates that coherent English chat, factual recall, Python comprehension, and multi-step <think> chain-of-thought reasoning can be transplanted from a 35B MoE + 20.5B PLE model into a 9B footprint purely through mathematical routing analysis and structural tensor surgery.

How It Was Built (Zero-Training Weight Surgery)

Using frontier models to guide structural analysis and tensor surgery on Qwen/Qwen4-35B-A3B:

  1. Full 40-Layer Depth Preservation: Skipping decoder layers breaks Qwen4's 4-branch hyper-connection residual stream. Keeping all 40 decoder layers (d_model = 2048), all attention/DeltaNet blocks, hyper-connections, shared experts, embeddings, and LM head preserves coherent language and reasoning.
  2. All-Position Teacher Routing Calibration: We ran read-only teacher forward passes over a diverse English chat, reasoning, math, fact, and code calibration corpus (recording router probabilities at every token position across all 40 layers, including layer 39) and retained the top 48 routed experts per layer (out of 256, keeping intact width-512 gate/up/down slices and matching router rows).
  3. Frequency-Guided Compact PLE Reconstruction: Qwen4's 20.5B-parameter Per-Layer N-gram Embedding (PLE) table was compacted to 151.7M parameters (~74k hash slots/head) by reproducing Qwen4's native 64-bit bigram/trigram hash over 2.5M English WikiText-2 tokens and copying the highest-frequency trained IQ4_NL rows byte-for-byte. On our diagnostic checks, this 151.7M table matched the full 20.5B teacher PLE upper bound.

Architecture Overview

Specification Qwen4-35B-A3B (Source) Qwen4-9B-Preview
Stored Parameters 35B + 20.5B PLE + 2B MTP 8,999,835,008 (~9.0B)
File Size (GGUF) ~21.3 GB (2 shards, UD-IQ1_S) 3.27 GB (1 standalone file)
Decoder Layers 40 (3ร— Gated DeltaNet + 1ร— QSA) 40 (all preserved)
Hidden Dimension 2048 (4-branch Hyper-Connections) 2048 (all preserved)
Routed Experts / Layer 256 (8 active + 1 shared) 48 (8 active + 1 shared)
Expert Intermediate Width 512 512 (byte-exact)
Compact PLE Table 20.5B params 151.7M params (WikiText-2 populated)
Native Context Length 1,048,576 1,048,576
Training / Fine-Tuning Pre-trained + Post-trained None (0 gradient steps)

Quickstart (llama.cpp)

Requires a llama.cpp build with qwen4exp support (b12973+):

# Interactive web chat UI (Llama Chat) + OpenAI-compatible API
llama-server -m Qwen4-9B-Preview.gguf --host 127.0.0.1 --port 8080 -c 4096 --jinja

# CLI inference
llama-cli -m Qwen4-9B-Preview.gguf -c 4096 --jinja

Recommended Sampling Parameters (inherited from Qwen4)

  • Thinking Mode (<think>): temperature=1.0, top_p=0.95, top_k=20, presence_penalty=0.0
  • Non-Thinking Mode: temperature=0.7, top_p=0.80, top_k=20, presence_penalty=1.5

Early Smoke-Test Observations

Compared to a 9B random-weight control and a 12-layer depth-pruned 9B transfer (both completely garbled), Qwen4-9B-Preview recovers:

  • Fluent English chat and instruction following
  • Exact factual recall (e.g., chemical symbol for gold โ†’ Au, oxygen โ†’ O)
  • Multi-step <think> arithmetic and transitive logic reasoning (e.g., 12 + 9 - 4 = 17, 7 ร— 6 = 42, transitive race/age ordering)
  • Basic Python evaluation (len([3, 3, 5]) โ†’ 3)

Limitations: As a zero-training preview keeping 48/256 experts per layer, occasional token glitches, formatting artifacts, or factual misses occur compared to the full 35B teacher.

License & Attribution

  • License: Apache 2.0 (matching the upstream source model).
  • Source Model: Built directly from Qwen/Qwen4-35B-A3B by the Qwen Team (Alibaba Group), retrieved December 3, 2026.
@misc{qwen4-35ba3b,
  title  = {{Qwen4-35B-A3B}},
  author = {{Qwen Team}},
  month  = {December},
  year   = {2026},
  url    = {https://huggingface.co/Qwen/Qwen4-35B-A3B}
}
Downloads last month
-
GGUF
Model size
9B params
Architecture
qwen4exp
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for AGofficial/Qwen4-9b-Preview

Quantized
(102)
this model