llamafactory

llamafactory is a skill for Claude Code, Codex from Prism-Shadow/penguin-harness. It costs 33 tokens per session (957 once invoked), scanned B, original, Apache-2.0.

A tool-based workflow for fine-tuning open-weight large language models, which are AI models whose weights can be downloaded and changed.

In plain words
What is it for?
Use it to register Alpaca or ShareGPT training data, run supervised or preference training with YAML files, combine LoRA adapters (small model updates) with a base model, and serve the result.
Why use it?
It organizes dataset setup, training settings, model adaptation, and serving so the fine-tuning process does not depend on scattered manual commands.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to register Alpaca or ShareGPT training data, run supervised or preference training with YAML files, combine LoRA adapters (small model updates) with a base model, and serve the result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/prism-shadow/penguin-harness/llamafactory
About the project

PenguinHarness is a local-first platform in which multiple AI agents create, evaluate, optimize, and deploy agent applications. It is for people building AI software who want agents to generate applications and improve their own behavior through skills.

Prism-Shadow/penguin-harness · 2,025 stars · on GitHub · penguin.ooo

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Prism-Shadow/penguin-harness --skill llamafactory
Clone the repo
git clone --depth 1 https://github.com/Prism-Shadow/penguin-harness

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llamafactory

README.md
[![agentmods](https://agentmods.dev/badge/skills/prism-shadow/penguin-harness/llamafactory/github.svg)](https://agentmods.dev/skills/prism-shadow/penguin-harness/llamafactory)
Your own site
<a href="https://agentmods.dev/skills/prism-shadow/penguin-harness/llamafactory"><img src="https://agentmods.dev/badge/skills/prism-shadow/penguin-harness/llamafactory/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llamafactory

Your own site · 80×15
<a href="https://agentmods.dev/skills/prism-shadow/penguin-harness/llamafactory"><img src="https://agentmods.dev/badge/skills/prism-shadow/penguin-harness/llamafactory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 957 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 12
    Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.
    Fix: Restrict tool access to only the tools required for the skill's stated purpose. Use an explicit allowlist rather than granting blanket access.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00957
Opus 5 $0.00016 $0.00478
Sonnet 5 $0.00007 $0.00191
Haiku 4.5 $0.00003 $0.00096

Measured 4d ago against content hash ea65550adb9e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

llamafactory scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

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.
plugins/model-development/skills/llamafactory/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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:

"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:

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
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):

Read the full file on GitHub · 102 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · -4 lines ea65550adb9e
  2. 9d ago First seen · 106 lines · 33 tokens per session scan B aee426298401

Subscribe to this mod's changes

llamafactory is a skill published in the GitHub repository Prism-Shadow/penguin-harness (2,025 stars, last pushed yesterday), licensed Apache-2.0. It adds 33 tokens to every session and 957 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

deepseek-harness

Use when building AI agent applications with a plugin-based architecture — Web UI, CLI, Python SDK, Cordis plugin system, multi-model orchestration. DeepSeek Harness (dsh): open-source agent harness by DeepSeek AI where everything is a plugin, powered by Cordis for spatiotemporal composability.

znlgis/opengis-skills · 68 tokens

deepseek-harness

Use this skill whenever the user wants to call DeepSeek V4-Pro / V4-Flash (or its legacy aliases deepseek-chat / deepseek-reasoner), or you see code that imports from openai import OpenAI with baseurl="https://api.deepseek.com". This skill teaches you the 10 protocol contract rules required to avoid the 16 documented…

HenryZ838978/deepseek-harness · 144 tokens

LLM

Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk. Use this skill when the user needs to build conversational AI applications, chatbots, AI assistants, or any text generation features. Supports multi-turn conversations, system prompts, and context management.

jjyaoao/HelloAgents · 59 tokens

ASR

Implement speech-to-text (ASR/automatic speech recognition) capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to transcribe audio files, convert speech to text, build voice input features, or process audio recordings. Supports base64 encoded audio files and returns accurate text…

jjyaoao/HelloAgents · 65 tokens

VLM

Implement vision-based AI chat capabilities using the z-ai-web-dev-sdk. Use this skill when the user needs to analyze images, describe visual content, or create applications that combine image understanding with conversational AI. Supports image URLs and base64 encoded images for multimodal interactions.

jjyaoao/HelloAgents · 56 tokens

Weights & Biases

Track ML experiments with automatic logging, visualize training in real-time, optimize hyperparameters with sweeps, and manage model registry with W&B - collaborative MLOps platform.

agentic-in/elephant-agent · 38 tokens