Downloads · 30 days
136
4% of all-time downloads
olka-fi/Ling-3.0-flash-MXFP4
Ling-3.0-flash-MXFP4 is a text generation model from olka-fi. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
A 4-bit MXFP4 quantization of Ling-3.0-flash, produced with qstream. The routed MoE experts (~95% of the weights) are quantized to MXFP4; everything quality-sensitive stays BF16.
Downloads · 30 days
136
4% of all-time downloads
All-time downloads
3.1K
Public
Parameters
127B
77.6 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors77.6 GB · 100%
How the weights are stored.
U8121B · 95%
From the Hugging Face model README
A 4-bit MXFP4 quantization of Ling-3.0-flash, produced with qstream. The routed MoE experts (~95% of the weights) are quantized to MXFP4; everything quality-sensitive stays BF16.
The original model card follows in full below.
| Size | 77.6 GB (down from 255.0 GB BF16 source, ~30%) |
| Format | compressed-tensors mxfp4-pack-quantized (E2M1 4-bit + E8M0 group-32 scales) |
| Base | Ling-3.0-flash — 124B total / 5.1B active hybrid-linear MoE; 42 layers stacked 5:1 as 35 Kimi-Delta-Attention (KDA) + 7 gated-MLA; 512 routed experts top-8 + 1 shared; 2 dense layers; 1 MTP layer; 256K context |
Fits a single 180 GB GPU with room to spare — measured 4,611,739 tokens of KV cache
on one B200 at --gpu-memory-utilization 0.82, --max-model-len 32768.
| Component | Precision | Why |
|---|---|---|
Routed experts, layers 2–41 (model.layers.N.mlp.experts.E.{gate,up,down}_proj) | MXFP4 (4-bit) | 120.8B of 127.4B params — the only place worth the size win |
Shared expert (mlp.shared_experts.*) | BF16 | active on every token; quantizing it costs ~half the quality loss for <1% of the size |
Attention — KDA (q/k/v/f/g/b_proj, conv1d, A_log, dt_bias) and gated MLA (kv_a/kv_b, dense) | BF16 | the KDA gating projections feed a softplus/sigmoid decay gate and are the most precision-sensitive tensors in the model |
Router gate + expert_bias, dense MLP (layers 0–1) | BF16 | routing decisions are discrete; a perturbed router changes which experts fire |
| MTP layer 42 (incl. its own 512 experts) | BF16 | speculative-decoding draft path — acceptance is a prefix-run-length statistic, so drafter drift compounds |
Embeddings, lm_head, all norms | BF16 | unchanged |
61,440 tensors quantized (40 layers × 512 experts × 3 projections). Everything else is byte-identical to the source.
Weight-reconstruction relative error across all 61,440 quantized tensors:
| min | p25 | median | p75 | p95 | max | std |
|---|---|---|---|---|---|---|
| 0.1099 | 0.1115 | 0.1116 | 0.1118 | 0.1120 | 0.1215 | 0.000236 |
Per-layer relative error is flat from layer 2 (0.11177) to layer 41 (0.11152) — no layer degrades. The top 10% of tensors account for exactly 10.0% of total error, i.e. the error is diffuse: there are no "hot" experts, so selective per-expert FP8 would buy nothing. ~11.2% is the expected floor for E2M1 with group-32 scales, so this build sits at the format's limit rather than losing anything to a poor scale search.
| Benchmark | Protocol | Result |
|---|---|---|
| GSM8K | 5-shot, full 1319-problem test set | 84.4% flexible-extract · 78.9% strict-match |
| GPQA-diamond | zero-shot loglikelihood MC, all 198 | 45.5% acc / acc_norm |
These are non-thinking numbers and are not comparable to the base model's published scores, which are generated with thinking mode + CoT. They are a quantization-damage gate, not a leaderboard claim.
docker run --gpus all -d --name ling3 --ipc=host -p 8000:8000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
olkafi/vllm-bailing-v3:latest \
olka-fi/Ling-3.0-flash-MXFP4 \
--served-model-name ling3 --trust-remote-code \
--host 0.0.0.0 --port 8000 \
--gpu-memory-utilization 0.85 --max-model-len 128768 \
--enable-prefix-caching --mamba-cache-mode align \
--enable-auto-tool-choice --tool-call-parser ling3 --reasoning-parser ling3
Ling-3.0 (BailingMoeV3ForCausalLM, model_type: bailing_hybrid) needs the vendor fork
inclusionAI/vllm, branch ling_3_0. (The
base model card points at inclusionAI/vllm-ling-v3, which does not exist.) Upstream
vLLM has only BailingMoe / V2 / V2.5.
Ling-3.0 declares a per-layer clamped SwiGLU (expert_swiglu_limit_list = [0]*35 + [4]*7,
so layers 35–41 clamp at 4). vLLM's compressed-tensors MXFP4 MoE path drops that clamp:
the quant method never reads layer.swiglu_limit, the MXFP4 quant-config builder has no
parameter to receive it, and run_cutlass_moe_mxfp4 calls apply_moe_activation() with no
clamp argument. The result is unclamped SwiGLU on layers 35–41 for any MXFP4
compressed-tensors checkpoint of a model with a SwiGLU limit — the divergence is large,
not marginal (gate=10 gives silu(10)*2 = 20.0 versus silu(4)*2 = 7.84).
Apply the three files in vllm_patch/ over the fork before serving. They
are pure Python — an editable install needs no rebuild. See
vllm_patch/README.md. Models without a SwiGLU limit are
unaffected by the patch.
A prebuilt runtime image (fork + clamp patch + flashinfer-jit-cache) is published as
olkafi/vllm-bailing-v3:
docker run --gpus all -d --ipc=host -p 8000:8000 \
-e HF_HOME=/hf -v /path/with/80GB/free:/hf \
olkafi/vllm-bailing-v3:latest \
olka-fi/Ling-3.0-flash-MXFP4 \
--served-model-name ling3 --trust-remote-code \
--host 0.0.0.0 --port 8000 \
--gpu-memory-utilization 0.85 --max-model-len 32768 --max-num-seqs 256 \
--enable-prefix-caching --mamba-cache-mode align \
--kernel-config '{"moe_backend":"triton"}' \
--enable-auto-tool-choice --tool-call-parser ling3 --reasoning-parser ling3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Or with a plain vllm serve against the same fork:
vllm serve olka-fi/Ling-3.0-flash-MXFP4 \
--served-model-name ling3 --trust-remote-code \
--tensor-parallel-size 1 --gpu-memory-utilization 0.85 \
--max-model-len 262144 --max-num-seqs 256 \
--enable-prefix-caching --mamba-cache-mode align \
--kernel-config '{"moe_backend":"triton"}' \
--load-format fastsafetensors \
--enable-auto-tool-choice --tool-call-parser ling3 --reasoning-parser ling3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Three flags are load-bearing and easy to get wrong:
--enable-prefix-caching is required for --mamba-cache-mode align. Without it
vLLM silently downgrades the KDA linear-attention state cache to none, logging only a
warning.--kernel-config '{"moe_backend":"triton"}' is required whenever MTP is enabled.
Ling-3.0 routes 512 experts in 8 groups = 64 experts per group, but FlashInfer's
TRT-LLM grouped-routing kernel is warp-limited to 32. That kernel is selected for
the unquantized MoE — i.e. the BF16 MTP layer — and either raises
Routing kernel expects #experts per group <= warp size (32) ... = 64, or, on paths
where it does not raise, mis-routes experts so the drafter emits tokens the target never
accepts (0% acceptance, silently). Triton has no such constraint.--max-num-seqs 256 — the BF16 MTP head takes ~6 GB, shrinking the KDA state cache
below the default 1024 sequences, so CUDA graph capture aborts with
max_num_seqs (1024) exceeds available Mamba cache blocks (684).With all three, graph capture succeeds and --enforce-eager is not needed.
The MTP layer is deliberately kept at BF16, and it earns it — measured on this checkpoint
with num_speculative_tokens: 3 over a 200-problem GSM8K run (32,577 drafted tokens):
| Acceptance rate | 58.5% |
| Accepted per draft step | 1.756 |
| Tokens emitted per step | 2.756 (1 bonus + accepted) |
Acceptance by draft position, conditional on reaching it:
| position | conditional | cumulative |
|---|---|---|
| 0 | 95.6% | 95.6% |
| 1 | 59.0% | 56.4% |
| 2 | 42.0% | 23.7% |
95.6% at the first draft position means the BF16 drafter tracks the MXFP4 target very
closely. The falloff after it is expected rather than a defect: Ling-3.0 has a single
MTP layer (num_nextn_predict_layers: 1), so num_speculative_tokens > 1 re-runs that
one layer, and the fork warns as much at startup. num_speculative_tokens: 2 may well
beat 3 on net throughput — worth measuring for your workload.
Note MTP roughly doubles cold-start time: the draft loader re-reads the whole checkpoint to extract one layer (the MTP weights live in 2 of 24 shards, but all 24 are read).
Recommended sampling (from the base card): temperature=0.6, top_p=0.95, top_k=20,
with enable_thinking.
Built with qstream from the BF16 inclusionAI/Ling-3.0-flash
release:
qstream-quantize \
--model_dir Ling-3.0-flash \
--output_dir Ling-3.0-flash-MXFP4 \
--quant_format mxfp4 --format ct \
--include_layers '*.mlp.experts.*' \
--exclude_layers '*.layers.42.*' \
--workers 8 --device cuda
MSE-optimal scale selection (3 candidates/block, anchor percentile 99.5) with
γ-weighted activation awareness from post_attention_layernorm.
Inherits the MIT license from the base model. This is a derivative (quantized) work of inclusionAI/Ling-3.0-flash.
We're introducing Ling-3.0-flash, our next-generation native hybrid reasoning model. Operating with 124B total and 5.1B active parameters (~12.4% and ~8.1% of our previous 1T-class flagship Ring-2.6-1T), Ling-3.0-flash matches or outperforms its predecessor across key benchmarks.
<font style="color:rgb(16, 18, 20);">Key highlights of the model are summarized below:</font>

The model summary information and architecture diagram are as follows:
| Architecture | Hybrid-linear MoE |
|---|---|
| Parameter Scale | Totoal 124B, Activated 5.1B |
| Transformer Layers | 35 KDA + 7 Gated MLA (5:1) |
| Number of Dense Layers | 2 |
| Number of Routed Experts | 512 |
| Number of Shared Experts | 1 |
| Number of Activated Experts | 8 |
| Attention Heads | 32 |
| Hidden Size | 2560 |
| Expert Intermediate Size | 768 |
| Dense Intermediate Size | 6144 |
| Vocabulary Size | 157184 |
| Context Training Schedule | 8K -> 32K -> 256K |

We have conducted a comprehensive evaluation of Ling-3.0-flash across multiple authoritative benchmarks. Ling-3.0-flash performs strongly on representative code/agent benchmarks such as SWE-Bench Pro, SWE-Bench Multilingual, Tau3-banking-AA, MCP-Atlas and SkillsBench, etc. In practice, Ling-3.0-flash delivers a strong user experience across frameworks including Claude Code,Kilo Code,Qwen Code,Hermes Agent,and OpenClaw, etc. Beyond agentic tasks, Ling-3.0-flash also delivers strong performance across general knowledge,mathematical reasoning,instruction following,and long-context understanding.
<!-- 这是一张图片,ocr 内容为:DEEPSEEK CLAUDE- NEMOTRON- LING-3.0 GPT-5.4 STEP-3.7- V4-FLASH- RING-2.6-1T MINIMAX- 3-SUPER FLASH (HIGH) MINI (HIGH) FLASH (XHIGH) 120B-A12B (MAX) (MAX) 120B-A12B 124B-A5.1B 284B-A13B 198B-A11B 230B-A10B 1T-A63B SIZE CODING AGENT SWE-BENCH PRO 47.9 34.1 48.3 56.2 56.3 52.6 53.9 56.6 SWE-BENCH MULTILINGUAL 72.4 71.0 42.7 56.7 724 76.5 73.3 75.9 57.0 TERMINAL-BENCH 2.1 39.3 55.8 55.0 71.2 62.0 43.1 39.0 59.2 77.0 65.1 55.8 ARTIFACTSBENCH 66.8 64.0 51.6 68.7 25.3 19.2 MINIAPPENCH 28.0 14.8 46.3 20.7 58.8 5.8 52.2 ANTSWEBENCH 48.6 46.4 GENERAL AGENT 8.9 11.3 28.0 TAU3-BANKING-AA 11.3 10.1 22.9 14.6 30.5 55.2 53.6 69.0 65.5 MCP-ATLAS 52.6 61.2 49.4 66.7 53.5 24.9 20.3 44.8 54.4 28.4 44.8 11.9 SKILLSBENCH BFCL-V4 59.5 73.0 68.3 73.1 65.4 63.6 60.6 64.8 GDPVAL V2-AA 920 1377 1189 1017 1107 699 1159 SEARCH AGENT WIDESEARCH 75.2 70.2 62.2 73.6 19.5 74.4 56.8 79.5 72.2(W/ CTX) 74.0(W/CTX) BROWSECOMP 73.2 71.7 31.3 75.8 76.3 82.0(MA) 82.1(MA) DRACO 71.3 75.8 61.3 66.8 70.4 INSTRUCTION FOLLOWING 75.7 74.5 IFBENCH 72.6 67.3 79.2 69.0 44.6 56.6 91.4 93.6 93.3 SYSBENCH 86.5 93.9 90.7 86.2 94.9 77.3 71.3 LIFEBENCH 69.2 72.5 71.8 74.1 66.9 60.2 REASONING 91.7 94.2 AIME26 93.2 95.0 95.8 92.9 96.5 94.4 HMMT-FEB26 87.0 71.9 93.5 85.6 94.8 87.9 84.9 83.9 83.7 74.5 87.0 IMO-ANSWERBENCH 77.0 82.1 86.1 66.9 22.7 HLE 19.9 20.6 18.3 18.3 34.8 28.1 30.0 LIVECODEBENCH 82.8 78.1 80.8 87.0 75.6 83.7 78.7 91.6 (2408-2505) LONG CONTEXT & MULTI-TURN DIALOGUE 39.2 MRCR 128K 27.7 90.1 56.1 40.8 90.8 92.5 88.5 92.7 81.1 MRCR 256K 25.7 76.5 50.5 35.8 84.3 70.7 AA-LCR 65.1 64.3 68.7 63.7 63.0 58.3 63.4 89.3 MULTI-IF 86.2 87.7 82.9 84.6 84.8 82.3 84.6 -->
- Thinking mode is enabled by default. Unless otherwise specified, the default parameters for Ling-3.0-flash are as follows:
temperature=0.6, top_p=0.95, top_k=20.- <font style="color:rgb(16, 18, 20);">SWE-Bench Series:Evaluated using OpenHands as the agent harness with tailored prompts. Decoding uses </font>
temperature=0.6, top_p=0.95, max_new_tokens=32K<font style="color:rgb(16, 18, 20);">, with a 256K context window.</font>- <font style="color:rgb(16, 18, 20);">Terminal-Bench 2.1: Evaluated under the Artificial Analysis (AA) protocol using the default Terminus 2 harness, a unified 2-hour timeout, the provided JSON parser in preserve-thinking mode, and 3 runs per task (mean). Decoding uses </font>
temperature=0.6, top_p=1.0, max_new_tokens=32K<font style="color:rgb(16, 18, 20);">, with a 256K context window.</font>- <font style="color:rgb(16, 18, 20);">MiniAppBench: A 500-task coding benchmark evaluating whether models can turn a single user request into complete, usable interactive HTML apps in real-world application-generation scenarios. Evaluated with
temperature=1.0, top_p=1.0, max_tokens=128K.- <font style="color:rgb(16, 18, 20);">AntSWEBench: </font><font style="color:rgb(0, 0, 0);">AntSWEBench is an internally used software engineering benchmark that covers mainstream programming languages such as Java, JavaScript, and Python, including various development scenarios like new feature, bug fix, and code refactoring.</font>
- <font style="color:rgb(16, 18, 20);">Tau3-banking-AA: Aligned with the AA leaderboard, utilizing GPT-5.4-mini (medium reasoning) for both the user simulator and the natural-language assertion judge.</font>
- MCP-Atlas: Evaluated on the 500-task public set using the official v1 harness with a 20-turn limit and Gemini-2.5-Pro as the claim-coverage judger.
- SkillsBench: Evaluated via kilo-code on 87 tasks (excluding external API-dependent tasks), averaged over 3 runs.
- <font style="color:rgb(16, 18, 20);">GDPval v2-AA : Evaluated on the public 220-task benchmark using the official Stirrup harness, with a 250-turn limit and a 5-hour timeout.</font>
- <font style="color:rgb(16, 18, 20);">Search‑agent:For all search‑agent tasks, evaluations are performed using an internal harness. The basic ReAct paradigm is adopted for single-agent evaluation, while a multi-agent setup is employed for BrowseComp. The reported metric is the average pass@1.</font>
- <font style="color:rgb(16, 18, 20);">WideSearch: Evaluated using the official prompt and the official judge model GPT-4.1 on the corrected version of the dataset.</font>
- <font style="color:rgb(16, 18, 20);">Draco: Scored based on official rubrics per question, with the final score calculated as the average across all questions using </font>Claude Opus 4.6<font style="color:rgb(16, 18, 20);"> as the scoring model.</font>
- BrowseComp (Single-Agent): Evaluated using a resume strategy for context management: once the context reaches a 64K-token threshold, the trajectory is summarized, the original history is discarded, and execution is resumed from the summary.
- BrowseComp (Multi-Agent):<font style="color:rgb(16, 18, 20);"> Evaluated on English and ZH Revised datasets using an internal multi-agent search harness based on SearchSwarm/Tongyi DeepResearch, configured with </font>
temperature=0.85, top_p=0.95, max_tokens=8K<font style="color:rgb(16, 18, 20);">, and main/sub-agent context windows of 128K and 64K, respectively.</font>
pip install uv
uv venv ~/my_ling_env
source ~/my_ling_env/bin/activate
git clone -b ling_v3_support https://github.com/inclusionAI/sglang_ling_v3.git
cd sglang_ling_v3
pip install --upgrade pip
pip install -e "python"
Here is an example to run Ling-3.0-flash with 4 GPUs, where the master node IP is ${MASTER_IP} and server port is ${PORT}:
Server
Since the model is trained with MTP, we recommend enabling MTP during inference (i.e., --speculative-algorithm NEXTN) for lower latency.
export SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
export SGLANG_JIT_DEEPGEMM_PRECOMPILE=1
export SGLANG_ENABLE_SPEC_V2=1
python -m sglang.launch_server \
--model-path $MODEL_PATH \
--dist-init-addr $MASTER_IP:2345 \
--port $PORT \
--nnodes 1 \
--mem-fraction-static 0.8 \
--max-running-requests 64 \
--tp-size 4 \
--chunked-prefill-size 8192 \
--tool-call-parser ling3 \
--reasoning-parser ling3 \
--context-length 262144 \
--speculative-algorithm NEXTN \
--max-mamba-cache-size 320 \
--enable-fp32-lm-head \
--disable-shared-experts-fusion
Client
We recommend using the sampling parameters temperature=0.6, top_p=0.95, and top_k=20, and enabling enable_thinking for better performance.
curl -s http://${MASTER_IP}:${PORT}/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "auto",
"messages": [{"role": "user", "content": "hello!"}],
"chat_template_kwargs": {"enable_thinking": true},
"stream": true,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95
}'
pip install uv
uv venv ~/my_ling_env
source ~/my_ling_env/bin/activate
git clone -b ling_3_0 https://github.com/inclusionAI/vllm-ling-v3.git
cd vllm-ling-v3
VLLM_USE_PRECOMPILED=1 uv pip install --editable . --torch-backend=auto
Here is the example to run Ling-3.0-flash with 4 GPUs, where the server port is ${PORT}:
Server
Since the model is trained with MTP, we recommend enabling MTP during inference (i.e., --speculative-config) for lower latency.
vllm serve "$MODEL_PATH" \
--port "$PORT" \
--trust-remote-code \
--served-model-name auto \
--tensor-parallel-size 4 \
--gpu-memory-utilization 0.85 \
--enable-prefix-caching \
--mamba-cache-mode align \
--enable-auto-tool-choice \
--tool-call-parser ling3 \
--reasoning-parser ling3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Client
We recommend using the sampling parameters temperature=0.6, top_p=0.95, and top_k=20, and enabling enable_thinking for better performance.
curl -s http://${MASTER_IP}:${PORT}/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "auto",
"messages": [{"role": "user", "content": "hello!"}],
"chat_template_kwargs": {"enable_thinking": true},
"stream": true,
"temperature": 0.6,
"top_k": 20,
"top_p": 0.95
}'