piper-plus: Skill for Claude Code

.claude/skills/publish-model/SKILL.md

publish-model is a skill for Claude Code from ayutaz/piper-plus. It costs 94 tokens per session (1,615 once invoked), scanned A, original, MIT.

A model-release workflow that converts a trained PyTorch Lightning checkpoint into ONNX, checks the result, measures runtime, and can upload it to Hugging Face. ONNX is a portable format for running machine-learning models in different software environments.

In plain words
What is it for?
Use it with a checkpoint file to export an ONNX model, run sanity checks, and benchmark real-time performance. It can skip benchmarking or, with the apply option, upload the verified result to a selected Hugging Face repository.
Why use it?
It joins several release steps that are otherwise easy to perform inconsistently or pass between people incorrectly. Uploading is kept separate so the model is checked before it is published.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; positional $N argument.

This is ayutaz/piper-plus's own configuration. It tells Claude Code how to work on piper-plus itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything piper-plus configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is uv run python scripts/check_onnx_export_contract.py 2>&1 | tail -3.

Reuse

Borrowing it

Nothing to install: this file belongs to ayutaz/piper-plus. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ayutaz/piper-plus/dev/.claude/skills/publish-model/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/ayutaz/piper-plus

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for publish-model

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayutaz/piper-plus/publish-model.svg)](https://agentmods.dev/skills/ayutaz/piper-plus/publish-model)
Your own site
<a href="https://agentmods.dev/skills/ayutaz/piper-plus/publish-model"><img src="https://agentmods.dev/badge/skills/ayutaz/piper-plus/publish-model.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,615 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.01615
Opus 5 $0.00047 $0.00807
Sonnet 5 $0.00019 $0.00323
Haiku 4.5 $0.00009 $0.00161

Measured 7d ago against content hash cf726fec46e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

publish-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/publish-model/SKILL.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Model Publish Pipeline Skill

Lightning checkpoint から HuggingFace 公開までを 1 つの skill に集約。 現状 4 ステップ手動運用 (export → infer test → RTF bench → HF push) で、 工程間の引き継ぎミスが頻発する。

memory feedback_merge_caution.md に従い、 publish (HuggingFace への push) は確認後に明示実行。 デフォルトは export + sanity + bench までで停止。

引数

  • $1 (必須): checkpoint パス、 例 /data/piper/output-tsukuyomi-finetune-6lang-v2/last.ckpt
  • --output PATH: 出力 ONNX パス (デフォルト: checkpoint 隣に .onnx)
  • --repo OWNER/REPO: HuggingFace repo 名 (デフォルト: ayousanz/<voice-key>)
  • --skip-benchmark: フェーズ 4 を skip
  • --apply: フェーズ 5 (HuggingFace upload) も実行

現在の状態

  • ブランチ: !git rev-parse --abbrev-ref HEAD
  • 引数: $ARGUMENTS

フェーズ 1: 事前検査

# Checkpoint 存在 / サイズ確認
ls -la "$1"
file "$1"  # PyTorch Lightning checkpoint であることを確認

# Contract gate (drift 検出して bump 前 fail)
uv run python scripts/check_onnx_export_contract.py 2>&1 | tail -3
uv run python scripts/check_phoneme_set_version.py 2>&1 | tail -3

フェーズ 2: ONNX export

CLAUDE.md の推奨設定 (FP16 + EMA + stochastic + emb_lang 自動統一) を使う:

CUDA_VISIBLE_DEVICES="" uv run python -m piper_train.export_onnx \
    "$CKPT_PATH" "$OUTPUT_ONNX"

出力後の verification:

# ONNX checker / shape inference
uv run python -c "import onnx; m=onnx.load('$OUTPUT_ONNX'); onnx.checker.check_model(m); onnx.shape_inference.infer_shapes(m)"

# Size 確認 (FP16 で ~50% 削減されているか)
ls -la "$OUTPUT_ONNX"

フェーズ 3: Inference sanity check

# JSONL 1 行入力で推論テスト
echo '{"phoneme_ids": [1, 2, 3, 4, 5], "speaker_id": 0}' | \
    CUDA_VISIBLE_DEVICES="" uv run python -m piper_train.infer_onnx \
        --model "$OUTPUT_ONNX" --output-dir /tmp/sanity

# 出力 wav の sanity 確認
ls -la /tmp/sanity/*.wav

無音 / クリップ / 形状不一致を catch。

フェーズ 4: RTF benchmark (optional)

uv run python tools/benchmark/run_benchmark.py \
    --model "$OUTPUT_ONNX" --warmup 5 --runs 30 \
    --output /tmp/rtf_$(basename "$OUTPUT_ONNX" .onnx).json

baseline (README.md の Benchmark 表、 Xeon E5-2650 v4 / 25 phoneme 英文 / 27ms) と比較し、 ±30% 以内なら OK、 大きい drift があれば warning。

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 137 lines · 94 tokens per session scan A cf726fec46e0

Subscribe to this mod's changes

publish-model is a skill published in the GitHub repository ayutaz/piper-plus (204 stars, last pushed 5d ago), licensed MIT. It adds 94 tokens to every session and 1,615 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

physicsnemo-shard-tensor

Official NVIDIA-authored guidance for PhysicsNeMo ShardTensor domain parallelism — integrate domain parallelism into training/inference scripts (new or existing) with DDP or FSDP2, write and register shard patches to enable new layers/ops, and bootstrap multi-GPU correctness tests. Use when working with ShardTensor…

NVIDIA/physicsnemo · 152 tokens

physicsnemo-discover

Official NVIDIA-authored guidance for navigating PhysicsNeMo — pick the model, datapipe, or example for a SciML/AI4Science task (surrogates, forecasting, downscaling, physics-informed, inverse, generative). Points at existing files via live repo search; never writes code. Do NOT use for installation or environment…

NVIDIA/physicsnemo · 124 tokens

single-cell-multi-omics-analysis-scvi

Probabilistic deep learning framework for single-cell multi-omics data analysis. Use this skill when: (1) Analyzing single-cell RNA-seq data with batch correction, (2) Integrating multi-modal data (CITE-seq, ATAC-seq, multi-omics), (3) Performing cell type annotation with scANVI, (4) Spatial transcriptomics…

PharMolix/OpenBioMed · 94 tokens

deep-learning

Use when training or debugging a neural net in PyTorch — the forward/loss/backward/step loop and its silent bugs, mixed precision (AMP), AdamW/LR schedules, DDP/FSDP/ZeRO, checkpoints and seeds. NOT LoRA/QLoRA on a pretrained LLM (that is finetuning), NOT tabular sklearn/XGBoost (that is machine-learning), NOT…

ericrisco/rsc-harness · 102 tokens

graphsignal-profiler

Set up the Graphsignal Profiler for inference workloads — vLLM, SGLang, PyTorch, and dstack services. Use when the user wants GPU profiling, tracing, or monitoring for inference, asks about graphsignal-run or graphsignal.watch(), or asks about CUPTI / Prometheus / OTLP setup.

graphsignal/graphsignal-profiler · 74 tokens

atc-model-converter

Complete toolkit for Huawei Ascend NPU model conversion and end-to-end inference adaptation. Workflow 1 auto-discovers input shapes and parameters from user source code. Workflow 2 exports PyTorch models to ONNX. Workflow 3 converts ONNX to .om via ATC with multi-CANN version support. Workflow 4 adapts the user's full…

Ascend/agent-skills · 142 tokens