Agent skill

Llamafactory

by Prism-Shadow in Prism-Shadow/penguin-harness

Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Llamafactory

skills CLI
$ npx skills add Prism-Shadow/penguin-harness --skill llamafactory -a claude-code

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

GitHub CLI
$ gh skill install Prism-Shadow/penguin-harness llamafactory --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/Prism-Shadow/penguin-harness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/model-development/skills/llamafactory .claude/skills/llamafactory && 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
llamafactory
GitHub stars
2.5k
Token cost
~855 tokens
SKILL.md length
296 words
Files
1
Skills in repo
31
Repo updated
First seen
Licence
Apache-2.0

At a glance

Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result.

  • Tasks that involve Fine-tuning
  • SKILL.md covers Before you start, Install, Data and Train, plus 3 more sections
  • Calls pip, git and ollama; reaches github.com

What it does

Llamafactory is an agent skill from Prism-Shadow/penguin-harness. Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result.

Its SKILL.md is about 860 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 Fine-tuning. It works with Qwen. The repository describes itself as: 🐧 Unified and Stable RSI Platform. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Fine-tuning

Example prompts

  • “/llamafactory”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit d56d9ce. 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
    • ollama

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    Also links to:

    • huggingface.co

    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

Llamafactory loads about 855 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 296 words of instructions outside code blocks.

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

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 Prism-Shadow/penguin-harness at commit d56d9ce, republished under its Apache-2.0 licence (© Prism-Shadow). 296 words, ~855 tokens.

Download SKILL.mdSave it as .claude/skills/llamafactory/SKILL.md (or your agent's skills folder).
name
llamafactory
description
Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result.

LlamaFactory Fine-Tuning

LlamaFactory fine-tunes open-weight LLMs (LoRA/QLoRA and full-parameter; SFT, DPO and more) through the llamafactory-cli command driven by YAML configs.

Before you start

If the user's message only invokes this skill (e.g. "use llamafactory skill") without a concrete request, ask the user what they want to fine-tune. Do not run any command until the goal is clear.

Confirm before training:

  • GPU memory (nvidia-smi) — it bounds the model size and method; LoRA needs far less than full fine-tuning.
  • The base model: a Hugging Face id or a local path.
  • The dataset: where it lives and which format it is in.
  • The goal: SFT with LoRA is the usual starting point.

Install

bash
git clone --depth 1 https://github.com/hiyouga/LlamaFactory.git
cd LlamaFactory
pip install -e .
pip install -r requirements/metrics.txt   # optional: evaluation metrics

Data

Register every dataset in data/dataset_info.json; the alpaca and sharegpt formats are supported. A minimal local entry:

json
"my_dataset": { "file_name": "my_dataset.json" }

alpaca rows carry instruction / input / output; sharegpt rows carry a conversations list. Put the data file under data/ next to the registry.

Train

Training is driven by a YAML config. Start from the shipped example examples/train_lora/qwen3_lora_sft.yaml, or save a minimal config as my_sft.yaml, e.g. for Qwen/Qwen3-1.7B:

yaml
model_name_or_path: Qwen/Qwen3-1.7B
trust_remote_code: true
stage: sft
do_train: true
finetuning_type: lora
lora_rank: 8
lora_target: all
dataset: my_dataset
template: qwen3
output_dir: saves/qwen3-1.7b/lora/sft
learning_rate: 1.0e-4
num_train_epochs: 3.0
bf16: true
bash
llamafactory-cli train my_sft.yaml

llamafactory-cli webui launches the no-code web UI for the same workflow.

Merge and export

Merge the LoRA adapter into the base weights for standalone serving. Start from examples/merge_lora/qwen3_lora_sft.yaml, pointing model_name_or_path, adapter_name_or_path and template at your run (never merge into a quantized base):

yaml
model_name_or_path: Qwen/Qwen3-1.7B
adapter_name_or_path: saves/qwen3-1.7b/lora/sft
template: qwen3
trust_remote_code: true
export_dir: saves/qwen3-1.7b-sft-merged
bash
llamafactory-cli export my_merge.yaml

Try the result

Both commands take an inference config — derive it from examples/inference/qwen3_lora_sft.yaml, again pointing the model, adapter and template at your run:

yaml
model_name_or_path: Qwen/Qwen3-1.7B
adapter_name_or_path: saves/qwen3-1.7b/lora/sft
template: qwen3
infer_backend: huggingface
trust_remote_code: true
bash
llamafactory-cli chat my_infer.yaml   # interactive chat with the tuned model
llamafactory-cli api my_infer.yaml    # OpenAI-compatible API server

Close the loop

Serve the merged export as a standalone endpoint — vLLM serves the export directory directly, while Ollama needs an import first (a Modelfile with FROM /path/to/export, then ollama create; supported model architectures only) — then register the endpoint with PenguinHarness so agents can build, evaluate and tune AI apps on the fine-tuned model end to end.

© Prism-Shadow, 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 plugins/model-development/skills/llamafactory of Prism-Shadow/penguin-harness.

Open the folder on GitHubat commit d56d9ce

Compare with similar skills

Llamafactory 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.

Llamafactory compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Llamafactory this skillPrism-Shadow/penguin-harness2.5k—~855Automated safety check: PassApache-2.0
Train RlOpenPipe/ART11k—~2.4kAutomated safety check: PassApache-2.0
Train SftOpenPipe/ART11k—~2.9kAutomated safety check: PassApache-2.0
Finetuning Model Onboardingovermind-core/overmind603—~3.2kAutomated safety check: PassAGPL-3.0
slime RL Post-TrainingOrchestra-Research/AI-Research-SKILLs13k4 repos~2.8kAutomated safety check: PassMIT
Qwen21sorryhyun/anima_lora125—~1.9kAutomated safety check: NotesMIT

Similar skills

  • Train Rl

    OpenPipe/ART

    RL training reference for the ART framework. An agent skill from OpenPipe/ART.

    11k GitHub stars~2.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Train Sft

    OpenPipe/ART

    SFT training reference for the ART framework. An agent skill from OpenPipe/ART.

    11k GitHub stars~2.9k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Finetuning Model Onboarding

    overmind-core/overmind

    Rules for adding a new model or model family to the finetuning pipeline, or changing finetuning behavior for an existing one — engine-agnostic customization via family hooks instead of if/else in…

    603 GitHub stars~3.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • slime RL Post-Training

    Orchestra-Research/AI-Research-SKILLs

    Guides reinforcement-learning post-training of LLMs with slime, which pairs Megatron-LM training with SGLang rollouts, including GRPO runs on GLM, Qwen3 and Llama 3 models.

    13k GitHub starsUsed in 4 repos~2.8k tokens
    AI & LLM EngineeringAuto-check passed
  • Qwen21

    sorryhyun/anima_lora

    Qwen-Image-2.1 LoRA line (NOT Anima) — running cache/train through the daemon, make gui-qwen, the CacheRequest/TrainRequest flag surface and how to add a field, model-dir resolution, cache layout…

    125 GitHub stars~1.9k tokensUpdated today
    AI & LLM EngineeringAuto-check: notes
  • Flux Txt2img

    artokun/comfyui-mcp

    Build Flux txt2img workflows with Flux.1 Dev (SRPO), Flux 2 Klein 9B, Turbo LoRAs, FluxGuidance, and DualCLIPLoader patterns

    800 GitHub stars~3k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed

More from Prism-Shadow/penguin-harness

All 31 skills in this repo
  • A2ui

    Prism-Shadow/penguin-harness

    Make a reply easier to read and act on with rich blocks inside ordinary Markdown — a choice the user picks from, a form that collects several answers, a procedure as steps with warnings in place, a…

    2.5k GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed
  • Penguin Harness Dev

    Prism-Shadow/penguin-harness

    A skill your agent uses when developing PenguinHarness itself — changing packages/{core,server,web,cli,desktop,landing,docs,skills}, the built-in model catalog, the installers or the release…

    2.5k GitHub stars~3.4k tokensUpdated 2 days ago
    Auto-check passed
  • Bento Slides

    Prism-Shadow/penguin-harness

    Create and edit Bento presentations — self-contained .bento.html decks whose document is JSON.

    2.5k GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Penguin Harness Manual Test

    Prism-Shadow/penguin-harness

    A skill your agent uses when standing PenguinHarness up to try a change by hand — launching the Web App, the desktop shell, the landing page, the docs site or the component gallery to click through…

    2.5k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Penguin Harness Frontend

    Prism-Shadow/penguin-harness

    A skill your agent uses when changing the PenguinHarness Web App (packages/web) or the shared UI package — adding or restyling any UI, picking a status colour, adding an icon, laying out a row or a…

    2.5k GitHub stars~6.4k tokensUpdated 2 days ago
    Auto-check passed
  • Browser Automation

    Prism-Shadow/penguin-harness

    Drive the PenguinHarness agent browser — the desktop app's built-in browser or the user's own Chrome — from the shell with penguin browser: open pages, read them as simplified HTML or text, act with…

    2.5k GitHub stars~2.9k tokensUpdated 2 days ago
    Auto-check: warnings

Works with

Questions about Llamafactory

What does Llamafactory do?

Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result. Llamafactory is an agent skill from Prism-Shadow/penguin-harness. Fine-tune LLMs with LlamaFactory — register datasets, train via YAML configs, merge LoRA adapters and serve the result.

When should I use Llamafactory?

Llamafactory fits situations like: tasks that involve Fine-tuning.

How do I install Llamafactory in Claude Code?

Run `npx skills add Prism-Shadow/penguin-harness --skill llamafactory -a claude-code`. Or copy the skill folder (plugins/model-development/skills/llamafactory in Prism-Shadow/penguin-harness) into .claude/skills/llamafactory in your project. Claude Code loads it when a task matches its description.

How do I install Llamafactory in Codex?

Run `npx skills add Prism-Shadow/penguin-harness --skill llamafactory -a codex`. Or copy the skill folder (plugins/model-development/skills/llamafactory in Prism-Shadow/penguin-harness) into .agents/skills/llamafactory in your project. Codex loads it when a task matches its description.

Can I use Llamafactory 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 Prism-Shadow/penguin-harness --skill llamafactory -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/llamafactory, .gemini/skills/llamafactory, .github/skills/llamafactory and .opencode/skills/llamafactory in your project.

What does Llamafactory need to run?

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

Does Llamafactory access the network?

SKILL.md names 2 domains. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. As links in the text: huggingface.co. This is read from the text; nothing was executed.

Is Llamafactory 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 Llamafactory use?

Llamafactory 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 Llamafactory use?

About 855 tokens (SKILL.md is roughly 3.4k 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 Llamafactory?

Skills that share tags, products or a category with Llamafactory: Train Rl (OpenPipe/ART, 11k stars), Train Sft (OpenPipe/ART, 11k stars), Finetuning Model Onboarding (overmind-core/overmind, 603 stars) and slime RL Post-Training (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Llamafactory?

Prism-Shadow (a GitHub organization) maintains it in Prism-Shadow/penguin-harness, which has 2,464 GitHub stars. The repository holds 31 skills in this directory. The repository was last updated on October 7, 2026.

Source: Prism-Shadow/penguin-harness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.