sglang-diffusion-cache-dit

sglang-diffusion-cache-dit is a skill for Claude Code from sgl-project/sglang. It costs 161 tokens per session (7,783 once invoked), scanned A, original, Apache-2.0.

A workflow for adding Cache-DiT caching methods to SGLang's diffusion system, which generates images or other media with AI models. It covers integrating upstream changes, adding request controls, testing command-line generation, and checking output quality.

In plain words
What is it for?
Use it to integrate DBCache, DMD calibrator, TaylorSeer, or SVDQuant DQ; add cache settings; run generation tests; and compare results with metrics such as PSNR.
Why use it?
It provides a controlled process for complex GPU-based integration work, including isolated environments and precision checks.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: positional $N argument; installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is for t in ../../python/sglang/multimodal_gen/test/unit/test_cache_dit*.py; do echo "== $t"; python $t 2>&1 | tail -3; done.

Good fit Use it to integrate DBCache, DMD calibrator, TaylorSeer, or SVDQuant DQ; add cache settings; run generation tests; and compare results with metrics such as PSNR.

Compare 6 skills from other repositories ↓
About the project

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.

sgl-project/sglang · 37,180 stars · on GitHub · sglang.io

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/sgl-project/sglang
agentmods
npx agentmods add skills/sgl-project/sglang/sglang-diffusion-cache-dit

Made for: Claude Code.

Wrote 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.

agentmods badge for sglang-diffusion-cache-dit

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-cache-dit/github.svg)](https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-cache-dit)
Your own site
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-cache-dit"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-cache-dit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sglang-diffusion-cache-dit

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgl-project/sglang/sglang-diffusion-cache-dit"><img src="https://agentmods.dev/badge/skills/sgl-project/sglang/sglang-diffusion-cache-dit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,783 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00161 $0.07783
Opus 5.5 $0.00064 $0.03113
Sonnet 5.5 $0.00032 $0.01557
Haiku 4.5 $0.00016 $0.00778

Measured 26d ago against content hash 100c270009f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sglang-diffusion-cache-dit 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 26d 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.

python/sglang/multimodal_gen/.agents/skills/sglang-diffusion-cache-dit/SKILL.md · 406 lines

How it starts

The opening of the file, as written. The whole thing — 406 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SGLang Diffusion × Cache-DiT Integration

Path placeholders used throughout: <sglang_dir> = sglang repo root, <cache_dit_dir> = local cache-dit repo root (if not present locally, clone it: git clone https://github.com/vipshop/cache-dit), <flux_model_dir> = the DiT model weights actually under test (if the user has not specified the model, ask for the model name and checkpoint path first — the workflow is not FLUX-specific; FLUX.1-dev is only the reference run), <cuda_home> = CUDA toolkit root (typically /usr/local/cuda), <gpu_id> = a free GPU index.

GATE CHECK (confirm before starting)

STOP — are all of the following confirmed?
  1. All work happens in a dedicated env for sglang diffusion testing (e.g. `conda activate sgl`),
     fully isolated from cache-dit/ffpa dev envs: never touch other envs, and never let sglang
     dependencies leak into them. If the env does not exist, create a new dedicated one first
     (conda/venv both fine, see §3) — never reuse an existing env just to save effort. Install
     missing dependencies directly into the dedicated env.
  2. GPU: run sglang jobs on the GPUs allocated for them (e.g. CUDA_VISIBLE_DEVICES=<gpu_id>);
     other GPUs may be busy with other jobs.
  3. The test artifact directory <sglang_dir>/.tmp/{task}/ exists (.tmp/ is gitignored; never
     write test outputs into the repo root).
  4. CLI args have been verified once via `sglang generate --help | grep -- <every arg you use>`
     (the old --warmup from earlier docs/PRs is gone; it is now
     --warmup-mode {off,request,server} + --warmup-steps N).
  5. Plan-time alignment — align ALL of the following with the user while drafting the plan
     (before any run), not afterwards:
     - Model under test: model name + weights path. Do NOT default to FLUX.1-dev; adapt the
       case-name prefix and the PSNR baseline table to the actual model.
     - Generation settings: resolution, step count, prompt/seed (reference run used
       1024x1024 / 28 steps — follow the user's actual setup instead).
     - Local cache-dit checkout: does `<cache_dit_dir>` exist? The yaml configs in §4 come from
       `<cache_dit_dir>/examples/configs/`; if absent, agree with the user whether to
       `git clone https://github.com/vipshop/cache-dit` or obtain the configs another way.
     Anything unknown → ASK the user first.
  NO → fix these before touching anything.

Read the full file on GitHub · 406 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 26d ago First seen · 406 lines · 161 tokens per session scan A 100c270009f5

Subscribe to this mod's changes

sglang-diffusion-cache-dit is a skill published in the GitHub repository sgl-project/sglang (37,180 stars, last pushed today), licensed Apache-2.0. It adds 161 tokens to every session and 7,783 once invoked, about $0.0006 per session on Opus 5.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-09-20.

Related

Other skills, from other repositories

saelens

Train sparse autoencoders to interpret model features.

NousResearch/hermes-agent · 14 tokens

ml-training-recipes

Battle-tested PyTorch training recipes for all domains — LLMs, vision, diffusion, medical imaging, protein/drug discovery, spatial omics, genomics. Covers training loops, optimizer selection (AdamW, Muon), LR scheduling, mixed precision, debugging, and systematic experimentation. Use when training or fine-tuning…

Orchestra-Research/AI-Research-SKILLs · 88 tokens

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.

davila7/claude-code-templates · 51 tokens

exporting-to-fhir

Convert OpenMed NER output (entities from openmed.analyzetext) into FHIR R4 resources — Condition, MedicationStatement, Observation — using OpenMed's built-in FHIR R4 export helpers in openmed.clinical.exporters. Covers the verified CodeableConcept builder (coding, codeableconcept, systemuri), deterministic fullUrl…

maziyarpanahi/openmed · 163 tokens

batch-processing-clinical-text

Run large-scale batch NER, PII extraction, or de-identification over many clinical notes on-device with OpenMed, with sharding, checkpointing, resumability, and append-only JSONL output. Use when the user needs to process a corpus or folder of notes, de-identify a dataset, run NER over thousands of documents, build a…

maziyarpanahi/openmed · 161 tokens

loading-openmed-models

Load OpenMed clinical/biomedical NER models from the Hugging Face Hub or a local path and reuse them efficiently across calls. Use when the user wants to load an OpenMed model, control the model cache, run fully offline after a one-time download, reuse a ModelLoader to avoid reloading, set a cachedir or device, or…

maziyarpanahi/openmed · 118 tokens