Skip to content
Back to skills

Models And Modules

ASecurity

"Use torchtune model/tokenizer builders, PEFT modules, losses,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
developmentpythonbashrailsapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill models-and-modules --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Models And Modules?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Models And Modules
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-models-and-modules/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-models-and-modules)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: models-and-modules
description: "Use torchtune model/tokenizer builders, PEFT modules, losses,
  conversion utilities, and modeling components safely."
disable-model-invocation: true
metadata:
  disco-role: operating
license: BSD 3-Clause
---

# models-and-modules

Use this sub-skill when a torchtune task is about model-family builders, tokenizer/model-transform builders, LoRA/QLoRA/DoRA adapters, transformer/attention/loss modules, MoE and low-precision pieces, state-dict conversion, or custom model components.

## Route Here For

- Choosing public `_component_` dotpaths under `torchtune.models.*` or `torchtune.modules.*` for YAML configs or custom code.
- Pairing model builders with matching tokenizer or multimodal transform builders before dataset or recipe wiring.
- Adding LoRA, QLoRA, DoRA, QAT-LoRA, adapter-state extraction, adapter merging, or trainable-parameter setup.
- Using torchtune modeling blocks such as attention, decoder layers, KV cache, RoPE, RMSNorm, chunked/KL losses, MoE experts, and NF4 linear layers.
- Converting state-dict key formats between torchtune, Meta, Hugging Face, and PEFT adapter conventions.
- Writing custom config-friendly builders without importing the intentionally non-importable `recipes` package.

## Standard Workflow

1. Identify the model family and checkpoint provenance before choosing builder names; use [model catalog](references/model-catalog.md) for public dotpaths.
2. Match the tokenizer or model transform to the same family and downloaded artifact layout before training, generation, or dataset transforms.
3. For adapter work, choose a family `lora_*` or `qlora_*` builder first, then use [PEFT and adapters](references/peft-and-adapters.md) for `lora_attn_modules`, trainable params, and merge/export behavior.
4. For custom code, import public modules from `torchtune.models`, `torchtune.modules`, `torchtune.modules.peft`, `torchtune.modules.loss`, or `torchtune.generation`; avoid private underscore dotpaths in configs.
5. Use [module API reference](references/module-api-reference.md) for component signatures, losses, generation helpers, MoE, low precision, and conversion utilities.
6. Diagnose optional dependency, tokenizer, gated checkpoint, LoRA target, QLoRA, and state-dict issues with [troubleshooting](references/troubleshooting.md) before launching expensive jobs.

## Bundled Helper

Run the helper from this sub-skill directory to inspect callable public model exports in the active environment without instantiating large models:

```bash
python scripts/inspect_model_builders.py --families llama3 qwen2_5 --format table
```

It imports family modules, lists callable public exports and signatures, and reports optional-dependency import failures instead of downloading checkpoints or constructing models.

## Read Next

- [Model catalog](references/model-catalog.md) for family builders, tokenizer notes, multimodal transforms, and public dotpath examples.
- [Module API reference](references/module-api-reference.md) for attention/decoder blocks, losses, generation, MoE, low precision, export variants, and conversion functions.
- [PEFT and adapters](references/peft-and-adapters.md) for LoRA/QLoRA/DoRA/QAT-LoRA config patterns and adapter state dict guidance.
- [Troubleshooting](references/troubleshooting.md) for private dotpaths, gated downloads, tokenizer mismatches, adapter target names, QLoRA dependencies, conversion failures, and export variants.
- [data-and-datasets](../data-and-datasets/SKILL.md) for dataset transforms, message schemas, packing, and collators.
- [post-training-recipes](../post-training-recipes/SKILL.md) for recipe selection and training launch planning.
- [inference-evaluation-quantization](../inference-evaluation-quantization/SKILL.md) for generation workflows, evaluation, and post-training quantization routing.
- [cli-and-config](../cli-and-config/SKILL.md) for `tune cp`, `tune cat`, `tune validate`, `_component_`, and override mechanics.

## Guardrails

- Use public dotpaths such as `torchtune.models.llama3.llama3_8b`, not private implementation paths like `torchtune.models.llama3._model_builders.llama3_8b`.
- Do not `import recipes`; use `tune run`, registry names, copied config files, or custom recipe files launched through the CLI.
- Do not instantiate full model builders just to inspect names; use signatures, configs, or the bundled inspection helper.
- Do not leak checkpoint locations, token files, credentials, local environments, or machine-specific paths into reusable configs or skill content.
- Keep dataset schemas in `data-and-datasets`, recipe launch construction in `post-training-recipes`, and generation/evaluation/quantization workflows in `inference-evaluation-quantization`.

Files in this skill

  • SKILL.md4.6 KB
  • references/model-catalog.md8.2 KB
  • references/module-api-reference.md8.7 KB
  • references/peft-and-adapters.md6.7 KB
  • references/troubleshooting.md6.3 KB
  • scripts/inspect_model_builders.py5.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.