Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

check-hf-config-save

Skill by InternLM

Implements missing XTuner Hugging Face config exports from official HF models and validates them against the installed Transformers round-trip. It also checks vLLM and SGLang field contracts for developers working on XTuner model support.

  • Score 85
  • 5.2k stars
  • Apache-2.0
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install check-hf-config-save

Built from the published package, never by AI.

git clone --depth 1 https://github.com/InternLM/xtuner /tmp/xtuner && mkdir -p ~/.claude/skills && cp -r /tmp/xtuner/.claude/skills/check-hf-config-save ~/.claude/skills/check-hf-config-save

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install check-hf-config-save in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill checks and fixes the Hugging Face config export for a model in XTuner. If a built-in official Transformers config exists but XTuner's hf_config is missing or returns None, it guides adding an inverse from_hf and hf_config mapping that uses the official config class. It then compares the XTuner export with a direct Transformers load and save of the source config.json, so normalization done by Transformers is separated from fields XTuner drops.

The skill also audits inference-engine dependencies. It asks for exact vLLM and SGLang versions, checks their source tags, and records fields that affect model construction or weight loading. The skill is written for developers adding models to XTuner or debugging checkpoint-load failures in vLLM or SGLang.

Written from the project's SKILL.md and checked against it.

What it can do

  • Implement missing hf_config exportAdds an inverse from_hf and hf_config mapping for a model with an official built-in Transformers config.
  • Round-trip comparisonCompares the Transformers reference save with the XTuner save_hf export from the raw source config.json.
  • Inference-engine dependency auditChecks exact vLLM and SGLang source tags for fields used in model construction or weight loading.
  • Version matrix reportingRecords Transformers, vLLM and SGLang versions and whether each was tested at runtime or by source audit.
  • Regression test generationProvides a model test using check_hf_config_save and HFConfigFieldDependency for the public conversion path.
  • Remote-code handlingKeeps hf_config as None for trust_remote_code-only models and validates source config copying instead.

What you need

  • XTuner repository checkout
  • Python and Transformers environment
  • Exact vLLM or SGLang versions for engine audits
  • GPU hardware for optional engine runtime smoke tests

Try asking

  • Check the hf_config export for this model and implement it if it is missing.
  • Run check_hf_config_save for my model and list any config.json differences.
  • Audit the vLLM and SGLang fields that affect loading this checkpoint.

Good to know

  • Static source inspection does not prove end-to-end vLLM or SGLang compatibility.
  • Models that only work with trust_remote_code keep hf_config as None.
  • Does not add a model that XTuner does not already support; use add_hf_model for that.
  • Runtime engine checks need the exact runtime and required hardware.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: .claude/skills/check-hf-config-save/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md11 KB
  • agents/openai.yaml282 B

Alternatives to check-hf-config-save

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

check-hf-config-save: common questions

What does check_hf_config_save test?

It checks that XTuner's save_hf export matches the active Transformers direct round-trip. It also checks that exported values satisfy declared inference-engine contracts.

Does this skill work for models without a built-in Transformers config?

For models that only work with trust_remote_code and have no built-in config class, the skill keeps hf_config as None. It tests the public HF save path that copies the original config and remote-code files.

Which engine versions does the skill audit?

A user-specified or production-log version takes precedence. If no version is given, it looks up the latest stable release of vLLM and SGLang and inspects the matching source tag, which is the default for both.

How do I install check-hf-config-save?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is check-hf-config-save free?

The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.

Is check-hf-config-save safe to use?

It scores 85 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 check-hf-config-save?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

check-hf-config-save Install

Add to stack

Loading.