/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
Xing4.0-29B-A4B
Библиотека
llama.cpp
Опубликована
20 сен 2026

Xing4.0-29B-A4B-APEX-GGUF

Генерация текстаТекст → текст13 профессий

Три GGUF-квантования диалоговой Xing4.0-29B-A4B для генерации текста и локального запуска через llama.cpp.

3 049скачиваний за 30 дней5лайковвеса обновлены20 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это репозиторий трёх GGUF-квантований Xing4.0-29B-A4B, подготовленных автором vincespeed с помощью Apex-Quant для запуска через llama.cpp. В основе — XingChen-AGI/Xing4.0-29B-A4B, диалоговая модель архитектуры Xing4_0ForCausalLM: 29 млрд параметров всего, около 4 млрд активных на токен, с 40 слоями, включая блоки Mixture-of-Experts и Multi-Latent Attention. Доступны профили i-quality, i-balanced и i-compact с разным соотношением качества, размера и скорости; файлы занимают примерно 14–22 ГБ.

Модель предназначена для генерации текста и диалогов. Её можно использовать для ответов на вопросы, написания текстов, рассуждений и программирования; исходная модель также рассчитана на длинный контекст и агентные задачи с инструментами. В README указана поддержка контекста до 65 536 токенов для приведённой оценки памяти KV-кэша. Репозиторий содержит только квантованные варианты и не сообщает отдельного языкового списка.

При тестировании автор получил вывод, состоящий из пробелов, на CPU и при частичной выгрузке на GPU; возможны проблемы маршрутизации экспертов в некоторых конфигурациях, поэтому качество инференса следует проверять на целевом окружении. Черновая голова Multi-Token Prediction при обычном инференсе не исполняется, а спекулятивное декодирование зависит от движка. Лицензия — Apache 2.0.

Сценарии применения

  • ведение диалогов и ответы на вопросы
  • написание и продолжение текстов
  • помощь с программированием
  • рассуждения по длинному контексту
  • локальный запуск языковой модели на компьютере с ограниченной памятью

Ограничения

README сообщает о тестах, в которых на CPU и при частичной выгрузке на GPU модель выдавала только пробелы; возможны проблемы маршрутизации экспертов в отдельных конфигурациях. Голова MTP не задействуется при стандартном инференсе, а спекулятивное декодирование требует поддержки со стороны движка.

Для каких профессий подходит13

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Xing4.0-29B-A4B — Apex Quant GGUF Models

This repository contains 3 quantized GGUF profiles of the XingChen-AGI/Xing4.0-29B-A4B model, produced using Apex-Quant mixed-precision quantization technology.

Note: The original source model is available at XingChen-AGI/Xing4.0-29B-A4B under Apache 2.0 license. This repository provides quantized variants only.

📦 Quick Overview

ProfileSizeBPWBest For
i-quality19.21 GB~5.2Highest fidelity, production use, research
i-balanced22 GB~5.5Balanced quality/performance trade-off
i-compact14 GB3.85Resource-constrained deployment, fast inference

BPW = Bits Per Weight. Higher value generally correlates with better generation quality.

📁 Repository Contents

├── Xing4.0-29B-A4B-i-quality.gguf   # 19.21 GB — highest quality
├── Xing4.0-29B-A4B-i-balanced.gguf  # 22 GB — balanced
├── Xing4.0-29B-A4B-i-compact.gguf   # 14 GB — compact
└── patches/
    └── 0001-xing4_0-llama-cpp-build.patch  # Reproducible build instructions

🏗️ Source Model Information

PropertyValue
ArchitectureXing4_0ForCausalLM
Total Parameters29B (4B active per token)
Layers40 (2 dense lead-in + 38 MoE blocks)
Hidden Size3,584
Vocabulary131,072 tokens (SentencePiece)
Context Length262,144 tokens (YaRN extended from 4,096)
LicenseApache-2.0
SourceChina Telecom / XingChen-AGI

Key Architecture Features

  • Multi-Latent Attention (MLA): DeepSeek-V3-style MLA compression with q_lora_rank=768, kv_lora_rank=512, enabling efficient attention without full projection matrices.
  • Mixture-of-Experts (MoE): 64 routed experts per layer, top-4 active per token (noaux_tc gating method), plus 1 shared expert per layer.
  • Masked Hyper-Connections (mHC): Sinkhorn-gated routing (mh_mult=4, sinkhorn_iters=20) for enhanced expert collaboration.
  • Multi-Token Prediction (MTP): Draft head at layer 40 supporting speculative decoding.
  • RoPE: YaRN positional embeddings with scaling factor 64, theta 10,000.

🔬 Quantization Methodology

All three profiles were generated using the Apex-Quant framework with importance-weighted mixed-precision quantization:

Apex-Quant Configuration

# Generate per-profile config (EDGE/NEAR/MID layer bands)
bash scripts/generate_config.sh \
  --profile i-quality \
  --layers 40 \
  --dense-layers 2 > config.txt

# Append MTP block patterns (blk.40) for draft-head quantization
echo "blk.40.ffn_gate_exps=iq4_xs" >> config.txt
echo "blk.40.ffn_up_exps=iq4_xs" >> config.txt
echo "blk.40.ffn_down_exps=iq4_xs" >> config.txt
# ... (see config files for full content)

# Quantize with imatrix
llama-quantize \
  --tensor-type-file config.txt \
  --imatrix imatrix-Xing4.0-29B-A4B-820chunks.gguf \
  Xing4.0-29B-A4B-BF16.gguf \
  Xing4.0-29B-A4B-i-quality.gguf \
  Q6_K

Layer Band Allocation

RegionLayersi-quality Expertsi-balanced Expertsi-compact Experts
EDGEL0–4, L35–39Q6_KQ6_KQ4_K
NEARL5–9, L30–34Q5_KQ5_KQ3_K
MIDL10–29IQ4_XSQ5_KQ3_K
Shared FFNAll layersQ8_0Q8_0Q6_K
AttentionL0–2, L37–39Q6_KQ6_KQ4_K
AttentionL3–36Q6_KQ6_KQ4_K

Important Implementation Notes

  1. MTP Block (blk.40): The multi-token prediction draft head has no imatrix entries because it is not executed during trunk-only inference. Types requiring imatrix (IQ1/IQ2 series) cannot be used for blk.40 tensors — this profile uses IQ4_XS/Q5_K/Q3_K which do not require imatrix.

  2. mHC Gate Tensors: Automatically excluded from quantization by the llama.cpp fork (hc_attn_fn.weight, hc_ffn_fn.weight, hc_head_fn.weight preserved at F32).

  3. MLA B-Matrices (attn_k_b): Tensors with shape [128, 512, 32] have an inner dimension (128) that is not divisible by Q6_K's block size (256). These automatically fall back to Q8_0 via the built-in fallback mechanism — a safe direction (higher precision).

  4. Router Tensors (ffn_gate_inp): Fall through to the base type (Q6_K for i-quality, Q5_K for i-balanced, Q4_K for i-compact).

  5. Config File Format: The --tensor-type-file parser does NOT support comment lines (#). Only pure pattern=value lines are valid.

💻 Inference Usage

Recommended Settings (from official repo)

[main]
ctx-size = 65536
flash-attn = true
cache-type-k = q8_0
cache-type-v = q8_0
n-gpu-layers = 999

llama.cpp CLI Examples

# i-compact — fastest, lowest VRAM requirement
.\llama-cli.exe ^
  -m models\Xing4.0-29B-A4B-i-compact.gguf ^
  -ngl 999 -c 65536 --flash-attn ^
  --temp 0.7 --top-k 50 --top-p 0.95 ^
  -p "Türkiye'nin en büyük şehri neresidir?" -n 64

# i-quality — highest accuracy
.\llama-cli.exe ^
  -m models\Xing4.0-29B-A4B-i-quality.gguf ^
  -ngl 999 -c 65536 --flash-attn ^
  --temp 0.7 --seed 42 ^
  -p "Explain quantum computing in simple terms." -n 64

# Server mode
.\llama-server.exe ^
  -m models\Xing4.0-29B-A4B-i-compact.gguf ^
  -ngl 999 -c 65536 --host 0.0.0.0 --port 8080

Python (llama-cpp-python)

from llama_cpp import Llama

llm = Llama(
    model_path="Xing4.0-29B-A4B-i-compact.gguf",
    n_ctx=65536,
    n_gpu_layers=999,
    flash_attn=True,
    seed=42,
)

response = llm.create_chat_completion(
    messages=[{"role": "user", "content": "Hello, tell me about Istanbul."}],
    max_tokens=256,
)
print(response["choices"][0]["message"]["content"])

VRAM Sizing Guide

VRAMProfileOffload Strategy
8 GBi-compactPartial (-ngl 6–10), expect slow CPU decode
16 GBi-compactFull or near-full (-ngl 20–35); i-quality partial
24 GBi-compact (full), i-quality (partial)-ngl 35–40 for i-quality
40+ GBAll profilesFull offload (-ngl 999)

KV Cache: At 65,536 context with q8_0/kv ≈ 2.5 GB. To save VRAM, disable GPU KV offload with --no-kv-offload (moves KV cache to system RAM).

🛠️ Reproducible Build

To reproduce these quantizations from scratch:

Step 1: Clone and Build the Xing4.0 Fork

git clone -b xing4_0-port https://github.com/shuxiaoqiong/llama.cpp.git llama-cpp-xing4
cd llama-cpp-xing4

cmake -G "Visual Studio 17 2022" -A x64 ^
      -DCMAKE_BUILD_TYPE=Release -DLLAMA_CUDA=ON ^
      -B build
cd build
cmake --build . --config Release --parallel

Required binaries: llama-quantize.exe, llama-imatrix.exe, llama-cli.exe

Step 2: Convert Source Model to GGUF

python convert_hf_to_gguf.py ^
  <path-to-safetensors-dir> ^
  --outfile Xing4.0-29B-A4B-BF16.gguf ^
  --outtype bf16

Expected output: ~59 GB GGUF with 977 tensors.

Step 3: Generate Apex Configs

# Quality profile
bash scripts/generate_config.sh --profile i-quality --layers 40 --dense-layers 2 > configs/xing4_quality.txt

# Balanced profile
bash scripts/generate_config.sh --profile i-balanced --layers 40 --dense-layers 2 > configs/xing4_balanced.txt

# Compact profile
bash scripts/generate_config.sh --profile i-compact --layers 40 --dense-layers 2 > configs/xing4_compact.txt

Append MTP block (blk.40) patterns to each file:

blk.40.ffn_gate_exps=<EXP_TYPE>
blk.40.ffn_up_exps=<EXP_TYPE>
blk.40.ffn_down_exps=<EXP_TYPE>
blk.40.ffn_gate_shexp=<SHARED_TYPE>
blk.40.ffn_up_shexp=<SHARED_TYPE>
blk.40.ffn_down_shexp=<SHARED_TYPE>
blk.40.attn_q=<ATTN_TYPE>
blk.40.attn_k=<ATTN_TYPE>
blk.40.attn_v=<ATTN_TYPE>
blk.40.attn_output=<ATTN_TYPE>

Where <EXP_TYPE> = iq4_xs (quality) / Q5_K (balanced) / Q3_K (compact), and <ATTN_TYPE> = Q6_K (quality/balanced) / Q4_K (compact).

Step 4: Run Quantization

See the batch script at .tmp/apex_quant_xing4.ps1 for the automated 3-profile run, or invoke individually:

llama-quantize.exe ^
  --tensor-type-file configs\xing4_quality.txt ^
  --imatrix imatrix-Xing4.0-29B-A4B-820chunks.gguf ^
  Xing4.0-29B-A4B-BF16.gguf ^
  Xing4.0-29B-A4B-i-quality.gguf ^
  Q6_K

📊 Technical Summary

Tensor Distribution Statistics

ComponentParameter CountApprox. Size (BF16)
Token Embedding470M940 MB
Output Projection470M940 MB
Attention Projections (all layers)~1.2B~2.4 GB
Expert FFNs (routed, 64×38 layers)~23B~46 GB
Shared Expert FFNs (1×40 layers)~360M~720 MB
mHC Gates & Norms~50M~100 MB
MTP Draft Head (blk.40)~3B~6 GB
Total~29B~59 GB

Quantization Impact

MetricBF16 Basei-qualityi-balancedi-compact
Total Size59 GB19.21 GB22 GB14 GB
Compression Ratio1×3.07×2.68×4.21×
Expert FFN PrecisionF16Q6/Q5/IQ4Q6/Q5Q4/Q3
Shared FFNF16Q8_0Q8_0Q6_K
AttentionF16Q6_KQ6_KQ4_K

🙏 Acknowledgments

  • localai-org/apex-quant — Apex-Quant MoE-aware mixed-precision quantization framework
  • shuxiaoqiong/llama.cpp — Xing4.0 port fork (branch xing4_0-port) with native architecture support
  • ggerganov/llama.cpp — GGUF format specification and quantization engine
  • XingChen-AGI — Original Xing4.0-29B-A4B model creators (China Telecom / XingChen-AGI)
  • jmarceno — Community imatrix and quantization recipe reference (imatrix-Xing4.0-29B-A4B-820chunks.gguf)

📝 Known Issues & Limitations

  1. Smoke Test Output: Initial smoke testing with llama-cli returned whitespace-only output on CPU (-ngl 0) and partial GPU offload (-ngl 20). This may indicate MoE expert routing issues in certain runtime configurations. Further testing with different sampler parameters (--top-k, --min-p) and full GPU offload is recommended before production use.

  2. MTP Draft Head: The draft head at blk.40 is loaded but not executed during standard inference. Speculative decoding support depends on the inference engine's MTP implementation.

  3. Imatrix Dependency: While IQ4_XS, Q5_K, Q4_K, and Q3_K types work without imatrix, any future profiles using IQ1/IQ2 series will fail on blk.40 tensors due to missing imatrix entries for the MTP block.

📄 License

The original model XingChen-AGI/Xing4.0-29B-A4B is distributed under the Apache-2.0 license. These quantized derivatives are shared under the same license. See the original model card for full license terms and usage restrictions.

🔗 Related Links

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

llama.cpp

Можно запустить

Подбираем GPU…

Ревизия весов
1b3a961

0 моделей