CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

export-hf-model-extension

Onboards and exports new or custom Hugging Face (or Diffusers/PyTorch) model architectures in `litert_torch.generative.export_hf` using pluggable `ModelExtension` classes (built-in under `model_ext/<arch>/` or out-of-tree via `--extension_modules`). Use when supporting a new `model_type` in `export_hf` or `litert_lm`, inspecting a checkpoint with `model_ext/inspector.py`, patching RMSNorm/SwiGLU/ShortConv/Attention/RoPE for `torch.export`, configuring fused weights or `LlmMetadata`, or verifying extensions with `model_ext/testing.py`. Don't use for generic non-generative PyTorch-to-TFLite conversion or standalone post-export equivalence evaluation.

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

86%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

Excellent actionability and token efficiency: nearly every line carries non-obvious internal-framework knowledge delivered as executable commands, exact signatures, and failure-mode-specific fixes. The weaknesses are structural — a 230-line single-file layout that should split the cheat-sheet and gotchas into reference files, and a Step 4 that promises verification but only documents invocation.

Suggestions

Move the composite-ops cheat-sheet table (section 2) and the architecture gotchas (section 3) into one-level-deep reference files (e.g. references/composites.md and references/gotchas.md), keeping SKILL.md as a concise workflow overview with clearly signaled links.

Add explicit post-export verification steps to Step 4 — the heading says "Full Export & litert_lm Verification" but the bullets only cover how to invoke the export; state what to check on the exported artifact and how.

Add a short error-recovery loop in Step 3 (e.g. "if assert_v2_weights_resolvable fails, check gotcha F items 1–3 and re-run") so the fast verification step explicitly routes failures to their fixes.

DimensionReasoningScore

Conciseness

The body is dense with internal-API specifics Claude cannot know (exact call signatures like "requires 4 positional arguments (note the 4th ones tensor)", flag couplings, failure modes) and explains no generally known concepts. Every section earns its tokens through non-obvious detail delivered in tight bullets, tables, and commands, matching the "lean and efficient... every token earns its place" anchor.

5 / 5

Actionability

Commands are copy-paste ready with real paths and flags (bazel run inspector, litert convert with --extension-modules, --target=npu:qualcomm), the cheat-sheet gives exact import paths and call signatures, and code snippets like the _find_modeling_module loop and attn_output reshape are executable. This matches the fully-executable, common-cases-covered anchor.

5 / 5

Workflow Clarity

The 4-step workflow is clearly sequenced with strong explicit validation in Step 3 (three named testing.assert_* checks plus dry_run, with timing budgets like "<2s on CPU") and error-recovery detail in the gotchas. However, Step 4 is titled "Full Export & litert_lm Verification" yet its bullets only show export invocation commands and never state how to verify the exported artifact — a minor validation gap that fits anchor 4 rather than the explicit-checkpoint-everywhere anchor 5.

4 / 5

Progressive Disclosure

The body has good internal structure (numbered sections, headers, a signature table), but it is a single ~230-line monolith with no bundle files at all: the composite-ops cheat-sheet and the six architecture gotchas are exactly the kind of deep reference content that belongs in separate one-level-deep files. This matches anchor 3 ("content that should be separate is inline"), not anchor 4's "bulk in separate file".

3 / 5

Total

17

/

20

Passed

Description

92%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: it states concrete capabilities with exact internal module names, gives an explicit multi-scenario "Use when" clause, and delineates scope with a negative-use boundary. The only weakness is trigger-term coverage that omits file extensions and the common "convert"/TFLite phrasing as positive triggers.

DimensionReasoningScore

Specificity

The description lists multiple concrete actions — "Onboards and exports new or custom Hugging Face... model architectures", "inspecting a checkpoint with model_ext/inspector.py", "patching RMSNorm/SwiGLU/ShortConv/Attention/RoPE", "configuring fused weights or LlmMetadata", "verifying extensions with model_ext/testing.py" — with exact module and flag names. Coverage is comprehensive within the domain, matching the anchor for multiple specific concrete actions; anchor 4's "minor gaps in coverage" does not apply.

5 / 5

Completeness

It explicitly answers "what" ("Onboards and exports... using pluggable ModelExtension classes") and "when" with a concrete "Use when..." clause enumerating trigger scenarios (supporting a new model_type, inspecting a checkpoint, patching modules, configuring fused weights, verifying extensions), plus an explicit negative scope ("Don't use for generic non-generative PyTorch-to-TFLite conversion"). This clearly matches the anchor for explicit what AND when with concrete trigger phrases.

5 / 5

Trigger Term Quality

Good natural-term coverage including synonyms ("Hugging Face (or Diffusers/PyTorch)", "export_hf or litert_lm", "checkpoint", "model_type"), but no file extensions (e.g. .safetensors) appear as positive triggers and "convert"/"TFLite" surface only in the exclusion clause. This sits between anchor 4 (a few natural terms missing) and anchor 5 (comprehensive including file extensions), and the missing extensions keep it at 4.

4 / 5

Distinctiveness Conflict Risk

The skill occupies a clear niche (litert_torch.generative.export_hf ModelExtension framework) with highly specific triggers, and the "Don't use for..." clause explicitly fences off adjacent domains like generic PyTorch-to-TFLite conversion. Conflict risk with other skills is minimal, matching anchor 5.

5 / 5

Total

19

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

google-ai-edge/litert-torch

Path

litert_torch/generative/export_hf/model_ext/SKILL.md

Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.