SGLang is a framework for running inference for large language models and multimodal models, meaning it processes inputs to produce model outputs such as text or other media. It is used to serve and accelerate open AI models and related workloads.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/sgl-project/sglang/sglang-diffusion-modelopt-quantnpx skills add sgl-project/sglang --skill sglang-diffusion-modelopt-quantgit clone --depth 1 https://github.com/sgl-project/sglangWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-modelopt-quant)<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-modelopt-quant"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-modelopt-quant.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00049 | $0.04923 |
| Opus 5 | $0.00024 | $0.02462 |
| Sonnet 5 | $0.00010 | $0.00985 |
| Haiku 4.5 | $0.00005 | $0.00492 |
Grade A, and why
sglang-diffusion-modelopt-quant scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 445 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SGLang Diffusion ModelOpt Quant
Overview
Use this skill when the task is to take a diffusion transformer through the full ModelOpt workflow:
- quantize it with NVIDIA ModelOpt
- adapt the exported checkpoint to SGLang Diffusion
- verify that quality holds up
- benchmark whether the quantized checkpoint is actually faster
This skill owns the ModelOpt-to-SGLang bridge. It is not a generic kernel-tuning skill.
Core Rules
- Use ModelOpt's official
quantize.pyas the PTQ source of truth. - Keep the workflow generic. Put model-specific fallback logic in small isolated branches, not in the main conversion path.
- Benchmark only when BF16 and quantized commands are identical except for the checkpoint override being tested.
- For diffusion FP8, keep
dit_cpu_offload=false.dit_layerwise_offload=trueis valid on the fixed path when you want lower DiT residency. - For multi-transformer pipelines, use per-component overrides when different components need different checkpoints.
- For B200 NVFP4 validation, keep backend-sensitive environment variables
explicit. The current default is FlashInfer TensorRT-LLM
(
flashinfer_trtllm); high-resolution Qwen Image can favorSGLANG_DIFFUSION_FLASHINFER_FP4_GEMM_BACKEND=cutlass, while 1024x1024 can remain BF16-faster. Benchmark the exact shape instead of assuming one backend or quantized checkpoint wins. - When a branch is missing the validated helper tools, refresh
python/sglang/multimodal_gen/tools/build_modelopt_fp8_transformer.py,python/sglang/multimodal_gen/tools/build_modelopt_nvfp4_transformer.py, andpython/sglang/multimodal_gen/tools/compare_diffusion_trajectory_similarity.pyinstead of inventing one-off scripts elsewhere. - After validating a new ModelOpt quant path, update the ModelOpt support matrix in
docs/docs/sglang-diffusion/quantization.mdxbefore closing the task.
Read First
Read these sources before changing code:
- NVIDIA ModelOpt diffusers guide:
examples/diffusers/README.md - ModelOpt quantization entrypoint:
examples/diffusers/quantization/quantize.py - ModelOpt diffusers quant presets:
examples/diffusers/quantization/config.py - SGLang diffusion quant runtime:
python/sglang/multimodal_gen/runtime/layers/quantization/modelopt_fp8.pypython/sglang/multimodal_gen/runtime/layers/quantization/modelopt_quant.pypython/sglang/multimodal_gen/runtime/utils/quantization_utils.pypython/sglang/multimodal_gen/runtime/loader/transformer_load_utils.py
- Helper tools in this repo:
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 445 lines · 49 tokens per session scan A d69bf5419557
sglang-diffusion-modelopt-quant is a skill published in the GitHub repository sgl-project/sglang (35,516 stars, last pushed today), licensed Apache-2.0. It adds 49 tokens to every session and 4,923 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
llama-factory
Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.
groq-inference
Ultra-fast LLM inference on custom LPU hardware. OpenAI-compatible API at api.groq.com. Lowest latency in the industry (500-1000+ tok/s). Supports chat completions, vision, audio (Whisper STT + TTS), tool calling, JSON mode, and streaming. Free tier available. Inference only — no training.
fireworks-ai-inference
Fast inference and fine-tuning platform with serverless and on-demand GPU deployments. OpenAI-compatible API for chat completions, embeddings, function calling, vision, and structured output. Supports SFT, DPO, and RL fine-tuning. SOC2 + HIPAA compliant.
ort
ONNX Runtime in Rust via the ort crate (2.x): loading sessions, configuring CPU/CoreML/CUDA execution providers, tensor I/O with ndarray, async-safe spawnblocking wrapping, global thread-pool init, and debugging provider/opset issues.
minimind-learning
MiniMind 学习助手。自动记录学习笔记,识别 RMSNorm, LayerNorm, RoPE, Attention, LoRA, DPO, PPO, GRPO, SFT, RLHF 等术语。触发词:学习、开始、MiniMind、归一化、位置编码、注意力、训练、微调。.
llama-factory
Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.