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 leok7v/Qwen3.5-4B
# Run inference directly in the terminal:
llama cli -hf leok7v/Qwen3.5-4B
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf leok7v/Qwen3.5-4B
# Run inference directly in the terminal:
llama cli -hf leok7v/Qwen3.5-4B
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 leok7v/Qwen3.5-4B
# Run inference directly in the terminal:
./llama-cli -hf leok7v/Qwen3.5-4B
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 leok7v/Qwen3.5-4B
# Run inference directly in the terminal:
./build/bin/llama-cli -hf leok7v/Qwen3.5-4B
Use Docker
docker model run hf.co/leok7v/Qwen3.5-4B
Quick Links

Model Card for Qwen3.5-4B (2-bit GGUF)

A 2-bit GGUF build of Qwen3.5-4B, packaged to run entirely on device. The tokenizer, the merge table and the chat template are embedded in the weight file, so nothing calls out to a server at inference time.

This repository holds the quantized weights only, not training data or the original checkpoint.

This file uses a non-standard block type and stock llama.cpp will not read it. The weights are stored in a custom 2-bit format that upstream ggml does not implement, so the file is intended for a companion on-device runtime that does. If you are looking for a build that runs in llama.cpp, Ollama or LM Studio today, use one of the standard-quant GGUF releases instead.

Files

File Purpose
Qwen3.5-4B-Q2_E8.gguf the weights, tokenizer and chat template
generation_config.json the sampling parameters, per mode

Both are needed. The sampling card is read from beside the weight file; a runtime that cannot find it should refuse to guess rather than substitute another model's settings.

Model Details

Model Description

Qwen3.5-4B is a dense hybrid. Its layers alternate three Gated DeltaNet linear-attention blocks to one full attention block. The linear blocks carry a small fixed-size recurrent state instead of a growing key/value cache, so memory stays flat as context grows, while the periodic attention blocks preserve exact long-range recall.

This build is text-only. The base model is multimodal, but no vision tower is included here, so image and video input are not available from this file.

A multi-token-prediction layer is present, which a runtime that supports self-speculative decoding can use as a drafter; one that does not will ignore it.

  • Developed by: Qwen, Alibaba (base model); quantization by leok7v
  • Model type: Hybrid Gated DeltaNet + attention causal language model
  • Language(s): English and the languages of the base model
  • License: Apache 2.0, inherited from the base model
  • Quantized from model: Qwen/Qwen3.5-4B

Model Sources

Uses

Direct Use

On-device chat, summarization, drafting and question answering over supplied text, in offline or privacy-sensitive settings where prompts must not leave the device.

Out-of-Scope Use

Anything the base model's licence and card exclude. This build adds no alignment, no safety tuning and no filtering of its own; it is the upstream model in a different numeric format. Not a basis for legal, medical, financial or safety decisions, and not intended for high-stakes automated decisions without human review.

Bias, Risks, and Limitations

The base model's biases and failure modes carry over unchanged.

Two bits is aggressive, and it shows. Outputs will not match the upstream model token for token, and the gap is widest where the model was already uncertain. In practice the structure of an answer survives better than its details: a chain of reasoning can be laid out correctly and still contain an arithmetic slip, and long multi-step derivations are where errors accumulate.

Anyone depending on this build should evaluate it on their own task rather than assume it behaves like the full-precision model or like a 4-bit one.

Recommendations

Treat generations as drafts to verify, not as fact. For anything where accuracy matters, and for arithmetic in particular, check the result.

How to Get Started with the Model

The tokenizer and the chat template are embedded, so a runtime reads both from the GGUF rather than from sibling files. The chat template documents the roles, the thinking block and the tool-call format.

The base model card recommends these sampling parameters, and generation_config.json carries them:

mode temperature top_p top_k presence_penalty
Thinking 1.0 0.95 20 1.5
Instruct (non-thinking) 0.7 0.80 20 1.5

reasoning_effort is supported by the template; low and medium cost fewer tokens per turn than the default.

Technical Specifications

Model Architecture and Objective

Property Value
Objective Autoregressive next-token prediction
Hidden size 2560
Layers 32 (Gated DeltaNet + attention, three to one) + 1 MTP
Attention heads 16 query / 4 key-value (grouped-query)
Head dimension 256 (partial rotary, 64)
Linear-attention state 128, 16 groups, inner size 4096
Feed-forward 9216
Vocabulary 248320
Context length up to 262144 tokens

Weight format

1.47 GiB, 441 tensors, GGUF v3, 16384-byte tensor alignment.

Type Tensors Covers
2-bit 200 the transformer trunk and the embedding table
BF16 8 held wider on purpose
Q4_0 1 held wider on purpose
F32 232 norms, layer scalars, the recurrent-state parameters

The 2-bit type is a custom ggml block: each group of eight weights is snapped to the nearest point of an E8 lattice codebook and stored as one 16-bit index, which is exactly two bits per weight. That is why stock llama.cpp cannot read the file.

Citation

Please cite the upstream Qwen3.5-4B model. See the base model card at Qwen/Qwen3.5-4B for the canonical reference and license.

Model Card Contact

leok7v on Hugging Face.

Downloads last month
-
GGUF
Model size
4B params
Architecture
qwen35
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 leok7v/Qwen3.5-4B

Finetuned
Qwen/Qwen3.5-4B
Quantized
(374)
this model