Local & Offline
~9 min readUpdated: December 2026

Xing4.1-Preview NVFP4: 285B-A17B MoE Agent Serving in 144 GB VRAM

Xing4.1-Preview NVFP4 285B-A17B Sparse MoE Agent Inference Architecture in Smoke Monkey

XingChen-AGI/Xing4.1-Preview-NVFP4 quantizes the 285B-A17B Xing4.1-Preview Sparse MoE (45 layers, MLA + DeepSeek Sparse Attention, 1M YaRN context) into 4-bit group-16 NVFP4 weights (144 GB total safetensors) while preserving BF16 self-attention, dense layers 0-2, and router gates.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

Xing4.1-Preview NVFP4: 285B-A17B MoE Agent Serving in 144 GB VRAM: XingChen-AGI/Xing4.1-Preview-NVFP4 quantizes the 285B-A17B Xing4.1-Preview Sparse MoE (45 layers, MLA + DeepSeek Sparse Attention, 1M YaRN context) into 4-bit group-16 NVFP4 weights (144 GB total safetensors) while preserving BF16 self-attention, dense layers 0-2, and router gates. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Examplexing4-1-nvfp4-coding-agent.ts
xing4-1-nvfp4-coding-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
const xingAgent = createAgent({
agentId: 'xing4-1-nvfp4-staff-coder',
provider: 'openai-compatible',
model: 'Xing4.1-Preview-NVFP4',
baseUrl: 'http://localhost:8000/v1',
workspacePath: process.cwd(),
temperature: 0.8,
permissions: {
read_file: 'allow',
write_file: 'allow',
run_command: 'ask',
},
});
async function refactorMonorepo() {
const result = await xingAgent.run(
'Inspect the 120K-token backend trace, isolate the async race condition in the worker pool, write a regression test, and verify with npm test.'
);
console.log('Xing4.1-Preview NVFP4 Result:', result.summary);
}
refactorMonorepo().catch(console.error);
Video Guides

Watch: Related Video Guides

How inference works at scale? vLLM and SGLang inference engines

What is vLLM? Efficient AI Inference for Large Language Models

What Is Xing4.1-Preview NVFP4? Mixed-Precision MoE Architecture

XingChen-AGI/Xing4.1-Preview-NVFP4 is the 4-bit floating-point quantized release of China Telecom's 285B-total / 17B-active Sparse Mixture-of-Experts model (DeepseekV32ForCausalLM, Apache 2.0). Originally trained on 8,192 Ascend 910C chips with MindSpore, Xing4.1-Preview adopts a wide-and-shallow 45-layer topology (hidden_size=4096, num_attention_heads=128, 256 routed experts with top-8 activation plus 1 shared expert) paired with Multi-head Latent Attention (MLA) and DeepSeek Sparse Attention (DSA).

Instead of naively quantizing every tensor, the NVFP4 checkpoint (144,009,019,904 bytes across 31 safetensors shards) applies num_bits=4, type='float', group_size=16 static FP4 quantization solely to routed MoE MLP linear layers in layers 3–44, leaving 15.96B parameters in BF16 across sensitive routing, attention, and early dense layers.

Layer / Tensor GroupPrecision in NVFP4 CheckpointRationale & Parameter Count
Routed MoE Linear Experts (L3–L44)NVFP4 (`group_size=16`, `U8` packed)270.58B 4-bit stored weights; cuts expert memory ~4x
Layers 0–2 (`first_k_dense_replace=3`)BF16Preserves early feature representation fidelity
Attention (`self_attn*`) & MLA ProjectionsBF16Protects q_lora_rank=1536, kv_lora_rank=512, index_topk=2048
Router Gates (`mlp.gate`) & `shared_experts`BF16Prevents expert-routing collapse across 256 experts
Embeddings & `lm_head`BF16Protects 131,072-token custom agent/code vocabulary

Coding, Reasoning & Agent Harness Benchmarks

Evaluated across agentic coding harnesses (OpenCode, mini-swe-agent, terminus-2, and Claude Code), Xing4.1-Preview matches or beats larger Flash-tier MoE baselines while using 16% fewer tokens on agent trajectories and 23% fewer tokens on code via domain-merged BPE vocabulary.

Benchmark (Harness)Xing4.1-PreviewDeepSeek-V4-Flash-0731GLM-5.3-Flash
SWE-Bench Pro V2 (Hard51)74.5%60.8%72.7%
Terminal-Bench 2.180.8% (terminus-2)82.7%84.3%
Terminal-Bench 4.0 (mini-swe-agent)28.7%12.1%32.8%
Terminal-Bench-Science 0.112.9%4.3%4.8%
SciCode53.95%50.0%52.0%
AutomationBench v1.0.652.3%38.8%48.8%
Claw-Eval (text-only)80.58%79.49%79.24%
MMLU-Pro / GPQA Diamond / AIME 202685.2 / 89.34 / 92.085.18 / 90.7 / 98.587.58 / 88.8 / 88.0

Engine Compatibility: SGLang & vLLM vs llama.cpp

Because Xing4.1-Preview switches from Xing4.0's architecture to MLA + DeepSeek Sparse Attention (`DeepseekV32ForCausalLM`), `llama.cpp` and `KTransformers` Xing4.0 loaders do NOT support Xing4.1-Preview. Use SGLang (`main` branch) or vLLM with the official `xing4-vllm-plugin`.

Serving Xing4.1-Preview NVFP4 with SGLang and vLLM

Whereas BF16 Xing4.1-Preview demands ~640 GB of VRAM (--tensor-parallel-size 8 on 80 GB GPUs), the 144 GB NVFP4 checkpoint fits cleanly across 2x80 GB H100/H200 GPUs (--tp-size 2) or a single NVIDIA B200 (192 GB) with room for long-context KV caches (YaRN factor=32.0, original_max_position_embeddings=32768, up to 1,048,576 tokens).

bash
# Serve via SGLang (native main branch support) with tool-call & reasoning parsers
sglang serve --model-path XingChen-AGI/Xing4.1-Preview-NVFP4 \
  --trust-remote-code \
  --host 0.0.0.0 --port 8000 \
  --served-model-name Xing4.1-Preview-NVFP4 \
  --tp-size 2 \
  --mem-fraction-static 0.90 \
  --max-running-requests 8 \
  --reasoning-parser xing4_0 \
  --tool-call-parser xing4_0
bash
# Serve via vLLM (requires XingChen-AGI/xing4-vllm-plugin)
vllm serve XingChen-AGI/Xing4.1-Preview-NVFP4 \
  --host 0.0.0.0 --port 8000 \
  --served-model-name Xing4.1-Preview-NVFP4 \
  --tensor-parallel-size 2 \
  --trust-remote-code \
  --gpu-memory-utilization 0.90 \
  --enable-auto-tool-choice \
  --reasoning-parser xing4_0 \
  --tool-call-parser xing4_0

Use temperature=0.8, top_p=0.95, repetition_penalty=1.05 for coding/agent loops, or temperature=1.0 for deep math/reasoning.

Running Autonomous Long-Context Loops in Smoke Monkey Harness

Pointing Smoke Monkey Harness at your local SGLang http://localhost:8000/v1 endpoint gives engineering agents 1M-token repository visibility, native xing4_0 tool-call parsing, and 17B active parameters per token without per-token API bills. Keep thinking mode enabled during architecture planning and toggle it off for high-speed file edits.

Google Search Questions & Answers

Frequently Asked Questions

Q:How much VRAM is required to serve Xing4.1-Preview-NVFP4?

The safetensors checkpoint totals 144.0 GB (15.96B BF16 parameters + 270.58B 4-bit U8 packed weights). It runs on 2x80 GB H100/A100 GPUs (`--tp-size 2`) or a single 192 GB NVIDIA B200, down from 8x80 GB required by BF16.

Q:Which layers are kept in BF16 inside Xing4.1-Preview-NVFP4?

According to `config.json`, `lm_head`, `model.embed_tokens`, dense layers 0–2, and all `self_attn`, `mlp.gate`, and `shared_experts` modules across layers 10–44 remain unquantized to preserve routing and MLA/DSA precision.

Q:Can I run Xing4.1-Preview-NVFP4 in llama.cpp or KTransformers?

No. Those loaders only support the older Xing4.0 architecture. Xing4.1-Preview uses MLA + DeepSeek Sparse Attention (`DeepseekV32ForCausalLM`) and requires SGLang (main branch), vLLM (with `xing4-vllm-plugin`), or ms-swift v4.6+.

Q:What sampling parameters work best for coding agents on Xing4.1-Preview?

China Telecom recommends `temperature=0.8, top_p=0.95, repetition_penalty=1.05` for agent and code generation tasks, and `temperature=1.0` for pure reasoning benchmarks.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness