# We Got Claude to Fine-Tune an Open Source LLM

[Hugging Face](https://yomu.fyi/company/hugging-face) · ben burtenshaw, shaun smith · Dec 4, 2025

**Type:** Tutorial

## Summary

Hugging Face Skills equips coding agents like Claude Code, OpenAI Codex, and Google's Gemini CLI to manage end-to-end language model fine-tuning. Using the hf-llm-trainer skill, an agent validates dataset formats, selects cloud hardware, configures authentication, and submits jobs to Hugging Face Jobs. Supported techniques include Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and Group Relative Policy Optimization (GRPO) for models ranging across various parameter sizes. The integration incorporates Trackio for real-time monitoring and automates LoRA configuration for larger models. Once training completes, the agent pushes artifacts to the Hugging Face Hub and can convert models to GGUF format for local execution.

## Context

Training and fine-tuning language models typically requires specialized manual decisions regarding hardware selection, authentication, training script creation, job monitoring, and hyperparameter choices.

## Approach / What changed

Package training instructions, domain knowledge, and scripts into the hf-llm-trainer Hugging Face Skill, allowing coding agents like Claude Code to execute data validation, cloud GPU job submission, Trackio monitoring, and Hub deployments via conversational prompts.

## Takeaways

- The hf-llm-trainer skill supports Supervised Fine-Tuning, Direct Preference Optimization, and Group Relative Policy Optimization for models including text and vision language models.
- For models exceeding 3B parameters up to 7B, the skill automatically applies LoRA on instances like a10g-large or a100-large to fit GPU memory limits.
- Trained models can be automatically converted to GGUF format with quantization such as Q4\_K\_M for local inference using tools like llama.cpp and Ollama.

**Tags:** [Deployment](https://yomu.fyi/topic/deployment), [Developer Experience](https://yomu.fyi/topic/developer-experience), [LLMs](https://yomu.fyi/topic/llm), [Machine Learning](https://yomu.fyi/topic/machine-learning), [Open Source](https://yomu.fyi/topic/open-source)

[Read original post](https://huggingface.co/blog/hf-skills-training)
