fine-tuning
Skill by VectorSpaceLab
Fine-tuning guides supervised fine-tuning of LLaMA and OPT style causal language models with Alpaca data. It is for developers using Hugging Face Trainer, FSDP, and optional DeepSpeed ZeRO-3 CPU offload.
Install fine-tuning
Built from the published package, never by AI.
git clone --depth 1 https://github.com/VectorSpaceLab/AREX-Skill /tmp/AREX-Skill && mkdir -p ~/.claude/skills && cp -r /tmp/AREX-Skill/skills/repositories/repo-skills/stanford-alpaca/sub-skills/fine-tuning ~/.claude/skills/fine-tuningRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/VectorSpaceLab/AREX-Skill /tmp/AREX-Skill && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/AREX-Skill/skills/repositories/repo-skills/stanford-alpaca/sub-skills/fine-tuning ~/.gemini/antigravity-cli/skills/fine-tuningAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill covers supervised fine-tuning of Alpaca-style causal language models. It explains the Hugging Face AutoModelForCausalLM, AutoTokenizer, and Trainer flow, tokenizer special-token resizing, and source-token label masking. It includes FSDP launch recipes for LLaMA and OPT layers, and an optional DeepSpeed ZeRO-3 CPU offload config.
The skill routes dataset schema, prompt wording, instruction generation, and weight-diff recovery to sibling sub-skills. A command builder prints launch command text without starting training. A self-contained Stanford Alpaca trainer script is also described. It is aimed at developers who run Alpaca-style fine-tuning on GPUs and want documented recipes and troubleshooting guidance.
Written from the project's SKILL.md and checked against it.
What it can do
- Training script walkthroughExplains how train.py parses model, data, and training arguments with Hugging Face classes.
- Source-token label maskingDescribes preprocess, which concatenates prompts and targets and masks source labels with -100.
- FSDP launch recipesGives full_shard auto_wrap settings for LLaMA and OPT decoder layer wrapping.
- DeepSpeed ZeRO-3 offloadPoints to a bundled config with CPU parameter and optimizer offload.
- Launch command builderPrints training command text for planning and review without launching training.
- Self-contained Alpaca trainerOffers an adapted Stanford Alpaca SFT script that runs without the original repository checkout.
- Documented hyperparameter recipesLists batch size, learning rate, epochs, and max length for LLaMA-7B and LLaMA-13B.
- Troubleshooting guidanceCovers OOM, missing special tokens, path errors, optional packages, and CUDA confusion.
What you need
- Hugging Face Transformers library
- GPUs for full LLaMA or OPT training
- Multi-GPU setup for the FSDP recipes
- A validated Alpaca-style JSON dataset
- Optional DeepSpeed for ZeRO-3 offload
Try asking
- Show me the FSDP flags for fine-tuning a LLaMA model with Alpaca data
- Build a training command for OPT with DeepSpeed ZeRO-3 offload
- Why is my Alpaca fine-tuning run hitting out of memory?
Good to know
- Full LLaMA and OPT training is expensive and GPU-dependent.
- A CPU check does not prove that multi-GPU FSDP or DeepSpeed jobs will fit or converge.
- GPU recipes are documented launch templates unless verified on suitable hardware.
- The command builder never launches training.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/repositories/repo-skills/stanford-alpaca/sub-skills/fine-tuning/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to fine-tuning
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
fine-tuning: common questions
What models does this fine-tuning skill support?
The source describes it for LLaMA and OPT style causal language models trained with Alpaca data.
Does this skill validate my training dataset?
No. The source says dataset schema and prompt validation belong to the dataset-and-prompts sub-skill, and the training data_path must already point to a validated Alpaca-style JSON dataset.
Will the command builder start training?
No. The source says the command builder prints command text and never launches training.
How do I install fine-tuning?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fine-tuning free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is fine-tuning safe to use?
It scores 49 of 100. Grades: maintenance C, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to fine-tuning?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
