Hugging Face LLM Trainer
huggingface/skills
Trains or fine-tunes language and vision models with TRL or Unsloth on Hugging Face Jobs cloud GPUs, then converts the results to GGUF.
Trigger this skill when the user wants to train, fine-tune, or adapt Gemma models (e.g.
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install google-gemma/gemma-skills gemma-trainer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/gemma-trainer .claude/skills/gemma-trainer && rm -rf skills-srcUse ~/.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/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .claude/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install google-gemma/gemma-skills gemma-trainer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/gemma-trainer .agents/skills/gemma-trainer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .agents/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install google-gemma/gemma-skills gemma-trainer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/gemma-trainer .cursor/skills/gemma-trainer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .cursor/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/google-gemma/gemma-skills.git --path skills/gemma-trainer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install google-gemma/gemma-skills gemma-trainer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/gemma-trainer .gemini/skills/gemma-trainer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .gemini/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install google-gemma/gemma-skills gemma-trainerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/gemma-trainer .github/skills/gemma-trainer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .github/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google-gemma/gemma-skills --skill gemma-trainer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install google-gemma/gemma-skills gemma-trainer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-gemma/gemma-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/gemma-trainer .opencode/skills/gemma-trainer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "gemma-trainer" agent skill from https://github.com/google-gemma/gemma-skills/tree/main/skills/gemma-trainer into .opencode/skills/gemma-trainer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "gemma-trainer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
gemma-trainerTrigger this skill when the user wants to train, fine-tune, or adapt Gemma models (e.g.
Gemma Trainer is an agent skill from google-gemma/gemma-skills. Trigger this skill when the user wants to train, fine-tune, or adapt Gemma models (e.g. SFT, DPO, RLHF, Reward Modeling) on local hardware. Covers TRL, Unsloth, dataset preparation, validation, and GGUF/LiteRT conversion.
Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including assets (for example `assets/dataset_prep.py`, `assets/distill_dataset.py` and `assets/dpo_train.py`).
It sits in AI & LLM Engineering, covering Fine-tuning. It works with llama.cpp. The repository describes itself as: Skills for the Gemma and model/agent interactions. The licence is Apache-2.0.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit f86bcc6. It shows what the files ask for, not the result of running them.
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.
Ships script files (Python), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
unsloth.aigithub.comdevelopers.google.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Gemma Trainer loads about 1.9k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 894 words of instructions outside code blocks.
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.
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.
The full file from google-gemma/gemma-skills at commit f86bcc6, republished under its Apache-2.0 licence (© google-gemma). 894 words, ~1,929 tokens.
.claude/skills/gemma-trainer/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.When training locally, memory efficiency and execution speed are huge. Always guide the user to follow these best practices:
SFTTrainer, DPOTrainer) coupled with PEFT and bitsandbytes (for QLoRA).Help the user choose the correct workflow based on their goal:
Formatting issues are the #1 cause of poor training runs. Ensure you validate files using the utility script [assets/dataset_prep.py].
Ensure the dataset matches Gemma's official chat template:
<|turn>system
Your instruction here<turn|>
<|turn>user
Your query here<turn|>
<|turn>model
Your response here<turn|>To avoid formatting drift, use the tokenizer's apply_chat_template during dataset tokenization.
{
"messages": [
{"role": "user", "content": "Tell me a joke."},
{"role": "model", "content": "Why did the computer go to the doctor? It had a virus!"}
]
}{
"prompt": "Write a python function to compute factorial.",
"chosen": "def factorial(n):\n return 1 if n <= 1 else n * factorial(n - 1)",
"rejected": "factorial is computed using recursion or loops. Just import math."
}RewardTrainer evaluates the pair and learns to output a higher logit score for chosen than for rejected.Local knowledge distillation allows you to train small, lightweight student models (such as Gemma 4 E2B) using high-quality dataset outputs generated by larger, highly capable teacher models (such as Gemma 4 31B or Gemma 4 26B A4B).
Use the [assets/distill_dataset.py] utility script to generate fine-tuning datasets on your local machine.
Use the [assets/sft_train.py] asset to launch a local QLoRA fine-tuning session.
r): 16 or 32 (Higher rank captures complex behaviors but consumes more memory).lora_alpha): 32 or 64 (Rule of thumb: lora_alpha = 2 * r).lora_dropout): 0.05 or 0.1 (Forcing the model to learn more robust features rather than relying on specific paths).2e-4 for QLoRA; 2e-5 for full fine-tuning.Use the [assets/dpo_train.py] template to execute alignment.
beta (DPO temperature parameter) to 0.1. Values between 0.1 and 0.5 control how strictly the model adheres to the reference policy.Use the [assets/reward_train.py] template to train an evaluation model.
AutoModelForSequenceClassification with num_labels=1).Gemma 4 models are natively multimodal. To fine-tune them on images or audio:
SFTTrainer with a custom visual data collator.{
"messages": [
{"role": "user", "content": [
{"type": "image", "url": "path/to/image.png"},
{"type": "text", "text": "Describe this image."}
]},
{"role": "assistant", "content": [
{"type": "text", "text": "An abstract oil painting with vibrant warm gradients."}
]}
]
}
input_features.image type with audio type in the message format.{
"messages": [
{"role": "user", "content": [
{"type": "text", "text": "Describe this audio."},
{"type": "audio", "url": "path/to/audio.wav"}
]},
{"role": "assistant", "content": [
{"type": "text", "text": "This is an audio file of a bird chirping."}
]}
]
}Once your LoRA training is finished, you can convert your model to GGUF format.
If you trained your model using Unsloth, you can export directly to GGUF natively. This automatically handles merging and quantization.
Fetch Saving to GGUF for the best practice.
If you did not use Unsloth, you can convert your merged Hugging Face model directory manually using llama.cpp.
LiteRT-LM is optimized for running models like Gemma 4 E2B and Gemma 4 E4B on mobile, web, and IoT hardware with hardware acceleration (CPU, GPU, NPU). Fetch LiteRT-LM guide for the best practice.
© google-gemma, 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
SKILL.md and 5 other files (assets) in skills/gemma-trainer of google-gemma/gemma-skills.
Open the folder on GitHubat commit f86bcc6
Gemma Trainer 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Gemma Trainer this skillgoogle-gemma/gemma-skills | 1k | — | ~1.9k | Automated safety check: Pass | Apache-2.0 | |
| Hugging Face LLM Trainerhuggingface/skills | 11k | 3 repos | ~7.2k | Automated safety check: Pass | Apache-2.0 | |
| Unsloth Finetuningsickn33/agentic-awesome-skills | 47k | 1 repos | ~4.1k | Automated safety check: Pass | Apache-2.0 | |
| Quantized Exportwshobson/agents | 40k | — | ~2k | Automated safety check: Pass | MIT | |
| Wan Flf Videoartokun/comfyui-mcp | 795 | — | ~5.1k | Automated safety check: Pass | MIT | |
| ML Research LabAnastasiyaW/codex-claude-code-config | 154 | — | ~794 | Automated safety check: Pass | MIT |
huggingface/skills
Trains or fine-tunes language and vision models with TRL or Unsloth on Hugging Face Jobs cloud GPUs, then converts the results to GGUF.
sickn33/agentic-awesome-skills
Fine-tune and post-train LLMs with Unsloth Core on a single consumer GPU: VRAM sizing, LoRA/QLoRA, GRPO/DPO, chat-template correctness, and GGUF export.
wshobson/agents
Export a promoted fine-tuned model in the right deployment format — merged safetensors, LoRA-only, GGUF with imatrix, or FP8.
artokun/comfyui-mcp
Build WAN 2.2 First-Last-Frame video workflows. An agent skill from artokun/comfyui-mcp.
AnastasiyaW/codex-claude-code-config
Machine-learning research loop for dataset curation, fine-tuning, evaluation, inference deployment, experiment tracking, and model explainability.
ericrisco/rsc-harness
A skill your agent uses when adapting an open-weight model to a target form or behavior — tone, output format, reasoning pattern — via LoRA/QLoRA or full fine-tuning with TRL SFTTrainer, then…
google-gemma/gemma-skills
Trigger this skill when building applications with Gemma or for general knowledge inquiries related to Gemma models (e.g.
Works with
Categories
Trigger this skill when the user wants to train, fine-tune, or adapt Gemma models (e.g. Gemma Trainer is an agent skill from google-gemma/gemma-skills.g.
Gemma Trainer fits situations like: this skill when the user wants to train; adapt Gemma models (e.g.
Run `npx skills add google-gemma/gemma-skills --skill gemma-trainer -a claude-code`. Or copy the skill folder (skills/gemma-trainer in google-gemma/gemma-skills) into .claude/skills/gemma-trainer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add google-gemma/gemma-skills --skill gemma-trainer -a codex`. Or copy the skill folder (skills/gemma-trainer in google-gemma/gemma-skills) into .agents/skills/gemma-trainer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google-gemma/gemma-skills --skill gemma-trainer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gemma-trainer, .gemini/skills/gemma-trainer, .github/skills/gemma-trainer and .opencode/skills/gemma-trainer in your project.
Going by SKILL.md and its folder, Gemma Trainer needs Python for the scripts in its folder. Our summary lists: Python 3.
SKILL.md names 3 domains. As links in the text: unsloth.ai, github.com and developers.google.com. This is read from the text; nothing was executed.
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.
Gemma Trainer 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.
About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Gemma Trainer: Hugging Face LLM Trainer (huggingface/skills, 11k stars), Unsloth Finetuning (sickn33/agentic-awesome-skills, 47k stars), Quantized Export (wshobson/agents, 40k stars) and Wan Flf Video (artokun/comfyui-mcp, 795 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
google-gemma (a GitHub organization) maintains it in google-gemma/gemma-skills, which has 1,004 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 6, 2026.
Source: google-gemma/gemma-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.