Instructions to use XingChen-AGI/Xing4.0-29B-A4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XingChen-AGI/Xing4.0-29B-A4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XingChen-AGI/Xing4.0-29B-A4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("XingChen-AGI/Xing4.0-29B-A4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XingChen-AGI/Xing4.0-29B-A4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XingChen-AGI/Xing4.0-29B-A4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XingChen-AGI/Xing4.0-29B-A4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XingChen-AGI/Xing4.0-29B-A4B
- SGLang
How to use XingChen-AGI/Xing4.0-29B-A4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "XingChen-AGI/Xing4.0-29B-A4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XingChen-AGI/Xing4.0-29B-A4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "XingChen-AGI/Xing4.0-29B-A4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XingChen-AGI/Xing4.0-29B-A4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XingChen-AGI/Xing4.0-29B-A4B with Docker Model Runner:
docker model run hf.co/XingChen-AGI/Xing4.0-29B-A4B
Xing4.0-29B-A4B
From "answering questions" to "getting things done" β an agentic MoE flagship
with 29B total / 4B active parameters and a native 256K context.
π¦ GitHub β’ π€ Hugging Face Org β’ π€ ModelScope β’ πͺ Modelers β’ β‘ vLLM Plugin β’ βοΈ Tianyi AI Platform
Pick a build: BF16 (this repo) β’ FP8 β’ GGUF (2β8-bit, 11β34 GB, runs in llama.cpp) β’ W8A8
Contents
- Introduction
- Model at a Glance
- Highlights
- Architecture
- Benchmarks
- Quickstart
- Recommended Parameters
- Evaluation Details
- Citation
- Acknowledgments
Introduction
Xing4.0-29B-A4B is a next-generation large language model in the Xing series (formerly TeleChat), developed by China Telecom Artificial Intelligence Technology Co., Ltd. With 29B total parameters and only 4B activated per token, it natively supports a 256K context length, extensible to 512K. It was trained end-to-end on a fully in-house stack β from silicon to software β and is deeply optimized for complex engineering tasks: long-context planning, multi-step reasoning, tool calling, and structured output.
For full project documentation, deployment guides, and fine-tuning recipes, visit the GitHub repository.
Model at a Glance
| Total parameters | 29B |
| Activated parameters per token | 4B (~13.8% activation) |
| Architecture | MoE Β· mHC + MLA + MTP |
| Context length | 256K native, extensible to 512K |
| Training corpus | 1.5 trillion high-quality bilingual (ZH/EN) tokens |
| Open weights | BF16 (this repo) β’ FP8 β’ GGUF |
| License | Apache 2.0 |
Highlights
- Agent-oriented architecture β built on the mHC + MLA + MTP architecture, supporting multi-step planning, tool calling, and complex reasoning-chain execution, ensuring task coherence and execution stability under long contexts.
- Deep softwareβhardware co-optimization β adapted to domestic NPU clusters with a fully in-house training framework, including mHC feature adaptation and fused-operator development, enabling stable and efficient training at scale.
- ~96% training throughput gain β fine-grained MoE communication optimization, selective recomputation, automatic graphβoperator fusion, and hand-tuned fused mHC kernels lifted overall training throughput by approximately 96% over out-of-the-box performance.
- Native in the open ecosystem β fine-tuning via ms-swift (v4.6.0+) and LLaMA-Factory (main branch) merged upstream; serving via SGLang (main branch) and the official vLLM plugin; local GGUF inference via llama.cpp (b12174+); format-aligned with agent frameworks such as OpenCode, Claude Code, OpenClaw, and Hermes for out-of-the-box workflows.
- Easy adaptation for domain scenarios β lightweight customization on proprietary data for intent classification, table understanding, contract auditing, and knowledge-based QA, for rapid and low-cost domain capability deployment.
Architecture
| Xing4.0-29B-A4B | |
|---|---|
| Parameters | 29B (4B active) |
| Number of Layers | 40 |
| Hidden Size | 3584 |
| Dense FFN Intermediate Size | 9216 |
| Expert Intermediate Size | 1024 |
| Attention Type | MLA |
| Number of Routed Experts | 64 |
| Active Experts per Token | 4 |
| Number of Shared Experts | 1 |
| Context Length | 256K (extensible to 512K) |
Benchmarks
Head-to-head with same-class open agentic models:
| Benchmark | Xing4.0-29B-A4B | Gemma4-26B-A4B | Qwen3.6-35B-A3B |
|---|---|---|---|
| IFBench | 69.67 | 72.67 | 65.50 |
| AIME2026 | 90.00 | 88.30 | 92.70 |
| AA.LCR | 61.00 | 66.00 | 62.00 |
| Tau3-Bench | 64.63 | 58.90 | 67.20 |
| Claw-Eval | 76.55 | 71.49 | 74.54 |
| SWE-bench Verified | 75.00 | 53.00 | 76.00 |
| Terminal-Bench 2.1 | 57.50 | 30.00 | 51.50 |
| SWE-bench Multilingual | 66.00 | 51.00 | 67.20 |
| DeepresearchBII | 60.80 | 39.30 | 59.70 |
Bold marks the best score in each benchmark.
- Coding agent β 75.0 on SWE-bench Verified (approaching Qwen3.6-35B-A3B's 76.0, far ahead of Gemma4-26B-A4B's 53.0), 66.0 on SWE-bench Multilingual, and a clear lead on Terminal-Bench 2.1 (57.5 vs 51.5 / 30.0).
- General agent β best in this comparison on Claw-Eval (76.55) and DeepresearchBII (60.80), with 64.63 on Tau3-Bench.
Quickstart
Inference
Xing4.0-29B-A4B can be accessed via an OpenAI-compatible API.
from openai import OpenAI
client = OpenAI(
base_url="your-base-url",
api_key="your-api-key",
)
completion = client.chat.completions.create(
model="Xing4.0-29B-A4B",
messages=[{"role": "user", "content": "Briefly explain the basic principles of quantum computing."}],
temperature=1.0,
top_p=0.95,
extra_body={
"repetition_penalty": 1.05,
"skip_special_tokens": False,
"spaces_between_special_tokens": False,
"chat_template_kwargs": {
"enable_thinking": True, # Set to False to disable thinking
},
},
)
print(completion.choices[0].message.content)
Serving & Ecosystem
Xing4.0-29B-A4B runs across serving stacks with different integration levels (as of 2026-11-10):
| Stack | Xing4.0 support | Since | How to run |
|---|---|---|---|
| SGLang | Native β main branch | 2026-11-05 | Install from any recent main build; plugin for older versions |
| llama.cpp | Native GGUF β b12174+ | 2026-11-05 | Stock build b12174+ on CPU / CUDA with Xing4.0-29B-A4B-GGUF |
| vLLM | Official out-of-tree plugin | β | XingChen-AGI/xing4-vllm-plugin |
| TensorRT-LLM Β· KTransformers | PR under upstream review | β | Install from the PR branch (see the GitHub README) |
Prebuilt container images and step-by-step deployment guides are listed in the GitHub repository.
Recommended Parameters
| Scenario | temperature | top_p | repetition_penalty |
|---|---|---|---|
| Complex reasoning / general tasks | 1.0 | 0.95 | 1.05 |
| Coding / agent tasks | 0.8 | 0.95 | 1.05 |
Evaluation Details
- SWE-bench Verified: We evaluate Xing4.0-29B-A4B using the
SWE-agentharness withtemperature=1.0, top_p=0.95, repetition_penalty=1.05and a210K context window. - Terminal-Bench 2.1: We evaluate in
terminus-2withtemperature=0.8, top_p=0.95, repetition_penalty=1.05, max_tokens=64Kand a24-hour timeout. We report the average score over3runs. - SWE-bench Multilingual: We evaluate Xing4.0-29B-A4B using the
SWE-agentharness withtemperature=1.0, top_p=0.95, repetition_penalty=1.05and a210K context window. - Claw-Eval: We evaluate using the official harness with
temperature=0.8, top_p=0.95, repetition_penalty=1.05, max_tokens=16384and a 256K context window. We report the average score over3runs. - Tau3-Bench: We evaluate using the official harness with
temperature=0.8, top_p=0.95, repetition_penalty=1.05, max_tokens=16384. We report the average pass^1 over4runs. - DeepresearchBII: We evaluate using the
OpenCodeharness withtemperature=0.8, top_p=0.95, repetition_penalty=1.05, max_tokens=32768and a256K context window, with Exa MCP server enabled. - AIME2026: We evaluate with
temperature=1.0, top_p=0.95, repetition_penalty=1.05, max_tokens=131072. We report the average score over 5 independent runs. - IFBench: We evaluate with
temperature=0.8, top_p=0.95, repetition_penalty=1.05, max_tokens=81920. - AA.LCR: We evaluate with
temperature=1.0, top_p=0.95, repetition_penalty=1.05, max_tokens=65536. We report the average score over3runs.
Citation
@misc{liu2025trainingreporttelechat3moe,
title={Training Report of TeleChat3-MoE},
author={Xinzhang Liu and Chao Wang and Zhihao Yang and Zhuo Jiang and Xuncheng Zhao and Haoran Wang and Lei Li and Dongdong He and Luobin Liu and Kaizhe Yuan and Han Gao and Zihan Wang and Yitong Yao and Sishi Xiong and Wenmin Deng and Haowei He and Kaidong Yu and Yu Zhao and Ruiyu Fang and Yuhao Jiang and Yingyan Li and Xiaohui Hu and Xi Yu and Jingqi Li and Yanwei Liu and Qingli Li and Xinyu Shi and Junhao Niu and Chengnuo Huang and Yao Xiao and Ruiwen Wang and Fengkai Li and Luwen Pu and Kaipeng Jia and Fubei Yao and Yuyao Huang and Xuewei He and Zhuoru Jiang and Ruiting Song and Rui Xue and Qiyi Xie and Jie Zhang and Zilu Huang and Zhaoxi Zhang and Zhilong Lu and Yanhan Zhang and Yin Zhang and Yanlei Xue and Zhu Yuan and Teng Su and Xin Jiang and Shuangyong Song and Yongxiang Li and Xuelong Li},
year={2025},
eprint={2512.24157},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2512.24157},
}
@misc{wang2025technicalreporttelechat2telechat25,
title={Technical Report of TeleChat2, TeleChat2.5 and T1},
author={Zihan Wang and Xinzhang Liu and Yitong Yao and Chao Wang and Yu Zhao and Zhihao Yang and Wenmin Deng and Kaipeng Jia and Jiaxin Peng and Yuyao Huang and Sishi Xiong and Zhuo Jiang and Kaidong Yu and Xiaohui Hu and Fubei Yao and Ruiyu Fang and Zhuoru Jiang and Ruiting Song and Qiyi Xie and Rui Xue and Xuewei He and Yanlei Xue and Zhu Yuan and Zhaoxi Zhang and Zilu Huang and Shiquan Wang and Xin Wang and Hanming Wu and Mingyuan Wang and Xufeng Zhan and Yuhan Sun and Zhaohu Xing and Yuhao Jiang and Bingkai Yang and Shuangyong Song and Yongxiang Li and Zhongjiang He and Xuelong Li},
year={2025},
eprint={2507.18013},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2507.18013},
}
Acknowledgments
Xing4.0-29B-A4B is better because of the open-source community. This section is our way of saying thanks β and we will keep adding names as the community grows.
Inference, training, and tooling. Thank you to the maintainers of vLLM, SGLang, KTransformers, TensorRT-LLM, and llama.cpp, and to the wider MLX ecosystem β for building inference stacks open enough to carry an architecture combination like ours, and for keeping them that way. Support for Xing4.0 has also landed in ms-swift, GPTQModel, and unsloth-zoo, and in LocalAI's gallery. Thank you to their maintainers.
Community quants and ports. Special thanks to the community members who did real work on this model and published it for everyone:
- @kingjones777 β AMD ROCm builds with public recipes and hashes, and detailed reports that made the ROCm path work end to end.
- Venastine Research β four GGUF tiers, including an 11.6 GB build that puts the model within reach of 16 GB cards, with a fully documented imatrix recipe.
- @jmarceno β an independently recomputed imatrix and a 3.31 BPW quant, with the recipe and hashes published.
- @TokenAI-zer β an MLX implementation verified to near-exact logit parity, and precise issue reports on the reference implementation.
- @nativ-community β an MLX 8-bit port with token-level fidelity verification, with upstream work now merged in mlx-vlm.
- The FlagOS project β multi-accelerator builds of the model.
We are also grateful to the teams and individuals who fine-tuned Xing4.0 for domain work β finance, official document writing, roleplay, meeting minutes, rewriting, information extraction β and published those weights for others to build on.
If you have ported, quantized, evaluated, or fixed Xing4.0 and are not on this list β thank you. Open a discussion and let us know; we will add you.
Evaluation tooling. Our benchmark numbers rest on harnesses built and maintained by the SWE-agent, Terminal-Bench, tau-bench, and Claw-Eval teams, along with research tooling from Exa. We are grateful for the infrastructure that makes open model evaluation possible.
China Telecom Artificial Intelligence Technology Co., Ltd.
More open models from XingChen-AGI
- Downloads last month
- 5,750