Instructions to use Beling86/Ling3.0-Flash-VL-3.58BPW with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Beling86/Ling3.0-Flash-VL-3.58BPW with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Beling86/Ling3.0-Flash-VL-3.58BPW", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Beling86/Ling3.0-Flash-VL-3.58BPW", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Beling86/Ling3.0-Flash-VL-3.58BPW", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Beling86/Ling3.0-Flash-VL-3.58BPW with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Beling86/Ling3.0-Flash-VL-3.58BPW" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Beling86/Ling3.0-Flash-VL-3.58BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Beling86/Ling3.0-Flash-VL-3.58BPW
- SGLang
How to use Beling86/Ling3.0-Flash-VL-3.58BPW 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 "Beling86/Ling3.0-Flash-VL-3.58BPW" \ --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": "Beling86/Ling3.0-Flash-VL-3.58BPW", "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 "Beling86/Ling3.0-Flash-VL-3.58BPW" \ --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": "Beling86/Ling3.0-Flash-VL-3.58BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Beling86/Ling3.0-Flash-VL-3.58BPW with Docker Model Runner:
docker model run hf.co/Beling86/Ling3.0-Flash-VL-3.58BPW
Ling3.0-Flash-VL-3.58BPW
Mixed-precision AutoRound quantization of inclusionAI/Ling-3.0-flash-VL. Text-only (vision tower, projector, and MTP layer removed). Checkpoint size 51.94 GiB, 3.58 bits per weight on average over all tensors (packed weights, scales, zero points and BF16 parts).
Precision layout
| Component | Format |
|---|---|
| Routed experts, layers 3, 5, 6, 9, 14, 17, 20, 24 | W4A16, group 128, symmetric |
| Routed experts, 4 MoE layers (18, 27, 28, 40) | W3A16, group 64, symmetric |
| Routed experts, 28 MoE layers (2, 4, 7, 8, 10, 11, 12, 13, 15, 16, 19, 21, 22, 23, 25, 26, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41) | W3A16, group 128, symmetric |
| Attention (KDA + MLA) projections | W8A16, group 128, symmetric (KDA f_proj kept BF16) |
| Dense MLP (layers 0–1) | W8A16, group 128, symmetric |
| Shared experts | W8A16, group 128, symmetric |
| Routers, embeddings, LM head, norms | BF16 |
AutoRound 0.16.1 (SignRound), 400 iterations/block, 1024 × 2048-token
calibration samples (chat / code / reasoning / long-context / wikitext prose, production chat template; best-MSE=False). Format auto_round:auto_gptq.
Fidelity vs. BF16 (Ling-3.0-flash-VL text model)
Teacher-forced full-vocabulary KL(P_bf16 ‖ Q_quant) on a held-out set (24 × 1,024 tokens; sources and splits disjoint from calibration):
| Domain | Positions | Mean KL | Median KL | P99 KL | Top-1 agreement | PPL bf16 → quant |
|---|---|---|---|---|---|---|
| all | 24552 | 0.34248 | 0.00426 | 6.5247 | 88.71% | 3.809 → 3.804 |
| chat | 10230 | 0.18930 | 0.01430 | 2.6132 | 88.14% | 4.953 → 4.980 |
| code | 5115 | 0.60426 | 0.00010 | 12.8685 | 89.64% | 3.536 → 3.417 |
| math | 5115 | 0.49119 | 0.00314 | 8.2542 | 87.45% | 4.261 → 4.240 |
| prose | 4092 | 0.21231 | 0.00475 | 2.7778 | 90.54% | 1.884 → 1.937 |
P99.9 KL 18.0308, max 31.256. vLLM vs. reference decoder on the same windows: top-1 agreement 93.48%, top-20 overlap 78.8% (FAIL).
Note: Earlier provisional logs briefly compared against
Ling-3.0-flash(ling_flash_nomtp, mean KL 0.94550); the table above is the true comparison againstinclusionAI/Ling-3.0-flash-VLBF16.
Reference text-only Ling3.0-Flash runs (different base weights)
| Variant | Config | Size / BPW | Mean KL | P99 KL | Top-1 | Prose KL | Math P99.9 | Code P99.9 |
|---|---|---|---|---|---|---|---|---|
Ling3.0-Flash-3.44BPW |
128 samples, 200 iters, 2× W4 (2,41) |
49.82 GiB / 3.44 | 0.08767 | 1.2216 | 92.88% | 0.11341 | 10.307 | 13.536 |
Ling3.0-Flash-3.58BPW |
1024 samples, 400 iters, 8× W4 (2–5,38–41), best-MSE |
51.93 GiB / 3.58 | 0.08165 | 1.1531 | 93.39% | 0.09677 | 6.406 | 11.040 |
Serving (vLLM)
Designed for vLLM 0.32.0 / 0.33.0 (single 64+ GB GPU). Stock vLLM 0.32/0.33 needs two patches in vllm-patch.py (idempotent, --check / --revert):
python vllm-patch.py # run with the python of your vLLM environment
vllm serve Beling86/Ling3.0-Flash-VL-3.58BPW --trust-remote-code --dtype bfloat16 --max-model-len 131072
| # | Where | Bug | Symptom without the patch |
|---|---|---|---|
| 1 | quantization/inc/config_parser.py |
The per-layer bit-width of a fused MoE layer is only read when the class name contains fusedmoe; the class is now RoutedExperts. Every MoE layer silently falls back to the global bits: 4, so the W3 experts get 4-bit containers. |
CUDA OOM at model construction |
| 2 | models/bailing_moe_v3.py |
bailing_v3_kda_attention (host-syncing KDA state update) is not registered through eager_break_during_capture, so it runs inside CUDA-graph capture. |
cudaErrorStreamCaptureUnsupported / "operation not permitted when stream is capturing" at state_indices[~has_initial_state] |
Without patch 2 you can also run with --compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY"}' or --enforce-eager.
Validation gates passed
Coverage, packed layout vs. config, zero points vs. sym, fused-group consistency, size ≤ 52.0 GiB,
plan conformance, strict reload (no missing keys) for the KL evaluation.
- Downloads last month
- 47
Model tree for Beling86/Ling3.0-Flash-VL-3.58BPW
Base model
inclusionAI/Ling-3.0-flash-VL