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/vipshop/cache-dit/cache-dit-model-integrationnpx skills add vipshop/cache-dit --skill cache-dit-model-integrationgit clone --depth 1 https://github.com/vipshop/cache-ditWhat 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 | $0.00082 | $0.10619 |
| Opus 5 | $0.00041 | $0.05310 |
| Sonnet 5 | $0.00016 | $0.02124 |
| Haiku 4.5 | $0.00008 | $0.01062 |
Grade A, and why
cache-dit-model-integration 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 3d 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 — 525 lines — stays where its author put it; the contents beside it link to each section on GitHub.
GATE CHECK
Before writing any code, confirm the following:
STOP — Has the user provided BOTH of the following?
1. A local model path (e.g., /workspace/dev/vipdev/hf_models/Krea-2-Turbo)
2. The model's pipeline/transformer code info:
- Pipeline class name (e.g., Krea2Pipeline, or third-party like BooguImagePipeline)
- Transformer class name (e.g., Krea2Transformer2DModel)
- File paths to the pipeline and transformer source code (diffusers or third-party)
NO → **MUST ask the user to specify these before proceeding.**
Do NOT guess, search blindly, or assume defaults.
YES → Continue.
STOP — Have you identified the new model's transformer architecture?
NO → Read the model's diffusers source code. Identify:
- The ModuleList name(s) containing transformer blocks (e.g., transformer_blocks)
- The block forward() signature (inputs and outputs)
YES → Proceed to Cache (`./references/cache.md`) and CLI (`./references/cli.md`) in parallel.
Hard rules:
- ⚠️ MANDATORY: Local model path and code info. If the user has not explicitly provided (a) the local model path and (b) the pipeline/transformer class names with source file paths (diffusers or third-party), you MUST ask the user to specify them via
vscode_askQuestionsbefore any code changes. Do NOT search the codebase or assume default paths — the user knows their setup best. - ⚠️ MANDATORY: Plan before code. Before writing ANY implementation code, you MUST: (1) thoroughly analyze the model's pipeline and transformer source code, (2) create a detailed integration plan following this skill's workflow and read the relevant references (Cache → CP → TP → TE-P → VAE-P → CLI → Testing), (3) present the plan to the user for review and approval. Do NOT start implementing until the user explicitly approves the plan. This prevents wasted effort from incorrect assumptions about the model architecture.
- ALWAYS set up local model paths via environment variables BEFORE testing — downloading from HuggingFace Hub is extremely slow.
- ALWAYS compute BOTH PSNR and SSIM when verifying correctness — PSNR alone cannot detect image corruption (garbled output).
- For Python-only changes,
pip install -e "." --no-build-isolationis sufficient; SVDQuant C++ compilation is NOT required. - Do NOT alter core dependency versions (torch, torchvision, transformers, diffusers, cache-dit, triton) in the
cditconda environment. Other dependencies may be installed only if they do not conflict with these. - Do NOT modify any code in the diffusers library. If a model requires patches (e.g., monkey-patching
forward(), attention processors, etc.), write all patch code inside the cache-dit repository. Diffusers is a third-party dependency and must not be altered. - All examples in this skill are references, not templates to copy. Every model has unique architecture details (block signatures, tensor layouts, shared vs per-block modulation, attention mask requirements, etc.). Before following any example, first analyze whether the referenced model's architecture is actually comparable to the target model. Blindly copying an example that was designed for a different architecture will produce incorrect or broken code.
- ControlNet parallelism is a special case and is NOT covered in this guide.
- ⚠️ GQA attention backend pitfall: When a model uses GQA (e.g.,
num_heads=48, num_kv_heads=12), thedispatch_attention_fn(..., enable_gqa=True)path may cause PyTorch SDPA to fall back to a slow backend (mathor an inefficientmem_efficientkernel) because flash-attention / cuDNN SDPA backends have limited GQA support. Always benchmarkenable_gqa=Truevs. manually repeating K/V heads to match Q heads and passingenable_gqa=False(MHA path). On NVIDIA L20, the MHA repeat gave a ~2.2× single-GPU speedup for Krea-2-Turbo (48 Q / 12 KV heads, 128 head_dim, 4608 seq). This is not CP-specific — any model with GQA should evaluate whether the repeat→MHA path is faster. If confirmed, apply the repeat unconditionally in the attention processor patch, not just in the CP path. Document the finding in the planner's docstring as well (seekrea2.pyfor an example).
What ships with it
8 files 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.
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.
- 3d ago First seen · 525 lines · 82 tokens per session scan A 79835fd69363
cache-dit-model-integration is a skill published in the GitHub repository vipshop/cache-dit (1,262 stars, last pushed 5d ago), licensed Apache-2.0. It adds 82 tokens to every session and 10,619 once invoked, about $0.0004 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
agent-platform-model-registry
Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.
bigquery-ai-ml
Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity…
ondb
A logical analysis and reasoning tool for AI. Use when decomposing documents into structured knowledge, querying entities and relations, validating consistency, or indexing files. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", "analyze this document", entity CRUD, or cross-skill…
neuron-evaluation-engineer
Create and run AI evaluations with datasets, assertions, and output drivers in Neuron AI. Use this skill whenever the user mentions evaluation, testing AI systems, creating evaluators, dataset-driven testing, assertion-based validation, or wants to measure AI system performance. Also trigger for tasks involving…
sparse-autoencoder-training
Provides guidance for training and analyzing Sparse Autoencoders (SAEs) using SAELens to decompose neural network activations into interpretable features. Use when discovering interpretable features, analyzing superposition, or studying monosemantic representations in language models.
model-compatibility
Model family compatibility matrix covering loaders, resolutions, samplers, CFG, VAE, ControlNet, and LoRA compatibility for SD 1.5, SDXL, Flux, SD3, and video models.