model-integration
Skill by huggingface
Guides an AI assistant through adding a new model or pipeline to Hugging Face diffusers, from setup and weight conversion to parity testing and Hub checkpoint layout. Intended for diffusers contributors integrating a model.
Install model-integration
Built from the published package, never by AI.
git clone --depth 1 https://github.com/huggingface/diffusers /tmp/diffusers && mkdir -p ~/.claude/skills && cp -r /tmp/diffusers/.ai/skills/model-integration ~/.claude/skills/model-integrationRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/huggingface/diffusers /tmp/diffusers && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/diffusers/.ai/skills/model-integration ~/.gemini/antigravity-cli/skills/model-integrationAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The model-integration skill guides an AI assistant through adding a new model or pipeline to Hugging Face diffusers. It starts by gathering the reference repo, a runnable inference script, and a choice between standard and modular pipelines, then confirms the plan with the user. It then works through a checklist covering the transformer, VAE, scheduler, pipeline, tests, and docs.
The skill covers converting original checkpoints with a standalone script, and checking numerical parity against the reference on CPU in float32 with a strict tolerance. It also describes assembling a Hub checkpoint that loads with ModularPipeline.from_pretrained. It is written for contributors integrating a new model into diffusers, and it defaults to modular pipelines.
Written from the project's SKILL.md and checked against it.
What it can do
- Setup gatheringCollects the reference repo, a runnable inference script, and the pipeline style before any code is written.
- Integration checklistWalks through the transformer, VAE, scheduler, pipeline, Hub checkpoint, docs, and style steps.
- Weight conversionDescribes mapping original state-dict keys to diffusers module names with a standalone conversion script.
- Hub checkpoint layoutExplains separate-repo and same-repo layouts and the modular_model_index.json file they rely on.
- Parity testingCompares converted components against the reference with max_diff below 1e-3 on CPU in float32.
- Test guidancePoints to conventions for pipeline-level and model-level tests in the diffusers test suite.
- File structureLists the source, test, and docs files a new model pull request usually adds.
What you need
- Reference implementation repo and its checkpoint
- A runnable end-to-end inference script from the user
- PyTorch
- A local clone of the diffusers repository
Try asking
- Help me add my new model to diffusers, starting with the setup questions
- Convert my original checkpoint to diffusers format with a conversion script
- Write a parity test comparing my diffusers model with the reference model
Good to know
- Modular pipelines are the default, and the standard DiffusionPipeline is still supported
- The parity test imports the reference repo and must not be shipped in the pull request
- A modular index is required when weights share a repo with the reference and folder names clash
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .ai/skills/model-integration/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md10 KB
Alternatives to model-integration
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
model-integration: common questions
What tolerance does the parity test use?
The source sets a strict tolerance of max_diff below 1e-3, checked on CPU in float32 with the freshly converted weights.
Should the parity test be included in the pull request?
No. The source says it is an internal verification tool that imports the reference repo, and it should not be shipped.
Where can the converted diffusers weights be hosted?
The user decides between a separate repo and the reference checkpoint's repo. The source recommends keeping each repo self-contained, with every component pointing at that repo.
How do I install model-integration?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is model-integration free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is model-integration safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to model-integration?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
