124B Multimodal Medical MoE (5.5B Active), Quantized for 4× 24GB GPUs with Full 256K Context
*Fits 100% in VRAM on 4× RTX 3090 (96 GB) with Vision, Reasoning (ling3), Tool Calling (ling3), and 286K lossless BF16 KV cache, hitting 138.9 tok/s decode at 1K and 99.9 tok/s at 200K.*
| Spec | Value |
|---|---|
| Base Checkpoint | inclusionAI/LingSante-3.1-air-VL (BailingMoeV3VLForConditionalGeneration, MIT) |
| Total / Active Params | 124.85B total / 5.5B active per token (42 layers: 35 KDA linear attn + 7 Gated MLA, 512 routed experts) |
| Quantization Scheme | compressed-tensors pack-quantized · Symmetric INT4 W4A16, group_size=32, per-group MSE-optimal clipping |
| What Is Quantized | Routed MoE experts only (61,440 tensors = 96.75% of parameters) |
| Kept in Untouched BF16/F32 | Vision encoder (qwen3_moe_vit), projector, embeddings, lm_head, 2 dense MLPs, 40 shared experts, 40 routers, all 35 KDA + 7 MLA attention layers (1,123 tensors = 7.55 GiB) |
| Checkpoint Size | 70.85 GiB (down from 232.55 GiB BF16, 3.28× smaller) |
| Min Hardware (Full VRAM) | 4× 24 GB GPUs (TP=4, 18.4 GiB/GPU weights), verified on 4× RTX 3090 (sm_86) |
| Verified Features | Native Vision OCR & imaging · Reasoning (--reasoning-parser ling3) · Tool Calling (--tool-call-parser ling3) · 262,144 context via YaRN 2× |
The upstream release of LingSante-3.1-air-VL ships BF16 only (250 GB), requiring 4× 80-141 GB datacenter GPUs.
Because 96.75% of the model's parameters live inside its 512 routed experts while every sensitive subsystem combined (ViT, vision projector, KDA linear attention, Gated MLA, routers, shared experts, dense layers, embeddings, lm_head) is only 7.55 GiB, quantizing only the routed experts to symmetric INT4 group_size=32 gives the best of both worlds:
group_size=32): uses the exact same compressed-tensors pack-quantized layout as Ant Group's official Ling-3.0-flash-VL-int4 (weight_packed int32, weight_scale bfloat16, weight_shape int64), while optimizing each 32-weight group scale for minimum L2 reconstruction error (~9% lower weight RMSE than naive min-max).TP=4 native Marlin compatibility: moe_intermediate_size=768 splits to 192 per GPU at TP=4. Unlike group_size=128 (which fails Marlin's 192 % 128 == 0 divisibility check at TP=4), group_size=32 runs natively on Marlin W4A16 across Ampere (sm_80/sm_86), Ada (sm_89), Hopper (sm_90), and Blackwell (sm_100).~18 MiB/seq/GPU) and only 7/42 layers use compressed absorbed MLA (576-dim latent). On 4× RTX 3090, 286,593 tokens of lossless BF16 KV cache fit right inside the remaining 96 GB VRAM.| Component | Tensors | Parameters | % Total | Precision in This Quant | Size (GiB) |
|---|---|---|---|---|---|
Routed MoE Experts (layers.2..41) |
61,440 → 184,320 | 120.80B | 96.75% | INT4 W4A16 sym (g=32, MSE) |
63.30 |
| KDA Linear Attention (35 layers) | 455 | 2.21B | 1.77% | BF16 / F32 (untouched) | 4.11 |
Vision Encoder + Projector (qwen3_moe_vit) |
334 | 0.43B | 0.35% | BF16 (untouched) | 0.81 |
Embeddings + lm_head |
2 | 0.80B | 0.64% | BF16 (untouched) | 1.50 |
| Shared Experts (40) + Routers (40) | 200 | 0.29B | 0.23% | BF16 / F32 (untouched) | 0.54 |
| Gated MLA Attention (7 layers) | 42 | 0.22B | 0.18% | BF16 (untouched) | 0.42 |
Dense MLPs (layers.0..1) + LayerNorms |
91 | 0.09B | 0.08% | BF16 (untouched) | 0.18 |
| Total | 185,443 | 124.85B | 100% | Mixed W4A16 + BF16/F32 | 70.85 GiB |
(Note: Upstream LingSante-3.1-air-VL ships 0 MTP/NextN layers. Do not enable --speculative-algorithm NEXTN.)
Measured live on 4× NVIDIA GeForce RTX 3090 (96 GB VRAM, PCIe 3.0 ×16, P2P enabled, 300 W/GPU, gpu-unlock active) running SGLang 0.5.23 (torch 2.14.1+cu130, TP=4), full decode CUDA graphs, 262,144 max context (286,593 lossless BF16 KV tokens allocated), single-request (c=1), unique uncached prompts, 256 output tokens, enable_thinking=False:
| Benchmark | Prompt Tokens | TTFT | Prefill (or ViT + Prefill) | Decode Speed | Peak VRAM / GPU |
|---|---|---|---|---|---|
| Text · 1K | 981 | 0.372 s | 2,638.5 tok/s | 138.9 tok/s | 22,840 MiB |
| Text · 32K | 32,725 | 8.903 s | 3,675.7 tok/s | 127.8 tok/s | 22,840 MiB |
| Text · 128K | 131,029 | 72.034 s | 1,819.0 tok/s | 109.1 tok/s | 22,844 MiB |
| Text · 200K (YaRN 2×) | 199,957 | 149.339 s | 1,338.9 tok/s | 99.9 tok/s | 22,844 MiB |
Lab Scan A4 · 150 DPI (1240×1754) |
2,202 | 1.821 s | 1,209.4 tok/s | 127.6 tok/s | 22,986 MiB |
Lab Scan A4 · 200 DPI (1654×2339) |
3,853 | 3.144 s | 1,225.4 tok/s | 124.9 tok/s | 23,426 MiB |
Verified end-to-end capabilities on the same server:
enable_thinking=True, --reasoning-parser ling3): 136.6 tok/s, clean reasoning_content + content split.--tool-call-parser ling3): 138.3 tok/s, valid OpenAI tool_calls JSON.To verify that INT4 g=32 MSE quantization preserves real-world multimodal clinical reasoning (not just perplexity), we ran 5 synthetic multimodal medical test suites (19 full runs with reasoning enabled, 1-5 images per prompt, up to 13K output tokens per run) on both the official cloud BF16 API and this local W4A16 checkpoint on 4× RTX 3090:
| Test Suite (Synthetic Data) | What It Tests | Cloud BF16 API | Local W4A16 (4× 3090) | Local Speed (c=1) |
|---|---|---|---|---|
| A. Lab Report OCR → JSON | 4 scans, 43 values + flags, UK/US date formats | 43 / 43 | 43 / 43 | ~123 tok/s · TTFT 0.7-0.9 s |
| A. Longitudinal Trends (×3) | 3 visits, mixed SI/US unit conversions, FIT+IDA red flag | 21 / 21 | 21 / 21 | ~122 tok/s · 68-81 s total |
| B. Discharge + CT + Labs (×3) | 10 embedded clinical contradictions & drug interactions | 28 / 30 | 30 / 30 | ~123 tok/s · 64-82 s total |
| C. Raw ECG + Clinic Note (×3) | Grid HR/QT/QTc estimation, U-waves, K/Mg, 3 QT drugs | 24 / 30 | 25 / 30 | ~123 tok/s · 34-51 s total |
| D. Brown-Bag (8 Bottles) (×3) | Tilted/glare photos, Spanish Zocor label, GP med list | 30 / 30 | 28 / 30 | ~122 tok/s · 89-108 s total |
| E. 7-Day CGM + Handwritten Log (×3) | No printed stats, nightly lows <70, rebound highs, wine note | 26 / 30 | 27 / 30 | ~123 tok/s · 47-63 s total |
| Total (184 Graded Checks) | 19 multimodal clinical runs | 172 / 184 (93.5%) | 174 / 184 (94.6%) | ~122-139 tok/s |
Verdict: Full statistical parity with upstream BF16 across OCR, unit normalization, multilingual label reading, handwritten logs, and multi-document clinical reasoning.
sm_86)uv venv --python 3.12 sglang-env
uv pip install --python sglang-env/bin/python "sglang>=0.5.23" opencv-python-headless einops
TP=4, 256K Context, Vision + Reasoning + Tools)export SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
sglang-env/bin/python -m sglang.launch_server \
--model-path alesha-pro/LingSante-3.1-air-VL-W4A16 \
--served-model-name LingSante-3.1-air-VL \
--tp 4 \
--trust-remote-code \
--context-length 262144 \
--json-model-override-args '{"rope_scaling":{"rope_type":"yarn","factor":2.0,"rope_theta":6000000,"partial_rotary_factor":0.5,"original_max_position_embeddings":131072}}' \
--attention-backend triton \
--mm-attention-backend sdpa \
--linear-attn-backend triton \
--moe-runner-backend marlin \
--sampling-backend pytorch \
--disable-shared-experts-fusion \
--reasoning-parser ling3 \
--tool-call-parser ling3 \
--chunked-prefill-size 4096 \
--mem-fraction-static 0.92 \
--max-mamba-cache-size 16 \
--max-running-requests 8 \
--cuda-graph-max-bs-decode 8 \
--host 0.0.0.0 \
--port 18000
Important notes for Ampere (
sm_80/sm_86) users:
--disable-shared-experts-fusionis required so BF16 shared experts are not fused with INT4 Marlin routed experts.--attention-backend triton --mm-attention-backend sdpa --linear-attn-backend triton --moe-runner-backend marlinselects the verified Ampere-compatible kernels (avoid Hopper-only flags likeSGLANG_ENABLE_FP8_BLOCK_GEMV).- First boot JIT-compiles two
moe_wna16_marlinCUDA kernels (~5-7 min once, cached in~/.cache/sglang/jit/). Subsequent startups take ~45-60 s.- If your OS has legacy CUDA 11 libraries in
/usr/lib/x86_64-linux-gnualongside acu130wheel, pointCUDA_HOME/LD_LIBRARY_PATHtosite-packages/nvidia/cu13(and ensurelib64 -> libandlibcudart.so -> libcudart.so.13exist) so JIT kernels linklibcudart.so.13.
import base64, requests
with open("lab_report.png", "rb") as f:
b64 = base64.b64encode(f.read()).decode()
resp = requests.post(
"http://127.0.0.1:18000/v1/chat/completions",
json={
"model": "LingSante-3.1-air-VL",
"messages": [
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{b64}"}},
{"type": "text", "text": "Extract abnormal lab values as JSON and list 3 questions for a doctor."},
],
}
],
"temperature": 0.6,
"max_tokens": 1024,
"chat_template_kwargs": {"enable_thinking": True},
},
).json()
msg = resp["choices"][0]["message"]
print("Reasoning:", msg.get("reasoning_content", "")[:300])
print("Answer:", msg["content"])
Quantized directly from the official BF16 safetensors of inclusionAI/LingSante-3.1-air-VL using compressed_tensors.compressors.PackedQuantizationCompressor (format: "pack-quantized", symmetric 4-bit integer, group_size=32):
model.layers.{2..41}.mlp.experts.{0..511}.{gate,up,down}_proj.weight (61,440 matrices).alpha ∈ [0.80, 1.00], 17-step grid minimizing ||W - dequant(quant(W, scale))||₂² per 32-element group in FP32, stored in BF16).g=32 preserves every expert evenly while keeping all non-expert tensors in BF16/F32.This checkpoint inherits the intended use and limitations of inclusionAI/LingSante-3.1-air-VL:
sm_86 Bring-up & Benchmarks: Alexey (@superalesha)model-00001-of-00050.safetensors 3.0 GBmodel-00050-of-00050.safetensors 1.9 GBmodel-00040-of-00050.safetensors 1.5 GBmodel-00024-of-00050.safetensors 1.5 GBmodel-00045-of-00050.safetensors 1.5 GBmodel-00018-of-00050.safetensors 1.5 GBmodel-00039-of-00050.safetensors 1.5 GBmodel-00029-of-00050.safetensors 1.5 GBmodel-00043-of-00050.safetensors 1.5 GBmodel-00013-of-00050.safetensors 1.5 GBmodel-00022-of-00050.safetensors 1.5 GBmodel-00031-of-00050.safetensors 1.5 GBmodel-00047-of-00050.safetensors 1.5 GBmodel-00026-of-00050.safetensors 1.5 GBmodel-00048-of-00050.safetensors 1.5 GBmodel-00023-of-00050.safetensors 1.5 GBmodel-00044-of-00050.safetensors 1.5 GBmodel-00015-of-00050.safetensors 1.5 GBmodel-00038-of-00050.safetensors 1.5 GBmodel-00016-of-00050.safetensors 1.5 GBmodel-00028-of-00050.safetensors 1.5 GBmodel-00032-of-00050.safetensors 1.5 GBmodel-00037-of-00050.safetensors 1.5 GBmodel-00017-of-00050.safetensors 1.5 GBmodel-00021-of-00050.safetensors 1.5 GBmodel-00033-of-00050.safetensors 1.5 GBmodel-00011-of-00050.safetensors 1.5 GBmodel-00003-of-00050.safetensors 1.5 GBmodel-00008-of-00050.safetensors 1.5 GBmodel-00010-of-00050.safetensors 1.5 GBmodel-00002-of-00050.safetensors 1.5 GBmodel-00006-of-00050.safetensors 1.5 GBmodel-00007-of-00050.safetensors 1.5 GBmodel-00036-of-00050.safetensors 1.5 GBmodel-00019-of-00050.safetensors 1.5 GBmodel-00034-of-00050.safetensors 1.5 GBmodel-00027-of-00050.safetensors 1.5 GBmodel-00042-of-00050.safetensors 1.5 GBmodel-00012-of-00050.safetensors 1.5 GBmodel-00049-of-00050.safetensors 1.5 GBmodel-00005-of-00050.safetensors 1.5 GBmodel-00035-of-00050.safetensors 1.4 GBmodel-00014-of-00050.safetensors 1.4 GBmodel-00030-of-00050.safetensors 1.4 GBmodel-00046-of-00050.safetensors 1.4 GBmodel-00025-of-00050.safetensors 1.4 GBmodel-00020-of-00050.safetensors 1.4 GBmodel-00041-of-00050.safetensors 1.4 GBmodel-00009-of-00050.safetensors 1.4 GBmodel-00004-of-00050.safetensors 1.4 GBinclusionAI/LingSante-3.1-air-VL