Agent skill

Community Model Conversion

by RisorseArtificiali in RisorseArtificiali/anti-vocale

Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Community Model Conversion

skills CLI
$ npx skills add RisorseArtificiali/anti-vocale --skill community-model-conversion -a claude-code

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

GitHub CLI
$ gh skill install RisorseArtificiali/anti-vocale community-model-conversion --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/RisorseArtificiali/anti-vocale.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/community-model-conversion .claude/skills/community-model-conversion && 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
community-model-conversion
GitHub stars
118
Token cost
~2.2k tokens
SKILL.md length
1,188 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog.

  • Works in 7 steps: Triage the user's repo FIRST (before any… → Environment (CPU only is fine, ~40 min… → HF transformers checkpoint ->… → …
  • A user requests an importable model for a language we dont cover
  • SKILL.md covers 0. Triage the user's repo…, 1. Environment (CPU only is…, 2. HF transformers checkpoint… and 3. sherpa export…, plus 3 more sections
  • Calls pip and git

What it does

Community Model Conversion is an agent skill from RisorseArtificiali/anti-vocale. Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog. Use when a user requests an importable model for a language we don't cover, or when catalog-listed repos fail to import.

Its SKILL.md is about 2.2k 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 Speech recognition and synthesis, Model hubs and datasets and Android development. It works with ONNX, Hugging Face, Whisper and Kotlin. The repository describes itself as: Android app for transcribing voice messages locally on-device, with no internet required. The licence is Apache-2.0.

When your agent uses it

  • A user requests an importable model for a language we dont cover
  • Catalog-listed repos fail to import

Example prompts

  • “/community-model-conversion”

Requirements

  • Python 3

Workflow steps

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

  1. Triage the user's repo FIRST (before any conversion work)
  2. Environment (CPU only is fine, ~40 min end to end)
  3. HF transformers checkpoint -> openai-whisper .pt
  4. sherpa export (export-onnx.py, patched for a local checkpoint)
  5. Publish + catalog
  6. Device validation (REQUIRED before advertising: we promised on GH)
  7. Close out

What it can do on your machine

Read from SKILL.md and the folder at commit d2d157e. 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:

    • pip
    • git

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

  • Network

    No URLs in SKILL.md. Its commands use pip and git, which can reach the network depending on how they are called.

    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

Community Model Conversion loads about 2.2k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 1,188 words of instructions outside code blocks.

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

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 RisorseArtificiali/anti-vocale at commit d2d157e, republished under its Apache-2.0 licence (© RisorseArtificiali). 1,188 words, ~2,232 tokens.

Download SKILL.mdSave it as .claude/skills/community-model-conversion/SKILL.md (or your agent's skills folder).
name
community-model-conversion
description
Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog. Use when a user requests an importable model for a language we don't cover, or when catalog-listed repos fail to import.

Community model conversion (HF fine-tune -> sherpa-onnx -> catalog entry)

This pipeline turns "user wants language X" into a one-URL import in the app. Every step below was learned from a real conversion (Arabic 2026-08, Swiss German 2026-08-24, GH #63). The gotchas are the point of this file: each one cost hours because the failure mode is silent (models load but transcribe garbage, or decode to empty strings).

0. Triage the user's repo FIRST (before any conversion work)

If the user points at onnx-community/* or any transformers.js-layout export (onnx/encoder_model*.onnx + tokenizer.json, inputs named input_features / last_hidden_state): STOP. It is structurally incompatible with sherpa-onnx (no n_mels/model_type metadata, wrong tensor names, merged decoder KV cache). Our app's rejection message is correct; relaxing validation would only turn it into a native exit 255. Verify cheaply with the eval harness: OfflineRecognizer.from_whisper(...) fails at InitEncoder: 'n_mels' does not exist in the metadata. The fix is a re-export from the fine-tuned PyTorch checkpoint, not the ONNX files.

Then find the PyTorch source of the fine-tune (check the HF model card's base_model, search ?search=<model name> on the HF API). Swiss German had Flurin17/whisper-large-v3-turbo-swiss-german behind the onnx-community mirror.

1. Environment (CPU only is fine, ~40 min end to end)

  • Workspace on REAL disk (NOT /tmp: it is tmpfs, the fp32 graphs are ~3 GB and eat RAM twice), e.g. /var/tmp/chwork.
  • venv: torch+cpu, transformers, onnx, onnxruntime, onnxscript, openai-whisper, safetensors, numpy<2. Python 3.14 + onnx may need pip install -U ml_dtypes or onnx<1.20 (float4 attribute error).
  • sherpa-onnx sources at the pinned tag (git clone --branch v1.13.5 ...; the tag equals the .sherpa-version srclib commit) for scripts/whisper/export-onnx.py.
  • Validate with the eval harness venv (eval/.venv, sherpa-onnx Python).

2. HF transformers checkpoint -> openai-whisper .pt

The export script consumes openai-whisper models. Write a key remapper (kept at the workspace; see memory checkpoint for the working one): encoder/decoder layer subkeys map (self_attn.q_proj->attn.query, layer_norm1->attn_ln, final_layer_norm->mlp_ln, bare fc1/fc2-> mlp.0/mlp.2, encoder_attn.*->cross_attn.*), drop lm_head (tied), drop k_proj.bias (softmax-invariant: adds q.b, constant across keys).

GOTCHA 1 (the big one): turbo's decoder positional embedding is LEARNED, not sinusoid. Download the official turbo.pt from the URL in whisper/__init__.py and check: decoder.positional_embedding has std ~0.0066 (near-zero learned table), while a sinusoid has std ~0.7. You MUST copy model.decoder.embed_positions.weight (and the encoder one) from the HF checkpoint; injecting a hand-computed sinusoid produces models that load, run, and emit total garbage. Symptom if you get this wrong: weights verified identical, architecture verified identical, output still gibberish.

Wrap the result as {'dims': {...}, 'model_state_dict': sd} with dims read off the shapes (turbo: n_mels 128, n_audio_* 1500/1280/20/32, n_text_* 448/1280/20/4, n_vocab from token_embedding). whisper.load_model infers from dims.

Validate BEFORE exporting: transcribe a short wav with openai-whisper from the converted .pt AND with the original HF pipeline; they must agree. If you see NaN logits, you probably read a 22 kHz int16 wav as float32 (use whisper.load_audio / ffmpeg), not a model bug.

3. sherpa export (export-onnx.py, patched for a local checkpoint)

Local patches needed (keep them in the working copy):

  • add the model name to --model choices and to a load_model branch returning whisper.load_model("./<name>.pt");
  • the n_mels branch (large/turbo -> 128) must include your name;
  • the external-data save branches ("large" in filename) must include your name: the fp32 graphs exceed the 2 GB protobuf limit (FileExistsError on rerun: delete *.weights too, not just *.onnx*). NEVER delete these files while the export is still running: the .weights beside the .onnx is the canonical external data the proto points at, and deleting it mid-run (2026-08-28, "looked like a duplicate") crashes quantization and forces a full re-export. Clean up only after the process exits.

GOTCHA 2a (int8 truncation): per-tensor int8 quantization of a FINE-TUNED whisper decoder causes premature EOT after ~1 phrase per 30s chunk. The fine-tune shifts weight distributions; per-tensor crushes outlier channels and the greedy decoder stops early. Short audio looks correct, 30s chunks yield 1 phrase instead of 15. FIX: pass per_channel=True to quantize_dynamic() for the decoder (ORT docs recommend it when accuracy loss is large). Verified: per-channel int8 = identical output to fp32 at the same size. The encoder is unaffected. MODEL-DEPENDENT (2026-08-27, primeline German): a light fine-tune (3 epochs, lr 1e-6) moved distributions so little that per-tensor survived a 62s tiled test with no truncation (only a token-casing wobble); the Swiss fine-tune truncated at 30s. You cannot predict which kind you have: always quantize the decoder per-channel, and always test with a tiled ~30s audio file (60s is better) before publishing.

GOTCHA 2b: torch >= 2.9 defaults torch.onnx.export to the dynamo exporter, which bakes a wrong cross-KV reshape in the whisper decoder. Symptom: sherpa decodes to EMPTY text and logs Caught exception ... Reshape ... input_shape_size == requested_shape_size was false, Input shape {1,4,1280} requested {1280} (hidden behind the misleading "tail_paddings" message). Fix: pass dynamo=False for the decoder export. The encoder is unaffected.

Quantization (int8, MatMul-only) is produced by the script itself.

Validate: decode the same wav via OfflineRecognizer.from_whisper in eval/.venv; must match the HF ground truth. Use audio >= 10 s or sherpa's "Return an empty result ... input frames" fires (frames must exceed tail_paddings, 1000 default). Load the wav with ffmpeg resampling, not np.frombuffer.

Show full SKILL.md (356 more words)Show less

4. Publish + catalog

  • HF repo under pantinor/ (hf CLI, HUGGINGFACE token at ~/.cache/huggingface/token). README yaml: language: needs ISO codes (de, gsw), NOT de-CH (use language_bcp47: for that) or the upload is rejected.
  • Entry JSON in app/src/main/assets/external-catalog/<lang>.json (mirror arabic.json exactly: family, per-file url/sha256/size; whisper options use the keys "whisper.language"/"whisper.task" from ModelFamilySupport).
  • the CURRENT versioned index (index-<versionName>.json, the highest-versioned index-*.json present; TASK-643): add the entry. NEVER the unsuffixed index.json (frozen legacy channel for <=1.13.x apps). GOTCHA 3: the catalog matcher prefix-matches name WORDS and language codes, not raw substrings ("ry" inside "Canary" stays silent; a name WORD starting with a code matches it). The by-code test pins filter("ar") == the arabic entries (TWO since TASK-770: the turbo quality pick and the small light option, both carrying the word "Arabic"). A name word starting with another entry's code ("Armenian" for "ar", "Farsi" for "fa") would surface that entry under the code and break the pin.
  • The entryUrl points at raw.githubusercontent.com main: push BEFORE any released client can use it, and curl the URL to 200 after push.
  • Full suite (test count asserts in ExternalCatalogTest), /review-local, commit, push.

5. Device validation (REQUIRED before advertising: we promised on GH)

Import path: Model tab > Advanced > ONNX Sherpa > family=Whisper > "Import from URL" (NOT "Import from Hugging Face URL", that is the LiteRT-LM importer). Type a unique language code (e.g. "gsw") to filter the catalog suggestion; tap the suggestion NAME line; verify the field shows the entry URL; Import; confirm the file list; wait for the ~1 GB download; run a transcription in that language.

Driving this via adb is fragile: urlText persists across dialog opens (force-stop resets it), BACK dismisses the dialog (never use it to hide the keyboard), and input text renders fine but verify with a screenshot read via the zai MCP image tools, not by eyeballing. If the form fights you more than twice, ask the user to do the manual step and verify the result from run-as ... ls files/models/external + the datastore record instead.

6. Close out

  • Reply on the originating GH issue with the analysis + catalog link.
  • Backlog task final summary; delete the multi-GB workspace only after the device pass.

© RisorseArtificiali, 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

Files

Just SKILL.md in .claude/skills/community-model-conversion of RisorseArtificiali/anti-vocale.

Open the folder on GitHubat commit d2d157e

Compare with similar skills

Community Model Conversion 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.

Community Model Conversion compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Community Model Conversion this skillRisorseArtificiali/anti-vocale118—~2.2kAutomated safety check: PassApache-2.0
Xybrid Initxybrid-ai/xybrid469—~3kAutomated safety check: PassApache-2.0
Configure G1 Sim2realEGalahad/sim2real146—~1.5kAutomated safety check: PassNone
Test Modelxybrid-ai/xybrid469—~1.3kAutomated safety check: PassApache-2.0
Transformers.jshuggingface/skills11k1 repos~6.2kAutomated safety check: PassApache-2.0
Publish Modelayutaz/piper-plus234—~1.1kAutomated safety check: PassMIT

Similar skills

  • Xybrid Init

    xybrid-ai/xybrid

    Generate model metadata for an ML model so it works with xybrid.

    469 GitHub stars~3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Configure G1 Sim2real

    EGalahad/sim2real

    Install, repair, and verify sim2real on G1 robot computers. An agent skill from EGalahad/sim2real.

    146 GitHub stars~1.5k tokensUpdated 12 days ago
    AI & LLM EngineeringAuto-check passed
  • Test Model

    xybrid-ai/xybrid

    Test a model end-to-end using the xybrid execution system. An agent skill from xybrid-ai/xybrid.

    469 GitHub stars~1.3k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Transformers.js

    huggingface/skills

    Official

    Runs pre-trained Hugging Face models in JavaScript or TypeScript with Transformers.js, in browsers or Node.js, Bun and Deno, for text, vision, audio and multimodal tasks.

    11k GitHub starsUsed in 1 repo~6.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Publish Model

    ayutaz/piper-plus

    学習済み Lightning checkpoint (.ckpt) を ONNX export → sanity check → RTF benchmark → HuggingFace upload まで連鎖実行する read-mostly skill。

    234 GitHub stars~1.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Prepare export and downstream evaluation handoff for a planned or completed Quark PTQ run.

    182 GitHub stars~1.5k tokensUpdated 12 days ago
    AI & LLM EngineeringAuto-check passed

More from RisorseArtificiali/anti-vocale

  • Model Scout

    RisorseArtificiali/anti-vocale

    A skill your agent uses when the user asks to "scout for new models", "check for model updates", "find better ASR models", "check sherpa-onnx releases", "look for new Whisper models", "search…

    118 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed

Questions about Community Model Conversion

What does Community Model Conversion do?

Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog. Community Model Conversion is an agent skill from RisorseArtificiali/anti-vocale. Convert a HuggingFace ASR fine-tune into a sherpa-onnx external model, publish it, and add it to the Anti-Vocale community catalog.

When should I use Community Model Conversion?

Community Model Conversion fits situations like: A user requests an importable model for a language we dont cover; catalog-listed repos fail to import.

How do I install Community Model Conversion in Claude Code?

Run `npx skills add RisorseArtificiali/anti-vocale --skill community-model-conversion -a claude-code`. Or copy the skill folder (.claude/skills/community-model-conversion in RisorseArtificiali/anti-vocale) into .claude/skills/community-model-conversion in your project. Claude Code loads it when a task matches its description.

How do I install Community Model Conversion in Codex?

Run `npx skills add RisorseArtificiali/anti-vocale --skill community-model-conversion -a codex`. Or copy the skill folder (.claude/skills/community-model-conversion in RisorseArtificiali/anti-vocale) into .agents/skills/community-model-conversion in your project. Codex loads it when a task matches its description.

Can I use Community Model Conversion 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 RisorseArtificiali/anti-vocale --skill community-model-conversion -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/community-model-conversion, .gemini/skills/community-model-conversion, .github/skills/community-model-conversion and .opencode/skills/community-model-conversion in your project.

What does Community Model Conversion need to run?

Going by SKILL.md and its folder, Community Model Conversion needs the command-line tools its instructions call (pip and git). Our summary lists: Python 3.

Does Community Model Conversion access the network?

SKILL.md contains no URLs. Its commands use pip and git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Community Model Conversion 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 Community Model Conversion use?

Community Model Conversion 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.

How many tokens does Community Model Conversion use?

About 2.2k tokens (SKILL.md is roughly 8.9k 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 Community Model Conversion?

Skills that share tags, products or a category with Community Model Conversion: Xybrid Init (xybrid-ai/xybrid, 469 stars), Configure G1 Sim2real (EGalahad/sim2real, 146 stars), Test Model (xybrid-ai/xybrid, 469 stars) and Transformers.js (huggingface/skills, 11k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Community Model Conversion?

RisorseArtificiali (a GitHub organization) maintains it in RisorseArtificiali/anti-vocale, which has 118 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 9, 2026.

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