Agent skill

Liger Autopatch

by linkedin in linkedin/Liger-Kernel

Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching.

BSD-2-ClauseAuto-check passedAI & LLM Engineering

Install Liger Autopatch

skills CLI
$ npx skills add linkedin/Liger-Kernel --skill liger-autopatch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install linkedin/Liger-Kernel liger-autopatch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/linkedin/Liger-Kernel.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/liger-autopatch .claude/skills/liger-autopatch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
liger-autopatch
GitHub stars
6.7k
Token cost
~1.3k tokens
SKILL.md length
469 words
Files
12
Skills in repo
3
Repo updated
First seen
Licence
BSD-2-Clause

At a glance

Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching.

  • Works in 6 steps: Analyze → Generate → Validate → …
  • Adding a new model to Liger Kernel
  • SKILL.md covers Mode Detection, Pipeline (Create Mode), Pipeline (Modify Mode) and Reference Files
  • Calls pytest and make

What it does

Liger Autopatch is an agent skill from linkedin/Liger-Kernel. Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching. Generates lceforward, monkey-patch function, tests, and README entry. Use when adding a new model to Liger Kernel, when a user asks to patch an unsupported model, when extending MODELTYPETOAPPLYLIGERFN, or when modifying/updating/fixing an existing monkey-patch (e.g., adding a new kernel to an already-supported model, fixing instance patching, updating a patch for upstream HF changes).

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files (for example `code-generator.md`, `decision-matrix.md` and `examples/gemma-profile.md`).

It sits in AI & LLM Engineering, covering GPU and accelerator computing. It works with Transformers and Mistral AI. The repository describes itself as: Efficient Triton Kernels for LLM Training. The licence is BSD-2-Clause.

When your agent uses it

  • Adding a new model to Liger Kernel
  • A user asks to patch an unsupported model
  • Extending MODELTYPETOAPPLYLIGERFN
  • Modifying/updating/fixing an existing monkey-patch (e.g.

Example prompts

  • “/liger-autopatch”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Analyze
  2. Generate
  3. Validate
  4. Change Impact Analysis
  5. Apply Changes
  6. Validate

What it can do on your machine

Read from SKILL.md and the folder at commit d5f2817. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Liger Autopatch loads about 1.3k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 469 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from linkedin/Liger-Kernel at commit d5f2817, republished under its BSD-2-Clause licence (© linkedin). 469 words, ~1,283 tokens.

Download SKILL.mdSave it as .claude/skills/liger-autopatch/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
liger-autopatch
description
Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching. Generates lce_forward, monkey-patch function, tests, and README entry. Use when adding a new model to Liger Kernel, when a user asks to patch an unsupported model, when extending MODEL_TYPE_TO_APPLY_LIGER_FN, or when modifying/updating/fixing an existing monkey-patch (e.g., adding a new kernel to an already-supported model, fixing instance patching, updating a patch for upstream HF changes).

Liger Auto-Patch

Adds Liger Kernel optimization support for a new HuggingFace model, or modifies existing monkey-patching, through a staged pipeline with human review between stages. Supports creating new model patches and modifying existing ones.

Mode Detection

  • Create mode: User asks to add/patch/support a new model → full pipeline (Analyze → Generate → Validate)
  • Modify mode: User asks to update/fix/change/extend an existing monkey-patch → lighter pipeline (Change Impact Analysis → Apply Changes → Validate)

Keywords that suggest modify mode: update, fix, change, add [kernel] to [existing model], extend, modify, new activation, new norm, bug in patch, upstream changed

Pipeline (Create Mode)

Stage 1: Analyze

Follow the Model Analyzer workflow in model-analyzer.md. If the host runtime supports parallel subagents, this stage may be delegated to one; otherwise execute the workflow directly.

This stage reads the HF modeling_*.py source and produces a model profile answering 12 architectural questions from decision-matrix.md.

Human checkpoint: Present the profile. Confirm before proceeding.

Stage 2: Generate

Follow the Code Generator workflow in code-generator.md.

Generates/modifies up to 13 files:

  1. src/liger_kernel/transformers/model/{model}.py — NEW lce_forward
  2. src/liger_kernel/transformers/monkey_patch.py — MODIFY
  3. src/liger_kernel/transformers/__init__.py — MODIFY
  4. src/liger_kernel/transformers/model/output_classes.py — MODIFY if needed
  5. test/transformers/test_monkey_patch.py — MODIFY
  6. test/convergence/bf16/test_mini_models.py — MODIFY (FLCE path)
  7. test/convergence/bf16/test_mini_models_with_logits.py — MODIFY (non-FLCE path)
  8. test/convergence/fp32/test_mini_models.py — MODIFY (FLCE path)
  9. test/convergence/fp32/test_mini_models_with_logits.py — MODIFY (non-FLCE path)
  10. test/convergence/bf16/test_mini_models_multimodal.py — MODIFY if VL model
  11. test/convergence/fp32/test_mini_models_multimodal.py — MODIFY if VL model
  12. test/utils.py — MODIFY
  13. README.md — MODIFY

Human checkpoint: Present changes for review.

Stage 3: Validate

Follow the Validator workflow in validator.md.

Runs instance patching test, convergence test, and lint check. Retries up to 3 times on failure.

Human checkpoint: Report final test results.

Pipeline (Modify Mode)

Show full SKILL.md (209 more words)Show less
Stage 1: Change Impact Analysis

Read the existing apply_liger_kernel_to_{model_type} function in monkey_patch.py and the relevant section of the upstream HF modeling_{model_type}.py. Produce a short change plan:

  • What is being added/changed/fixed
  • Which Liger kernel(s) are involved
  • Which files need modification (subset of the 13 files from create mode)
  • What the expected behavior should be after the change

Human checkpoint: Present the change plan. Confirm before proceeding.

Stage 2: Apply Changes

Follow the Code Generator workflow in code-generator.md in modify mode.

Human checkpoint: Present changes for review.

Stage 3: Validate

Follow the Validator workflow in validator.md. This stage is mandatory — do not skip it. At minimum, run:

  1. Instance patching test: pytest test/transformers/test_monkey_patch.py -k "{model_type}" -xvs
  2. All convergence tests for the model:
    • pytest test/convergence/bf16/test_mini_models.py -k "{model_type}" -xvs (FLCE, bf16)
    • pytest test/convergence/bf16/test_mini_models_with_logits.py -k "{model_type}" -xvs (non-FLCE, bf16)
    • pytest test/convergence/fp32/test_mini_models.py -k "{model_type}" -xvs (FLCE, fp32)
    • pytest test/convergence/fp32/test_mini_models_with_logits.py -k "{model_type}" -xvs (non-FLCE, fp32)
    • If VL (multimodal) model, also run:
      • pytest test/convergence/bf16/test_mini_models_multimodal.py -k "{model_type}" -xvs
      • pytest test/convergence/fp32/test_mini_models_multimodal.py -k "{model_type}" -xvs
  3. Checkstyle: make checkstyle

Human checkpoint: Report final test results.

Reference Files

© linkedin, BSD-2-Clause. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files in .agents/skills/liger-autopatch of linkedin/Liger-Kernel.

  • SKILL.md
  • code-generator.md
  • decision-matrix.md
  • examples/gemma-profile.md
  • examples/llama-profile.md
  • model-analyzer.md
  • templates/lce-forward-dense.md
  • templates/lce-forward-moe.md
  • templates/monkey-patch-fn.md
  • templates/test-convergence.md
  • templates/test-instance-patch.md
  • validator.md

Open the folder on GitHubat commit d5f2817

Compare with similar skills

Liger Autopatch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Liger Autopatch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Liger Autopatch this skilllinkedin/Liger-Kernel6.7k—~1.3kAutomated safety check: PassBSD-2-Clause
Hugging Face Local Model Evalshuggingface/skills11k2 repos~1.6kAutomated safety check: PassApache-2.0
Hugging Face Vision Trainerhuggingface/skills11k1 repos~7.5kAutomated safety check: PassApache-2.0
bitsandbytes Model QuantizationOrchestra-Research/AI-Research-SKILLs13k2 repos~2.5kAutomated safety check: PassMIT
Quark Torch LLM Ptq Evalamd/Quark181—~2.6kAutomated safety check: PassMIT
LLM Torch Profiler Trace AnalysisBBuf/AI-Infra-Auto-Driven-SKILLS925—~2.8kAutomated safety check: PassNone

Similar skills

  • Official

    Runs evaluations of Hugging Face Hub models on local hardware with inspect-ai or lighteval, and helps choose between vLLM, Transformers and accelerate backends.

    11k GitHub starsUsed in 2 repos~1.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Hugging Face Vision Trainer

    huggingface/skills

    Official

    Trains and fine-tunes object detection, image classification and SAM or SAM2 segmentation models on Hugging Face Jobs cloud GPUs and saves the results to the Hub.

    11k GitHub starsUsed in 1 repo~7.5k tokens
    AI & LLM EngineeringAuto-check passed
  • bitsandbytes Model Quantization

    Orchestra-Research/AI-Research-SKILLs

    Loads large language models in 8-bit or 4-bit with bitsandbytes so they fit smaller GPUs, and sets up QLoRA fine-tuning on a 4-bit base model.

    13k GitHub starsUsed in 2 repos~2.5k tokens
    AI & LLM EngineeringAuto-check passed
  • L3 recipe that runs a Torch LLM PTQ end-to-end for AMD Quark — for PyTorch / HuggingFace transformers models (safetensors input): quantize → validate → evaluate.

    181 GitHub stars~2.6k tokensUpdated 11 days ago
    AI & LLM EngineeringAuto-check passed
  • LLM Torch Profiler Trace Analysis

    BBuf/AI-Infra-Auto-Driven-SKILLS

    Analyzes Torch Profiler traces from SGLang, vLLM and TensorRT-LLM servers into kernel attribution, overlap and fusion tables.

    925 GitHub stars~2.8k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Cuda Cpp Kernel

    vipshop/cache-dit

    A skill your agent uses when writing, debugging, porting, reviewing, or optimizing CUDA C++ or PTX kernels; investigating CUDA Runtime or Driver API behavior; profiling kernels with Nsight Systems…

    1.3k GitHub stars~2.3k tokensUpdated 10 days ago
    AI & LLM EngineeringAuto-check passed

More from linkedin/Liger-Kernel

  • Liger Kernel Dev

    linkedin/Liger-Kernel

    Develops production-ready Triton kernels for Liger Kernel. An agent skill from linkedin/Liger-Kernel.

    6.7k GitHub stars~799 tokensUpdated yesterday
    Auto-check passed
  • Liger Kernel Perf

    linkedin/Liger-Kernel

    Optimizes the performance of existing Liger Kernel Triton kernels.

    6.7k GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Questions about Liger Autopatch

What does Liger Autopatch do?

Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching. Liger Autopatch is an agent skill from linkedin/Liger-Kernel. Adds Liger Kernel support for a new HuggingFace Transformers model, or modifies existing monkey-patching.

When should I use Liger Autopatch?

Liger Autopatch fits situations like: adding a new model to Liger Kernel; A user asks to patch an unsupported model; extending MODELTYPETOAPPLYLIGERFN; modifying/updating/fixing an existing monkey-patch (e.g.

How do I install Liger Autopatch in Claude Code?

Run `npx skills add linkedin/Liger-Kernel --skill liger-autopatch -a claude-code`. Or copy the skill folder (.agents/skills/liger-autopatch in linkedin/Liger-Kernel) into .claude/skills/liger-autopatch in your project. Claude Code loads it when a task matches its description.

How do I install Liger Autopatch in Codex?

Run `npx skills add linkedin/Liger-Kernel --skill liger-autopatch -a codex`. Or copy the skill folder (.agents/skills/liger-autopatch in linkedin/Liger-Kernel) into .agents/skills/liger-autopatch in your project. Codex loads it when a task matches its description.

Can I use Liger Autopatch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add linkedin/Liger-Kernel --skill liger-autopatch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/liger-autopatch, .gemini/skills/liger-autopatch, .github/skills/liger-autopatch and .opencode/skills/liger-autopatch in your project.

What does Liger Autopatch need to run?

Going by SKILL.md and its folder, Liger Autopatch needs the command-line tools its instructions call (pytest and make).

Does Liger Autopatch access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Liger Autopatch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Liger Autopatch use?

Liger Autopatch is published under the BSD-2-Clause licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Liger Autopatch use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Liger Autopatch?

Skills that share tags, products or a category with Liger Autopatch: Hugging Face Local Model Evals (huggingface/skills, 11k stars), Hugging Face Vision Trainer (huggingface/skills, 11k stars), bitsandbytes Model Quantization (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Quark Torch LLM Ptq Eval (amd/Quark, 181 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Liger Autopatch?

linkedin (a GitHub organization) maintains it in linkedin/Liger-Kernel, which has 6,652 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 8, 2026.

Source: linkedin/Liger-Kernel on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.