AI Engineering Hub is a learning and project repository covering large language models, retrieval-augmented generation, AI agents, and related applications. Beginners, practitioners, and researchers use its tutorials and projects to learn AI engineering and build working systems. The catalogue entries are examples of the skills, plugins, and agent resources included with it.
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.
npx skills add patchy631/ai-engineering-hub --skill hugging-face-model-trainergit clone --depth 1 https://github.com/patchy631/ai-engineering-hubWrote 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.
[](https://agentmods.dev/skills/patchy631/ai-engineering-hub/hugging-face-model-trainer)<a href="https://agentmods.dev/skills/patchy631/ai-engineering-hub/hugging-face-model-trainer"><img src="https://agentmods.dev/badge/skills/patchy631/ai-engineering-hub/hugging-face-model-trainer.svg" alt="Measured on agentmods" height="20"></a>- Snyk fail
- NVIDIA SkillSpector warn
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 Output Handling · line 141 Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00131 | $0.06873 |
| Opus 5 | $0.00066 | $0.03436 |
| Sonnet 5 | $0.00026 | $0.01375 |
| Haiku 4.5 | $0.00013 | $0.00687 |
Grade A, and why
hugging-face-model-trainer scanned grade A with 0 findings 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 8d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
Copies of this mod
8 near-identical copies found in the catalogue:
- model-trainer — 98% identical, 1,412 lines differ
- model-trainer — 98% identical, 1,412 lines differ
- hugging-face-model-trainer — 98% identical, 1,424 lines differ
- hugging-face-model-trainer — 98% identical, 1,424 lines differ
- hugging-face-model-trainer — 95% identical, 1,429 lines differ
- huggingface-llm-trainer — 92% identical, 1,422 lines differ
- huggingface-llm-trainer — 91% identical, 1,444 lines differ
- huggingface-llm-trainer — 91% identical, 1,444 lines differ
How it starts
The opening of the file, as written. The whole thing — 707 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TRL Training on Hugging Face Jobs
Overview
Train language models using TRL (Transformer Reinforcement Learning) on fully managed Hugging Face infrastructure. No local GPU setup required—models train on cloud GPUs and results are automatically saved to the Hugging Face Hub.
TRL provides multiple training methods:
- SFT (Supervised Fine-Tuning) - Standard instruction tuning
- DPO (Direct Preference Optimization) - Alignment from preference data
- GRPO (Group Relative Policy Optimization) - Online RL training
- Reward Modeling - Train reward models for RLHF
For detailed TRL method documentation:
hf_doc_search("your query", product="trl")
hf_doc_fetch("https://huggingface.co/docs/trl/sft_trainer") # SFT
hf_doc_fetch("https://huggingface.co/docs/trl/dpo_trainer") # DPO
# etc.
See also: references/training_methods.md for method overviews and selection guidance
When to Use This Skill
Use this skill when users want to:
- Fine-tune language models on cloud GPUs without local infrastructure
- Train with TRL methods (SFT, DPO, GRPO, etc.)
- Run training jobs on Hugging Face Jobs infrastructure
- Convert trained models to GGUF for local deployment (Ollama, LM Studio, llama.cpp)
- Ensure trained models are permanently saved to the Hub
- Use modern workflows with optimized defaults
Key Directives
When assisting with training jobs:
-
ALWAYS use
hf_jobs()MCP tool - Submit jobs usinghf_jobs("uv", {...}), NOT bashtrl-jobscommands. Thescriptparameter accepts Python code directly. Do NOT save to local files unless the user explicitly requests it. Pass the script content as a string tohf_jobs(). If user asks to "train a model", "fine-tune", or similar requests, you MUST create the training script AND submit the job immediately usinghf_jobs(). -
Always include Trackio - Every training script should include Trackio for real-time monitoring. Use example scripts in
scripts/as templates.
What ships with it
14 files 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.
- references/gguf_conversion.md 9.9 KB
- references/hardware_guide.md 6.9 KB
- references/hub_saving.md 8.7 KB
- references/reliability_principles.md 11 KB
- references/trackio_guide.md 5.8 KB
- references/training_methods.md 5.0 KB
- references/training_patterns.md 6.2 KB
- references/troubleshooting.md 8.9 KB
- scripts/convert_to_gguf.py 10.0 KB runs code
- scripts/dataset_inspector.py 16 KB runs code
- scripts/estimate_cost.py 4.9 KB runs code
- scripts/train_dpo_example.py 3.1 KB runs code
- scripts/train_grpo_example.py 2.4 KB runs code
- scripts/train_sft_example.py 3.4 KB runs code
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.
- 8d ago First seen · 707 lines · 131 tokens per session scan A 27f0fc8238d3
hugging-face-model-trainer is a skill published in the GitHub repository patchy631/ai-engineering-hub (37,397 stars, last pushed 12d ago), licensed MIT. It adds 131 tokens to every session and 6,873 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
mcp-builder
DEPRECATED: This skill has been replaced by mcp-app-builder. Check if mcp-app-builder is available in the skills folder. If not, install it: npx skills install mcp-use/mcp-use --skill mcp-app-builder Use mcp-app-builder instead of this skill. Build Model Context Protocol (MCP) servers with mcp-use framework. Use when…
thinking-out-loud
A contract for what the agent does when a long, messy, stream-of-consciousness ramble arrives (usually voice dictation): act on nothing until the echo brief is approved. The echo audits the entire transfer, mission, locked decisions and constraints, open questions, flips and parked tangents, with the model's…
dstack-prototyping
Use with the dstack skill for model-serving work when the image, serving command, resources, backend/fleet choice, or service behavior is not proven. Guides task-first prototyping on real hardware, choosing fleets/backends that can reuse idle instances and caches, checking vLLM/SGLang sources, and verifying the final…
advisor-orchestrator-worker
Use when a task is too large for one model pass, needs parallel research or generation across many subtasks (like researching a dozen competitors at once), or the user asks to orchestrate multiple models, split work across a model team, run an advisor-worker loop, have a stronger model review the plan while cheap…
dstack-presets
Create and manage dstack presets: a toolkit that streamlines model inference optimization with agents, and a portable preset format. Use together with the dstack skill, and only when the user explicitly asks to create a preset or manage existing presets, not for deploying or serving a model.
langchain-dev-guide
LangChain / LangGraph engineering pitfalls and verified fixes. Covers DeepAgents, structured output, OpenAI-compatible model integration (including Chinese provider adapters: DeepSeek, Qwen, GLM, etc.), middleware, streaming, multi-agent orchestration, and other common development issues. Use when hitting unexpected…