{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "huggingface-trl--fine-tune-a-small-model-with-the-trl-cli",
 "repo": "huggingface/trl",
 "repo_url": "https://github.com/huggingface/trl",
 "repo_slug": "huggingface-trl",
 "title": "Fine-tune a small model from the command line",
 "page_title": "How to fine-tune a small model from the command line with TRL",
 "summary": "Run supervised fine-tuning on Qwen2.5-0.5B with a public dataset using only the TRL CLI.",
 "who": "A developer who wants a first fine-tune without writing a training script.",
 "problem": "Training scripts have a lot of boilerplate for a first experiment.",
 "outcome": "A fine-tuned checkpoint saved to an output folder.",
 "steps": [
  "Install TRL with `pip install trl`",
  "Run `trl sft --model_name_or_path Qwen/Qwen2.5-0.5B` with `--dataset_name trl-lib/Capybara` and `--output_dir Qwen2.5-0.5B-SFT`",
  "Wait for training to finish and check the output folder",
  "Run TRL sft with --help to see more options"
 ],
 "agent_prompt": "Using huggingface/trl, install it with `pip install trl`, run `trl sft --model_name_or_path Qwen/Qwen2.5-0.5B` with `--dataset_name trl-lib/Capybara` and `--output_dir Qwen2.5-0.5B-SFT`, and tell me how to load the result for a quick chat test.",
 "agents": [
  "claude-code",
  "codex",
  "cursor",
  "gemini-cli"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "Run time depends heavily on your GPU.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python with pip",
  "A GPU is strongly recommended; the README covers NVIDIA, AMD and AWS Trainium setups",
  "Access to Hugging Face Hub models and datasets"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "cost",
   "notice": "Training uses a lot of GPU time; on cloud GPUs that is billed by the hour."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/huggingface-trl/fine-tune-a-small-model-with-the-trl-cli/",
 "md": "https://dedupedai.com/use-cases/huggingface-trl/fine-tune-a-small-model-with-the-trl-cli/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/huggingface-trl--fine-tune-a-small-model-with-the-trl-cli.json",
 "api_version": "v1"
}
