Nvflare Convert Huggingface
NVIDIA/skills
Convert existing Hugging Face Transformers Trainer or TRL SFTTrainer training code into an NVFLARE federated job using flare.patch(trainer), local validation, and job export; use when the user names…
HuggingFace Transformers integration for PerforatedAI. An agent skill from PerforatedAI/PerforatedAI.
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformers --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .claude/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.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/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .claude/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformersType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformers --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .agents/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .agents/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformers --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .cursor/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .cursor/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PerforatedAI/PerforatedAI.git --path skills/perforatedai-libraries-transformers--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformers --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .gemini/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .gemini/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformersInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .github/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .github/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PerforatedAI/PerforatedAI perforatedai-libraries-transformers --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PerforatedAI/PerforatedAI.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/perforatedai-libraries-transformers .opencode/skills/perforatedai-libraries-transformers && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "perforatedai-libraries-transformers" agent skill from https://github.com/PerforatedAI/PerforatedAI/tree/main/skills/perforatedai-libraries-transformers into .opencode/skills/perforatedai-libraries-transformers/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "perforatedai-libraries-transformers", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
perforatedai-libraries-transformersHuggingFace Transformers integration for PerforatedAI. An agent skill from PerforatedAI/PerforatedAI.
Perforatedai Libraries Transformers is an agent skill from PerforatedAI/PerforatedAI. HuggingFace Transformers integration for PerforatedAI. Handles the Trainer-specific differences: usingperforatedai=True, GPA.metric, evalstrategy. Use when the user's script uses HuggingFace Trainer.
Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering Model hubs and datasets and Deep learning. It works with Hugging Face and Transformers. The repository describes itself as: Add Dendrites to your PyTorch Project. The licence is Apache-2.0.
Read from SKILL.md and the folder at commit 9d317e6. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Perforatedai Libraries Transformers loads about 1.6k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 444 words of instructions outside code blocks.
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.
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.
The full file from PerforatedAI/PerforatedAI at commit 9d317e6, republished under its Apache-2.0 licence (© PerforatedAI). 444 words, ~1,606 tokens.
.claude/skills/perforatedai-libraries-transformers/SKILL.md (or your agent's skills folder).This skill handles PAI integration when the user is using the HuggingFace Trainer (from the transformers library). It replaces the standard optimizer, training loop, and restructuring steps from the main perforatedai skill.
The standard transformers package does not include the hooks that PAI requires. Using PAI with HuggingFace Trainer requires the transformers-perforated library.
Check if already installed: Ask the user if they have transformers-perforated in their environment. If yes, skip this step.
If not installed: Tell them: "PAI integration with Trainer requires transformers-perforated. See the PerforatedAI documentation for installation details."
Add these imports (same as any PAI integration):
from perforatedai import globals_perforatedai as GPA
from perforatedai import utils_perforatedai as UPAAdd this block after the model is created and before the Trainer is constructed.
With the HF Trainer you cannot call add_validation_score() directly — the Trainer manages evaluation internally. Instead, tell PAI which metric key to read from the Trainer's evaluation output:
GPA.pc.set_library_validation_score("eval_loss")
GPA.pc.set_library_extra_scores(["train_loss"])"eval_accuracy" (or whatever your compute_metrics returns) when maximizing"eval_loss" when minimizing lossperforate_modelGPA.pc.set_testing_dendrite_capacity(True) # Start True for initial capacity check; switch to False for real training
GPA.pc.set_switch_mode(GPA.pc.DOING_HISTORY)
GPA.pc.set_n_epochs_to_switch(10) # Adjust based on your training length
# Optional: restrict which modules get dendrites
# GPA.pc.append_module_names_to_track(['ViTModel', 'ViTEncoder'])model = UPA.perforate_model(
model,
save_name="my_model_dendritic",
maximizing_score=True, # True for accuracy; False for loss
making_graphs=True,
)PAI needs a validation score after every epoch. Set eval_strategy="epoch":
training_args = TrainingArguments(
output_dir="./output",
eval_strategy="epoch", # Required — PAI reads per-epoch scores
# num_train_epochs — do NOT set this to a huge number; PAI manages training termination internally
...
)Do NOT set num_train_epochs=1000000 — PAI handles training termination automatically.
The single most important HF-specific change is passing using_perforatedai=True to the Trainer:
trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
compute_metrics=compute_metrics,
using_perforatedai=True, # THE key addition — without this PAI has no effect
)
trainer.train()Without this flag the Trainer runs normally and PAI never activates.
When using_perforatedai=True is set, the transformers-perforated library handles these internally — do not add them manually:
GPA.pai_tracker.add_validation_score() after each epochThis means you do not write a manual restructuring loop, set a huge epoch count, or manage the optimizer lifecycle yourself.
If the user is using a HuggingFace model (e.g., AutoModelForImageClassification) but writing their own training loop (no Trainer), the transformers-perforated library's automatic handling does not apply. In that case, go back to the standard perforatedai skill and follow the normal steps (optimizer setup, add_validation_score, restructuring loop, model.to(device) after restructuring, etc.).
from perforatedai import globals_perforatedai as GPA
from perforatedai import utils_perforatedai as UPA
from transformers import Trainer, TrainingArguments
# --- after model is created ---
GPA.metric = "eval_accuracy" # metric key from compute_metrics
GPA.pc.set_testing_dendrite_capacity(True) # True for initial check; False for real training
GPA.pc.set_switch_mode(GPA.pc.DOING_HISTORY)
GPA.pc.set_n_epochs_to_switch(10)
model = UPA.perforate_model(
model,
save_name="my_model_dendritic",
maximizing_score=True,
making_graphs=True,
)
training_args = TrainingArguments(
output_dir="./output",
eval_strategy="epoch",
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
compute_metrics=compute_metrics,
using_perforatedai=True,
)
trainer.train()Tell the user to run their script. With set_testing_dendrite_capacity(True), PAI will run a 7-epoch test and print:
Successfully added 3 dendrites with GPA.pc.set_testing_dendrite_capacity(True) (default).
You may now set that to False and run a real experiment.Once they see this, change set_testing_dendrite_capacity(True) → set_testing_dendrite_capacity(False) in their script and tell them to run full training.
Working examples using this integration:
examples/libraryexamples/huggingface/BERT/train_bert_pai.py — BERT/RoBERTa classificationexamples/libraryexamples/huggingface/mnist/mnist_huggingface_perforatedai.py — Simple CNN with custom Trainer subclassexamples/libraryexamples/huggingface/ViT Demo Example/ — Step-by-step walkthrough of adding PAI to the official HF image classification scriptSee examples/libraryexamples/huggingface/README.md for the full integration guide.
© PerforatedAI, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/perforatedai-libraries-transformers of PerforatedAI/PerforatedAI.
Open the folder on GitHubat commit 9d317e6
Perforatedai Libraries Transformers 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Perforatedai Libraries Transformers this skillPerforatedAI/PerforatedAI | 237 | — | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Nvflare Convert HuggingfaceNVIDIA/skills | 3.5k | — | ~3.5k | Automated safety check: Pass | Apache-2.0 | |
| Hugging Face Local Model Evalshuggingface/skills | 11k | 2 repos | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Hugging Face Vision Trainerhuggingface/skills | 11k | 1 repos | ~7.5k | Automated safety check: Pass | Apache-2.0 | |
| Megakernel OptimizationRightNow-AI/AutoMegaKernel | 148 | — | ~1.8k | Automated safety check: Pass | MIT | |
| Cosmos3 Post TrainingNVIDIA/cosmos-framework | 559 | — | ~2.7k | Automated safety check: Pass | Custom licence |
NVIDIA/skills
Convert existing Hugging Face Transformers Trainer or TRL SFTTrainer training code into an NVFLARE federated job using flare.patch(trainer), local validation, and job export; use when the user names…
huggingface/skills
Runs evaluations of Hugging Face Hub models on local hardware with inspect-ai or lighteval, and helps choose between vLLM, Transformers and accelerate backends.
huggingface/skills
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.
RightNow-AI/AutoMegaKernel
A skill your agent uses when optimizing or generating a CUDA megakernel for a HuggingFace Llama-family model with AutoMegaKernel (AMK), drives the correctness-gated propose - eval - keep/revert loop…
NVIDIA/cosmos-framework
Guide users through Cosmos3 supervised fine-tuning (SFT) post-training: preparing the example dataset and Wan2.2 VAE, converting the base checkpoint to DCP, launching distributed training (paired…
Orchestra-Research/AI-Research-SKILLs
Train Mixture of Experts (MoE) models using DeepSpeed or HuggingFace.
PerforatedAI/PerforatedAI
Solutions for non-trivial PerforatedAI integration scenarios.
PerforatedAI/PerforatedAI
Render a single-panel PAI figure of score versus parameter count from sweep CSVs, PAI run folders, or hand-supplied numbers.
PerforatedAI/PerforatedAI
Expert in PerforatedAI library for adding artificial dendrites to PyTorch neural networks.
PerforatedAI/PerforatedAI
Analyze PerforatedAI training results and provide optimization recommendations.
PerforatedAI/PerforatedAI
WandB-specific PerforatedAI integration guardrail skill. An agent skill from PerforatedAI/PerforatedAI.
PerforatedAI/PerforatedAI
Multi-GPU setup for PerforatedAI with DataParallel or DistributedDataParallel (DDP).
Works with
Categories
HuggingFace Transformers integration for PerforatedAI. An agent skill from PerforatedAI/PerforatedAI. Perforatedai Libraries Transformers is an agent skill from PerforatedAI/PerforatedAI. HuggingFace Transformers integration for PerforatedAI.
Perforatedai Libraries Transformers fits situations like: the users script uses HuggingFace Trainer; tasks that involve Model hubs and datasets; tasks that involve Deep learning.
Run `npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a claude-code`. Or copy the skill folder (skills/perforatedai-libraries-transformers in PerforatedAI/PerforatedAI) into .claude/skills/perforatedai-libraries-transformers in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a codex`. Or copy the skill folder (skills/perforatedai-libraries-transformers in PerforatedAI/PerforatedAI) into .agents/skills/perforatedai-libraries-transformers in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PerforatedAI/PerforatedAI --skill perforatedai-libraries-transformers -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/perforatedai-libraries-transformers, .gemini/skills/perforatedai-libraries-transformers, .github/skills/perforatedai-libraries-transformers and .opencode/skills/perforatedai-libraries-transformers in your project.
SKILL.md names no scripts, command-line tools or credentials: Perforatedai Libraries Transformers is instructions for the agent only. Our summary lists: Python 3.
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.
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.
Perforatedai Libraries Transformers is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Perforatedai Libraries Transformers: Nvflare Convert Huggingface (NVIDIA/skills, 3.5k stars), Hugging Face Local Model Evals (huggingface/skills, 11k stars), Hugging Face Vision Trainer (huggingface/skills, 11k stars) and Megakernel Optimization (RightNow-AI/AutoMegaKernel, 148 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PerforatedAI (a GitHub organization) maintains it in PerforatedAI/PerforatedAI, which has 237 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 2026.
Source: PerforatedAI/PerforatedAI on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.