Skip to content
Back to skills

Adapter Core

ASecurity

"Core PEFT adapter setup, configuration, target module selection,

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 8, 2026
devopspythonapi

Works with

  • api

Security analysis

A100/100

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

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill adapter-core --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Adapter Core?

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

Security grade badge for Adapter Core
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-adapter-core/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-adapter-core)

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: adapter-core
description: "Core PEFT adapter setup, configuration, target module selection,
  adapter lifecycle, model/layer status diagnostics, custom models, and
  low-level adapter injection."
disable-model-invocation: true
metadata:
  disco-role: operating
license: Apache 2.0
---

# Adapter Core

Use this sub-skill when the task is about constructing PEFT configs, wrapping a model with adapters, managing adapters after creation, diagnosing adapter state, targeting modules in custom models, or using low-level adapter injection.

## Route Here For

- Install/import smoke checks for `peft`, `torch`, `transformers`, and `accelerate` without downloading models.
- Core API choices: `PeftConfig`, `TaskType`, `PeftType`, `get_peft_model`, `PeftModel`, and adapter names.
- Adapter lifecycle: add, load, activate, disable, delete, inspect trainable parameters, and inspect model/layer status.
- Target module selection for custom or non-Transformers `torch.nn.Module` models.
- Low-level injection with `inject_adapter_in_model` when a `PeftModel` wrapper is not desired.
- Diagnosing invalid task/PEFT types, missing target modules, unsupported module classes, or unexpected trainable status.

## Route Elsewhere

- LoRA variants, quantized loading, DoRA, rsLoRA, QLoRA-style workflows, and LoRA-specific initialization: use `../lora-and-quantization/SKILL.md`.
- Prompt tuning, prefix tuning, p-tuning, soft prompts, or prompt encoder internals: use `../prompt-and-soft-methods/SKILL.md`.
- Saving, loading checkpoints, merging adapters into base weights, or deployment packaging: use `../save-load-merge/SKILL.md`.
- Trainer, Accelerate, distributed, FSDP, DeepSpeed, or multi-GPU training integration: use `../training-and-integrations/SKILL.md`.

## Start Fast

1. Run `python scripts/check_peft_env.py` from this sub-skill directory to verify imports and local package facts.
2. Read `references/api-reference.md` for the core class/function surface and common enum values.
3. Follow `references/workflows.md` for adapter construction, custom model targeting, lifecycle management, and low-level injection.
4. Use `references/troubleshooting.md` when errors mention invalid task types, missing `target_modules`, unsupported modules, adapter status irregularities, or optional dependency imports.

## Core Decision Pattern

- Prefer `get_peft_model(base_model, peft_config, adapter_name="default")` for normal Transformers and custom PyTorch models when PEFT should return a `PeftModel` wrapper with helper methods.
- Use explicit `target_modules` for custom models unless the method and architecture have a known PEFT default mapping.
- Use `modules_to_save` for non-adapter layers that must remain trainable and be stored with the adapter, such as custom heads or task heads.
- Use `print_trainable_parameters()`, `get_model_status()`, and `get_layer_status()` before training when trainable counts, active adapters, or merged/disabled states look surprising.
- Use low-level `inject_adapter_in_model(peft_config, model, adapter_name=...)` only when the caller needs adapter layers in a plain `torch.nn.Module` and does not need `PeftModel` helper methods.

## Bundled Materials

- `references/api-reference.md`: API inventory, enum usage, config validation, lifecycle helpers, and status helpers.
- `references/workflows.md`: practical recipes for standard wrapping, custom modules, target discovery, adapter lifecycle, and low-level injection.
- `references/troubleshooting.md`: diagnosis paths for target module, enum, trainability, optional dependency, custom module, and low-level injection failures.
- `scripts/check_peft_env.py`: safe local import/config smoke check with `--help`, JSON output option, and optional CUDA facts.

Files in this skill

  • SKILL.md3.7 KB
  • references/api-reference.md7.9 KB
  • references/troubleshooting.md8 KB
  • references/workflows.md7.2 KB
  • scripts/check_peft_env.py5.8 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.