Downloads · 30 days
123
2% of all-time downloads
olka-fi/Ling-3.0-flash-NVFP4
Ling-3.0-flash-NVFP4 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 NVFP4 quantization of Ling-3.0-flash, produced with qstream. The routed MoE experts (~95% of the weights) are quantized to NVFP4; everything quality-sensitive stays BF16.
Downloads · 30 days
123
2% of all-time downloads
All-time downloads
5.9K
Public
Parameters
127B
81.4 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors81.4 GB · 100%
How the weights are stored.
U8121B · 95%
From the Hugging Face model README
A 4-bit NVFP4 quantization of Ling-3.0-flash, produced with qstream. The routed MoE experts (~95% of the weights) are quantized to NVFP4; everything quality-sensitive stays BF16.
The original model card follows in full below.
Speculative decoding (MTP) needs specific flags and a vLLM patch
It works well — 56.5% acceptance, 2.70 tokens per decode step (94.3% at draft position 0) — but NVFP4 needs more setup than the MXFP4 build does:
--kernel-config '{"moe_backend":"marlin"}' --max-num-seqs 256plus the
unquantized.pypatch invllm_patch/. Why each is needed:
marlinis the only MoE backend supporting weight-only NVFP4A16.tritonis rejected outright;cutlassandflashinfer_cutlassreject the scheme (QuantKey(u8,scale(f8e4m3fn,...))).- The patch exists because
moe_backendis a single global setting, while this checkpoint has two MoE kinds: NVFP4 routed experts (need marlin) and the BF16 MTP layer (marlin has no unquantized kernel →moe_backend='marlin' is not supported for unquantized MoE). The patch routes unquantized MoE to Triton, mirroring the existinghummingprecedent. Triton also avoids FlashInfer TRT-LLM's grouped-routing kernel, which is warp-limited to 32 experts per group — Ling-3.0 has 64 (512 experts / 8 groups) and either crashes there or silently mis-routes.--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 withmax_num_seqs (1024) exceeds available Mamba cache blocks (684).Acceptance by draft position (conditional): 94.3% / 57.2% / 39.7%. The falloff is expected — Ling-3.0 has a single MTP layer re-run per speculative token — so
num_speculative_tokens: 2may beat 3 on net throughput. MTP also roughly doubles cold start: the draft loader re-reads the whole checkpoint to extract one layer.With all of the above, graph capture succeeds and
--enforce-eageris not needed. If you served this checkpoint before 2026-08-05, re-pullconfig.json— the earlier one let the layer-agnostic targets regex claim the MTP layer's BF16 experts as NVFP4, giving a silently broken drafter (0% acceptance, no error).
| Size | 81.4 GB (down from 255.0 GB BF16 source, ~32%) |
| Format | compressed-tensors nvfp4-pack-quantized (E2M1 4-bit + FP8-E4M3 group-16 scales + per-tensor global scale) |
| 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 |
Most people should take the MXFP4 build instead. NVFP4 reconstructs the weights substantially more faithfully, and that advantage does not show up downstream:
| MXFP4 | NVFP4 (this repo) | |
|---|---|---|
| Size | 77.6 GB | 81.4 GB |
| Median weight rel. error | 0.111618 | 0.086498 (−22.5%) |
| GSM8K 5-shot, full 1319, flexible-extract | 84.38% ±1.00 | 83.17% ±1.03 |
| GSM8K 5-shot, full 1319, strict-match | 78.85% ±1.12 | 78.39% ±1.13 |
Both GSM8K gaps are under 1.2σ — the two builds are statistically indistinguishable on this benchmark despite NVFP4's much lower weight error. At this magnitude, 4-bit reconstruction error is already below what GSM8K can resolve. NVFP4 is published for comparison and for anyone wanting the more faithful weights (e.g. for longer-generation or harder tasks where the difference may still surface); MXFP4 is the smaller, better- tested release.
| Component | Precision | Why |
|---|---|---|
Routed experts, layers 2–41 (model.layers.N.mlp.experts.E.{gate,up,down}_proj) | NVFP4 (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 — see the MTP warning above |
Embeddings, lm_head, all norms | BF16 | unchanged |
61,440 tensors quantized (40 layers × 512 experts × 3 projections), each with a packed weight, an FP8-E4M3 group scale and a per-tensor global scale.
Weight-reconstruction relative error, 960-tensor stratified sample (24 per layer, expert ids strided across the full 512 range, all 40 layers):
| min | p25 | median | p75 | p95 | max | std |
|---|---|---|---|---|---|---|
| 0.086332 | 0.086459 | 0.086498 | 0.086556 | 0.086652 | 0.086742 | 0.000073 |
NVFP4's worst sampled tensor (0.0867) is better than MXFP4's best (0.1099) — the two distributions are disjoint. Two effects compound: group 16 rather than 32 halves how many weights share a scale, and FP8-E4M3 scales are continuous where MXFP4's E8M0 scales are powers of two, so an MXFP4 block whose ideal scale falls between 2^k and 2^(k+1) must round and waste up to 2× of range.
--speculative-config.gdn_attn.py:382 → CUDA error: invalid argument). Without a draft model, capture succeeds and --enforce-eager is not needed._prune_ignore fix. Earlier qstream generalised ignore
entries by layer index, so excluding the MTP layer emitted
re:.*layers\.\d+\.mlp\.experts\.\d+\.gate_proj$ — which also ignored the quantized
experts in all 40 other layers. vLLM checks should_ignore_layer before target
matching, so every expert silently resolved to unquantized and the loader tried to
allocate BF16 buffers for ~242 GB of weights (OOM with no useful error). The
config.json in this repo is already correct.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/NVFP4 MoE path drops that
clamp: the quant method never reads layer.swiglu_limit, the 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 — 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, so an editable install needs no rebuild. See
vllm_patch/README.md.
A prebuilt runtime image carrying the fork, both patches and flashinfer-jit-cache.
NVFP4 + MTP requires the nvfp4 tag or newer latest — earlier images lack the
unquantized MoE oracle patch and will fail to start with
moe_backend='marlin' is not supported for unquantized MoE. (The image itself is
model-agnostic and serves both builds; the tag just marks the build that added this.)
Weights are pulled from the Hub, so mount a cache directory on a volume with ≥85 GB free (without it the download lands in the container's writable layer and will fill your root filesystem):
docker run --gpus all -d --name ling3 --ipc=host -p 8000:8000 \
-e HF_HOME=/hf -v /path/with/85GB/free:/hf \
olkafi/vllm-bailing-v3:nvfp4 \
olka-fi/Ling-3.0-flash-NVFP4 \
--served-model-name ling3 --trust-remote-code \
--host 0.0.0.0 --port 8000 \
--gpu-memory-utilization 0.85 --max-model-len 16384 --max-num-seqs 256 \
--enable-prefix-caching --mamba-cache-mode align \
--kernel-config '{"moe_backend":"marlin"}' \
--enable-auto-tool-choice --tool-call-parser ling3 --reasoning-parser ling3 \
--speculative-config '{"method":"mtp","num_speculative_tokens":3}'
Drop --speculative-config to serve without MTP; --kernel-config and
--max-num-seqs 256 are then optional, and --max-model-len can go much higher (32K+).
Add --load-format fastsafetensors for faster weight loading.
--enable-prefix-caching is required for --mamba-cache-mode align to take effect —
without it vLLM silently downgrades the KDA linear-attention state cache to none and
only logs a warning.
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-NVFP4 \
--quant_format nvfp4 --nvfp4_mse --format ct \
--include_layers '*.mlp.experts.*' \
--exclude_layers '*.layers.42.*' \
--workers 8 --device cuda
--nvfp4_mse searches neighbouring E4M3 group scales and keeps the minimum-reconstruction-
error one, with γ-weighted activation awareness from post_attention_layernorm.
GSM8K figures above are 5-shot over the full 1319-problem test set via /v1/completions
with plain few-shot prompting — a non-thinking protocol. They are not comparable to the
base model's published scores, which are generated with thinking mode + CoT. They exist to
bound quantization damage, not as leaderboard claims.
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
}'