Xing4.0-29B-A4B — APEX-I GGUF Collection
Quantization suite for Xing4.0-29B-A4B (China Telecom AI, TeleChat lineage): a Mixture-of-Experts reasoning model with 29B total parameters and ~4B active per token — 40 layers (2 dense + 38 MoE blocks with 64 routed experts + 1 shared expert, top-4 routing), DeepSeek-V3-style Multi-head Latent Attention (MLA), hyper-connection residual mixing (4 hyper-connections), a 131k SentencePiece vocabulary and a native 256K context window (yaRN).
This release ships five APEX-I builds — a precision ladder from the highest-fidelity flagship down to an 11.9 GiB build that opens the model up to 16 GB-class hardware. No fine-tuning, merging or pruning was applied — the only intervention is quantization. Every build was produced in a single pass from the untouched BF16 master, against an importance matrix computed on our own multilingual calibration corpus (English-dominant, with smaller Polish and Chinese portions), with the official tensor layout preserved in full (all tensors present, including the MTP block).
The APEX-I Approach
- Importance-matrix guided quantization — every low-bit tensor (i-quant and k-quant types) is quantized against an importance matrix computed on a custom multilingual calibration corpus — 825 chunks rendered in the model's native chat template, verified end-to-end against the HF tokenizer (including SentencePiece round-trip). No borrowed or generic calibration data was used.
- Pristine BF16 master — one clean quantization pass over the original BF16 weights; no intermediate requantization, no activation-rescaled variants, no imatrix reuse from other models.
- Protected trunks — MoE routers and routing biases stay FP32, all attention norms stay FP32, and
the hyper-connection tensors (
hc_*) stay FP32/BF16 in every build. - Role-based precision map — routed experts receive the lowest or tied-lowest precision in every build, with gate/up below the down-projection; in the smallest build the early MoE blocks keep one IQ tier above the rest, where quantization noise is most damaging.
Available Builds
| File | Size | Avg BPW | Hardware guidance |
|---|---|---|---|
Xing4.0-29B-A4B-APEX-I-PRO.gguf | 25.30 GiB | 6.96 | 24 GB VRAM with MoE offload, or 32 GB RAM. Highest fidelity of the suite. |
Xing4.0-29B-A4B-APEX-I-QUALITY.gguf | 21.75 GiB | 5.98 | 24 GB VRAM (light MoE offload), or 24-32 GB RAM. |
Xing4.0-29B-A4B-APEX-I-BALANCED.gguf | 18.25 GiB | 5.02 | Fits fully in 24 GB VRAM, or 24 GB RAM. |
Xing4.0-29B-A4B-APEX-I-COMPACT.gguf | 14.60 GiB | 4.02 | 16 GB VRAM with light offload, or 16+ GB RAM. |
Xing4.0-29B-A4B-APEX-I-MINI.gguf | 11.87 GiB | 3.23 | 12 GB VRAM with MoE offload (tested), or 16 GB RAM. Fastest build. |
Sizes are on-disk file sizes in GiB, rounded to two decimal places.
Quantization Matrix (from the shipped files)
| Build | Embed / Output | MLA attention (q_a, q_b, kv_a_mqa, v_b, o) | attn_k_b | Dense FFN (blk 0-1) | Routed experts (gate/up) | Routed experts (down) | Shared expert |
|---|---|---|---|---|---|---|---|
| PRO | BF16 | Q8_0 | Q8_0 | Q6_K | Q6_K | Q6_K | Q8_0 |
| QUALITY | Q8_0 | Q6_K | Q8_0 | Q6_K | Q5_K | Q6_K | Q6_K |
| BALANCED | Q8_0 | Q5_K | Q5_1 | Q5_K | Q4_K | Q5_K | Q5_K |
| COMPACT | Q6_K | Q5_K | Q5_1 | Q5_K | IQ3_S | Q4_K | Q5_K |
| MINI | Q8_0 | Q4_K | Q5_0 | Q4_K | IQ3_S (blk 2-8) / IQ2_S (blk 9-39) | IQ3_S | Q4_K |
In all builds: routers (ffn_gate_inp) and routing biases (exp_probs_b) are FP32, all *_norm
tensors are FP32, hyper-connection matrices are BF16 with their scales/bases in FP32, and every build
carries the full MTP block (blk.40) at the corresponding build's precision.
Notes on the MTP Block
The files keep the complete official tensor layout, including the MTP draft block (blk.40,
one nextn layer with its own embedding and output head). Current llama.cpp builds treat these
tensors as unused and do not load them into RAM/VRAM, so MTP costs file size only; a future llama.cpp
with MTP support would likely not require re-downloading the files.
Inference & Usage
The chat template is embedded in the GGUF metadata — llama.cpp applies it automatically. The template
uses a thinking format (<think>…</think> on the final assistant turn). Recommended sampling settings
from the base model's generation_config: temperature 1.0, top-p 0.95, repetition penalty 1.05;
greedy decoding is also stable.
Requires a recent llama.cpp build with xing4_0 support; on builds without it the model fails to load
with an unknown-architecture error.
Important: as of this writing, upstream llama.cpp still carries several
xing4_0correctness bugs (in YaRN scaling, the fused-attention clamp and the CUDA MMQ path) that corrupt generation — garbled or non-finite output — without raising an error. These files were validated on a build with all known fixes applied; until the patches land upstream, use a patched build.
# PRO on 24 GB VRAM: routed experts on CPU, everything else on GPU
llama-cli -m Xing4.0-29B-A4B-APEX-I-PRO.gguf -ngl 99 --n-cpu-moe 30 -fa on -c 8192 -st -p "Your prompt"
# QUALITY / BALANCED on 16-24 GB VRAM
llama-cli -m Xing4.0-29B-A4B-APEX-I-QUALITY.gguf -ngl 99 --n-cpu-moe 30 -fa on -c 8192 -st -p "Your prompt"
# MINI tested on a 12 GB GPU (RTX 3060 class)
llama-cli -m Xing4.0-29B-A4B-APEX-I-MINI.gguf -ngl 99 --n-cpu-moe 32 -fa on -c 8192 -st -p "Your prompt"
# CPU-only
llama-cli -m Xing4.0-29B-A4B-APEX-I-MINI.gguf -ngl 0 -c 8192 -st -p "Your prompt"
--n-cpu-moe N keeps the first N MoE blocks' expert weights in system RAM; tune it down (or drop it)
as VRAM allows. llama-server takes the same flags (drop -st/-p) and exposes an
OpenAI-compatible /v1/chat/completions endpoint.
Every build passed greedy-decoding loader and generation checks with correct Polish diacritics before release; tokenizer round-trip against the official HF tokenizer was verified during calibration.
License & Acknowledgements
- Base model: XingChen-AGI/Xing4.0-29B-A4B — Apache 2.0; the weights, architecture and tokenizer are the work of the original authors.
- Quantization pipeline: mudler/apex-quant methodology, extended with role-based precision maps for MLA/MoE/hyper-connection architectures and custom importance-matrix calibration.
- Runtime: ggml-org/llama.cpp.