{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-02-20-train-ai-models-with-unsloth-and-hugging-face-jobs-for-free/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "This blog post covers how to use [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face Jobs for fast LLM fine-tuning (specifically [`LiquidAI/LFM2.5-1.2B-Instruct`](https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct) ) through coding agents like Claude Code and Codex. Unsloth provides ~2x faster training and ~60% less VRAM usage compared to standard methods, so training small models can cost just a few dollars.\n\nWhy a small model? Small language models like LFM2.5-1.2B-Instruct are ideal candidates for fine-tuning. They are cheap to train, fast to iterate on, and increasingly competitive with much larger models on focused tasks. LFM2.5-1.2B-Instruct runs under 1GB of memory and is optimized for on-device deployment, so what you fine-tune can be served on CPUs, phones, and laptops.\n\n[![Watch the video](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/unsloth-jobs/screenshot.png)](http://www.youtube.com/watch?feature=player_embedded&v=Gh5P4niIFNA)\n\n## You will need\n\nWe are giving away free credits to fine-tune models on Hugging Face Jobs. Join the [Unsloth Jobs Explorers](https://huggingface.co/unsloth-jobs) organization to claim your free credits and one-month Pro subscription.\n\n- A [Hugging Face](https://huggingface.co) account (required for HF Jobs)\n- Billing setup (for verification, you can monitor your usage and manage your billing in your [billing page](https://huggingface.co/settings/billing)).\n- A Hugging Face token with write permissions\n- (optional) A coding agent (`Open Code`, `Claude Code`, or `Codex`)\n\n## Run the Job\n\nIf you want to train a model using HF Jobs and Unsloth, you can simply use the `hf jobs` CLI to submit a job.\n\nFirst, you need to install the `hf` CLI. You can do this by running the following command:\n\n```\n# mac or linux\ncurl -LsSf https://hf.co/cli/install.sh | bash\n```\n\nNext you can run the following command to submit a job:\n\n```sh\nhf jobs uv run https://huggingface.co/datasets/unsloth/jobs/resolve/main/sft-lfm2.5.py \\\n    --flavor a10g-small  \\\n    --secrets HF_TOKEN  \\\n    --timeout 4h \\\n    --dataset mlabonne/FineTome-100k \\\n    --num-epochs 1 \\\n    --eval-split 0.2 \\\n    --output-repo your-username/lfm-finetuned\n```\n\nCheck out the [training script](https://huggingface.co/datasets/unsloth/jobs/blob/main/sft-lfm2.5.py) and [Hugging Face Jobs documentation](https://huggingface.co/docs/hub/jobs) for more details.\n\n## Installing the Skill\n\nHugging Face model training skill lowers barrier of entry to train a model by simply prompting. First, install the skill with your coding agent.\n\n### Claude Code\n\nClaude Code discovers skills through its [plugin system](https://code.claude.com/docs/en/discover-plugins), so we need to install the Hugging Face skills first. To do so:\n\n1. Add the marketplace:\n\n```text\n/plugin marketplace add huggingface/skills\n```\n\n2. Browse available skills in the `Discover` tab:\n\n```text\n/plugin\n```\n\n3. Install the model trainer skill:\n\n```text\n/plugin install hugging-face-model-trainer@huggingface-skills\n```\n\nFor more details, see the [documentation](https://huggingface.co/docs/hub/en/agents-skills) on using the hub with skills or the Claude Code [Skills docs](https://code.claude.com/docs/en/skills).\n\n### Codex\n\nCodex discovers skills through [`AGENTS.md`](https://developers.openai.com/codex/guides/agents-md) files and [`.agents/skills/`](https://developers.openai.com/codex/skills) directories.\n\nInstall individual skills with `$skill-installer`:\n\n```text\n$skill-installer install https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer\n```\n\nFor more details, see the [Codex Skills docs](https://developers.openai.com/codex/skills) and the [AGENTS.md guide](https://developers.openai.com/codex/guides/agents-md).\n\n### Anything else\n\nA generic install method is simply to clone the [skills repository](https://github.com/huggingface/skills) and copy the [skill](https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer) to your agent's skills directory.\n\n```text\ngit clone https://github.com/huggingface/skills.git\nmkdir -p ~/.agents/skills && cp -R skills/skills/hugging-face-model-trainer ~/.agents/skills/\n```\n\n## Quick Start\n\nOnce the skill is installed, ask your coding agent to train a model:\n\n```text\nTrain LiquidAI/LFM2.5-1.2B-Instruct on mlabonne/FineTome-100k using Unsloth on HF Jobs\n```\n\nThe agent will generate a training script based on an [example in the skill](https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py), submit the training to HF Jobs, and provide a monitoring link via Trackio.\n\n## How It Works\n\nTraining jobs run on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs), fully managed cloud GPUs. The agent:\n\n1. Generates a UV script with inline dependencies\n2. Submits it to HF Jobs via the `hf` CLI\n3. Reports the job ID and monitoring URL\n4. Pushes the trained model to your Hugging Face Hub repository\n\n### Example Training Script\n\nThe skill generates scripts like this based on the example in the [skill](https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py).\n\n```python\n# /// script\n# dependencies = [\"unsloth\", \"trl>=0.12.0\", \"datasets\", \"trackio\"]\n# ///\n\nfrom unsloth import FastLanguageModel\nfrom trl import SFTTrainer, SFTConfig\nfrom datasets import load_dataset\n\nmodel, tokenizer = FastLanguageModel.from_pretrained(\n    \"LiquidAI/LFM2.5-1.2B-Instruct\",\n    load_in_4bit=True,\n    max_seq_length=2048,\n)\n\nmodel = FastLanguageModel.get_peft_model(\n    model,\n    r=16,\n    lora_alpha=32,\n    lora_dropout=0,\n    target_modules=[\n        \"q_proj\",\n        \"k_proj\",\n        \"v_proj\",\n        \"out_proj\",\n        \"in_proj\",\n        \"w1\",\n        \"w2\",\n        \"w3\",\n    ],\n)\n\ndataset = load_dataset(\"trl-lib/Capybara\", split=\"train\")\n\ntrainer = SFTTrainer(\n    model=model,\n    tokenizer=tokenizer,\n    train_dataset=dataset,\n    args=SFTConfig(\n        output_dir=\"./output\",\n        push_to_hub=True,\n        hub_model_id=\"username/my-model\",\n        per_device_train_batch_size=4,\n        gradient_accumulation_steps=4,\n        num_train_epochs=1,\n        learning_rate=2e-4,\n        report_to=\"trackio\",\n    ),\n)\n\ntrainer.train()\ntrainer.push_to_hub()\n```\n\n| Model Size   | Recommended GPU | Approx Cost/hr |\n| ------------ | --------------- | -------------- |\n| <1B params   | `t4-small`      | \\~$0.40        |\n| 1-3B params  | `t4-medium`     | \\~$0.60        |\n| 3-7B params  | `a10g-small`    | \\~$1.00        |\n| 7-13B params | `a10g-large`    | \\~$3.00        |\n\nFor a full overview of Hugging Face Spaces pricing, check out the guide [here](https://huggingface.co/docs/hub/en/spaces-overview#hardware-resources).\n\n## Tips for Working with Coding Agents\n\n- Be specific about the model and dataset to use, and include Hub IDs (for example, `Qwen/Qwen2.5-0.5B` and `trl-lib/Capybara`). Agents will search for and validate those combinations.\n- Mention Unsloth explicitly if you want it used. Otherwise, the agent will choose a framework based on the model and budget.\n- Ask for cost estimates before launching large jobs.\n- Request Trackio monitoring for real-time loss curves.\n- Check job status by asking the agent to inspect logs after submission.\n\n## Resources\n\n- [Hugging Face Skills Repository](https://github.com/huggingface/skills)\n- [Free credits for Unsloth Jobs Explorers](https://huggingface.co/unsloth-jobs)\n- [Unsloth Tutorial on Hugging Face Jobs](https://unsloth.ai/docs/basics/inference-and-deployment/deploying-with-hugging-face-jobs)\n- [Example Unsloth Jobs scripts](https://huggingface.co/datasets/unsloth/jobs)\n",
  "authors": [],
  "captured_at": "2026-10-04T12:50:30.804479567+00:00",
  "category": "ai",
  "content_html": "<p>This blog post covers how to use <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/unslothai/unsloth\">Unsloth</a> and Hugging Face Jobs for fast LLM fine-tuning (specifically <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct\"><code>LiquidAI/LFM2.5-1.2B-Instruct</code></a> ) through coding agents like Claude Code and Codex. Unsloth provides ~2x faster training and ~60% less VRAM usage compared to standard methods, so training small models can cost just a few dollars.</p>\n<p>Why a small model? Small language models like LFM2.5-1.2B-Instruct are ideal candidates for fine-tuning. They are cheap to train, fast to iterate on, and increasingly competitive with much larger models on focused tasks. LFM2.5-1.2B-Instruct runs under 1GB of memory and is optimized for on-device deployment, so what you fine-tune can be served on CPUs, phones, and laptops.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"http://www.youtube.com/watch?feature=player_embedded&amp;v=Gh5P4niIFNA\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/unsloth-jobs/screenshot.png\" alt=\"Watch the video\" loading=\"eager\" decoding=\"async\" fetchpriority=\"high\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<h2>You will need</h2>\n<p>We are giving away free credits to fine-tune models on Hugging Face Jobs. Join the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/unsloth-jobs\">Unsloth Jobs Explorers</a> organization to claim your free credits and one-month Pro subscription.</p>\n<ul>\n<li>A <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co\">Hugging Face</a> account (required for HF Jobs)</li>\n<li>Billing setup (for verification, you can monitor your usage and manage your billing in your <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/settings/billing\">billing page</a>).</li>\n<li>A Hugging Face token with write permissions</li>\n<li>(optional) A coding agent (<code>Open Code</code>, <code>Claude Code</code>, or <code>Codex</code>)</li>\n</ul>\n<h2>Run the Job</h2>\n<p>If you want to train a model using HF Jobs and Unsloth, you can simply use the <code>hf jobs</code> CLI to submit a job.</p>\n<p>First, you need to install the <code>hf</code> CLI. You can do this by running the following command:</p>\n<pre><code><span class=\"code-snippet\"># mac or linux\ncurl -LsSf https://hf.co/cli/install.sh | bash\n</span></code></pre>\n<p>Next you can run the following command to submit a job:</p>\n<pre><code class=\"language-sh\"><span class=\"code-snippet\" data-language=\"Shell\"><span class=\"syntax-source syntax-shell syntax-bash\"><span class=\"syntax-meta syntax-function-call syntax-shell\"><span class=\"syntax-variable syntax-function syntax-shell\">hf</span></span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-shell\"> jobs uv run https://huggingface.co/datasets/unsloth/jobs/resolve/main/sft-lfm2.5.py <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>flavor</span> a10g-small  <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>secrets</span> HF_TOKEN  <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>timeout</span> 4h <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>dataset</span> mlabonne/FineTome-100k <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>num-epochs</span> 1 <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>eval-split</span> 0.2 <span class=\"syntax-punctuation syntax-separator syntax-continuation syntax-line syntax-shell\">\\\n</span><span class=\"syntax-variable syntax-parameter syntax-option syntax-shell\"><span class=\"syntax-punctuation syntax-definition syntax-parameter syntax-shell\">    --</span>output-repo</span> your-username/lfm-finetuned</span>\n</span></span></code></pre>\n<p>Check out the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/unsloth/jobs/blob/main/sft-lfm2.5.py\">training script</a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/hub/jobs\">Hugging Face Jobs documentation</a> for more details.</p>\n<h2>Installing the Skill</h2>\n<p>Hugging Face model training skill lowers barrier of entry to train a model by simply prompting. First, install the skill with your coding agent.</p>\n<h3>Claude Code</h3>\n<p>Claude Code discovers skills through its <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://code.claude.com/docs/en/discover-plugins\">plugin system</a>, so we need to install the Hugging Face skills first. To do so:</p>\n<ol>\n<li>Add the marketplace:</li>\n</ol>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">/plugin marketplace add huggingface/skills\n</span></code></pre>\n<ol start=\"2\">\n<li>Browse available skills in the <code>Discover</code> tab:</li>\n</ol>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">/plugin\n</span></code></pre>\n<ol start=\"3\">\n<li>Install the model trainer skill:</li>\n</ol>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">/plugin install hugging-face-model-trainer@huggingface-skills\n</span></code></pre>\n<p>For more details, see the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/hub/en/agents-skills\">documentation</a> on using the hub with skills or the Claude Code <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://code.claude.com/docs/en/skills\">Skills docs</a>.</p>\n<h3>Codex</h3>\n<p>Codex discovers skills through <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developers.openai.com/codex/guides/agents-md\"><code>AGENTS.md</code></a> files and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developers.openai.com/codex/skills\"><code>.agents/skills/</code></a> directories.</p>\n<p>Install individual skills with <code>$skill-installer</code>:</p>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">$skill-installer install https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer\n</span></code></pre>\n<p>For more details, see the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developers.openai.com/codex/skills\">Codex Skills docs</a> and the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://developers.openai.com/codex/guides/agents-md\">AGENTS.md guide</a>.</p>\n<h3>Anything else</h3>\n<p>A generic install method is simply to clone the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/skills\">skills repository</a> and copy the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer\">skill</a> to your agent's skills directory.</p>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">git clone https://github.com/huggingface/skills.git\nmkdir -p ~/.agents/skills &amp;&amp; cp -R skills/skills/hugging-face-model-trainer ~/.agents/skills/\n</span></code></pre>\n<h2>Quick Start</h2>\n<p>Once the skill is installed, ask your coding agent to train a model:</p>\n<pre><code class=\"language-text\"><span class=\"code-snippet\">Train LiquidAI/LFM2.5-1.2B-Instruct on mlabonne/FineTome-100k using Unsloth on HF Jobs\n</span></code></pre>\n<p>The agent will generate a training script based on an <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py\">example in the skill</a>, submit the training to HF Jobs, and provide a monitoring link via Trackio.</p>\n<h2>How It Works</h2>\n<p>Training jobs run on <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/huggingface_hub/guides/jobs\">Hugging Face Jobs</a>, fully managed cloud GPUs. The agent:</p>\n<ol>\n<li>Generates a UV script with inline dependencies</li>\n<li>Submits it to HF Jobs via the <code>hf</code> CLI</li>\n<li>Reports the job ID and monitoring URL</li>\n<li>Pushes the trained model to your Hugging Face Hub repository</li>\n</ol>\n<h3>Example Training Script</h3>\n<p>The skill generates scripts like this based on the example in the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py\">skill</a>.</p>\n<pre><code class=\"language-python\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> /// script\n</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> dependencies = [&quot;unsloth&quot;, &quot;trl&gt;=0.12.0&quot;, &quot;datasets&quot;, &quot;trackio&quot;]\n</span><span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> ///\n</span>\n<span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">unsloth</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">FastLanguageModel</span></span>\n<span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">trl</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">SFTTrainer</span><span class=\"syntax-punctuation syntax-separator syntax-import-list syntax-python\">,</span> <span class=\"syntax-meta syntax-generic-name syntax-python\">SFTConfig</span></span>\n<span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">datasets</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">load_dataset</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span></span>, <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">tokenizer</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">FastLanguageModel</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">from_pretrained</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">LiquidAI/LFM2.5-1.2B-Instruct<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">load_in_4bit</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">True</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">max_seq_length</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">2048</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">FastLanguageModel</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">get_peft_model</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">r</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">16</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">lora_alpha</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">32</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">lora_dropout</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">0</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">target_modules</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-structure syntax-list syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-list syntax-begin syntax-python\">[</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">q_proj<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">k_proj<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">v_proj<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">out_proj<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">in_proj<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">w1<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">w2<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n        <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">w3<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span>\n    <span class=\"syntax-punctuation syntax-section syntax-list syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">dataset</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">load_dataset</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">trl-lib/Capybara<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-variable syntax-parameter syntax-python\">split</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">train<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">trainer</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">SFTTrainer</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-variable syntax-parameter syntax-python\">model</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">tokenizer</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">tokenizer</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">train_dataset</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">dataset</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">args</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">SFTConfig</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n        <span class=\"syntax-variable syntax-parameter syntax-python\">output_dir</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">./output<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">push_to_hub</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">True</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">hub_model_id</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">username/my-model<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">per_device_train_batch_size</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">4</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">gradient_accumulation_steps</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">4</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">num_train_epochs</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">1</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">learning_rate</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-numeric syntax-float syntax-python\">2e-4</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n        <span class=\"syntax-variable syntax-parameter syntax-python\">report_to</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">trackio<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    </span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">trainer</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">train</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n<span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">trainer</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">push_to_hub</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n</span></span></code></pre>\n<table>\n<thead>\n<tr>\n<th>Model Size</th>\n<th>Recommended GPU</th>\n<th>Approx Cost/hr</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>&lt;1B params</td>\n<td><code>t4-small</code></td>\n<td>~$0.40</td>\n</tr>\n<tr>\n<td>1-3B params</td>\n<td><code>t4-medium</code></td>\n<td>~$0.60</td>\n</tr>\n<tr>\n<td>3-7B params</td>\n<td><code>a10g-small</code></td>\n<td>~$1.00</td>\n</tr>\n<tr>\n<td>7-13B params</td>\n<td><code>a10g-large</code></td>\n<td>~$3.00</td>\n</tr>\n</tbody>\n</table>\n<p>For a full overview of Hugging Face Spaces pricing, check out the guide <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/hub/en/spaces-overview#hardware-resources\">here</a>.</p>\n<h2>Tips for Working with Coding Agents</h2>\n<ul>\n<li>Be specific about the model and dataset to use, and include Hub IDs (for example, <code>Qwen/Qwen2.5-0.5B</code> and <code>trl-lib/Capybara</code>). Agents will search for and validate those combinations.</li>\n<li>Mention Unsloth explicitly if you want it used. Otherwise, the agent will choose a framework based on the model and budget.</li>\n<li>Ask for cost estimates before launching large jobs.</li>\n<li>Request Trackio monitoring for real-time loss curves.</li>\n<li>Check job status by asking the agent to inspect logs after submission.</li>\n</ul>\n<h2>Resources</h2>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/skills\">Hugging Face Skills Repository</a></li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/unsloth-jobs\">Free credits for Unsloth Jobs Explorers</a></li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://unsloth.ai/docs/basics/inference-and-deployment/deploying-with-hugging-face-jobs\">Unsloth Tutorial on Hugging Face Jobs</a></li>\n<li><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/unsloth/jobs\">Example Unsloth Jobs scripts</a></li>\n</ul>\n",
  "content_markdown": "This blog post covers how to use [Unsloth](https://github.com/unslothai/unsloth) and Hugging Face Jobs for fast LLM fine-tuning (specifically [`LiquidAI/LFM2.5-1.2B-Instruct`](https://huggingface.co/LiquidAI/LFM2.5-1.2B-Instruct) ) through coding agents like Claude Code and Codex. Unsloth provides ~2x faster training and ~60% less VRAM usage compared to standard methods, so training small models can cost just a few dollars.\n\nWhy a small model? Small language models like LFM2.5-1.2B-Instruct are ideal candidates for fine-tuning. They are cheap to train, fast to iterate on, and increasingly competitive with much larger models on focused tasks. LFM2.5-1.2B-Instruct runs under 1GB of memory and is optimized for on-device deployment, so what you fine-tune can be served on CPUs, phones, and laptops.\n\n[![Watch the video](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/unsloth-jobs/screenshot.png)](http://www.youtube.com/watch?feature=player_embedded&v=Gh5P4niIFNA)\n\n## You will need\n\nWe are giving away free credits to fine-tune models on Hugging Face Jobs. Join the [Unsloth Jobs Explorers](https://huggingface.co/unsloth-jobs) organization to claim your free credits and one-month Pro subscription.\n\n- A [Hugging Face](https://huggingface.co) account (required for HF Jobs)\n- Billing setup (for verification, you can monitor your usage and manage your billing in your [billing page](https://huggingface.co/settings/billing)).\n- A Hugging Face token with write permissions\n- (optional) A coding agent (`Open Code`, `Claude Code`, or `Codex`)\n\n## Run the Job\n\nIf you want to train a model using HF Jobs and Unsloth, you can simply use the `hf jobs` CLI to submit a job.\n\nFirst, you need to install the `hf` CLI. You can do this by running the following command:\n\n```\n# mac or linux\ncurl -LsSf https://hf.co/cli/install.sh | bash\n```\n\nNext you can run the following command to submit a job:\n\n```sh\nhf jobs uv run https://huggingface.co/datasets/unsloth/jobs/resolve/main/sft-lfm2.5.py \\\n    --flavor a10g-small  \\\n    --secrets HF_TOKEN  \\\n    --timeout 4h \\\n    --dataset mlabonne/FineTome-100k \\\n    --num-epochs 1 \\\n    --eval-split 0.2 \\\n    --output-repo your-username/lfm-finetuned\n```\n\nCheck out the [training script](https://huggingface.co/datasets/unsloth/jobs/blob/main/sft-lfm2.5.py) and [Hugging Face Jobs documentation](https://huggingface.co/docs/hub/jobs) for more details.\n\n## Installing the Skill\n\nHugging Face model training skill lowers barrier of entry to train a model by simply prompting. First, install the skill with your coding agent.\n\n### Claude Code\n\nClaude Code discovers skills through its [plugin system](https://code.claude.com/docs/en/discover-plugins), so we need to install the Hugging Face skills first. To do so:\n\n1. Add the marketplace:\n\n```text\n/plugin marketplace add huggingface/skills\n```\n\n2. Browse available skills in the `Discover` tab:\n\n```text\n/plugin\n```\n\n3. Install the model trainer skill:\n\n```text\n/plugin install hugging-face-model-trainer@huggingface-skills\n```\n\nFor more details, see the [documentation](https://huggingface.co/docs/hub/en/agents-skills) on using the hub with skills or the Claude Code [Skills docs](https://code.claude.com/docs/en/skills).\n\n### Codex\n\nCodex discovers skills through [`AGENTS.md`](https://developers.openai.com/codex/guides/agents-md) files and [`.agents/skills/`](https://developers.openai.com/codex/skills) directories.\n\nInstall individual skills with `$skill-installer`:\n\n```text\n$skill-installer install https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer\n```\n\nFor more details, see the [Codex Skills docs](https://developers.openai.com/codex/skills) and the [AGENTS.md guide](https://developers.openai.com/codex/guides/agents-md).\n\n### Anything else\n\nA generic install method is simply to clone the [skills repository](https://github.com/huggingface/skills) and copy the [skill](https://github.com/huggingface/skills/tree/main/skills/huggingface-llm-trainer) to your agent's skills directory.\n\n```text\ngit clone https://github.com/huggingface/skills.git\nmkdir -p ~/.agents/skills && cp -R skills/skills/hugging-face-model-trainer ~/.agents/skills/\n```\n\n## Quick Start\n\nOnce the skill is installed, ask your coding agent to train a model:\n\n```text\nTrain LiquidAI/LFM2.5-1.2B-Instruct on mlabonne/FineTome-100k using Unsloth on HF Jobs\n```\n\nThe agent will generate a training script based on an [example in the skill](https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py), submit the training to HF Jobs, and provide a monitoring link via Trackio.\n\n## How It Works\n\nTraining jobs run on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs), fully managed cloud GPUs. The agent:\n\n1. Generates a UV script with inline dependencies\n2. Submits it to HF Jobs via the `hf` CLI\n3. Reports the job ID and monitoring URL\n4. Pushes the trained model to your Hugging Face Hub repository\n\n### Example Training Script\n\nThe skill generates scripts like this based on the example in the [skill](https://github.com/huggingface/skills/blob/main/skills/huggingface-llm-trainer/scripts/unsloth_sft_example.py).\n\n```python\n# /// script\n# dependencies = [\"unsloth\", \"trl>=0.12.0\", \"datasets\", \"trackio\"]\n# ///\n\nfrom unsloth import FastLanguageModel\nfrom trl import SFTTrainer, SFTConfig\nfrom datasets import load_dataset\n\nmodel, tokenizer = FastLanguageModel.from_pretrained(\n    \"LiquidAI/LFM2.5-1.2B-Instruct\",\n    load_in_4bit=True,\n    max_seq_length=2048,\n)\n\nmodel = FastLanguageModel.get_peft_model(\n    model,\n    r=16,\n    lora_alpha=32,\n    lora_dropout=0,\n    target_modules=[\n        \"q_proj\",\n        \"k_proj\",\n        \"v_proj\",\n        \"out_proj\",\n        \"in_proj\",\n        \"w1\",\n        \"w2\",\n        \"w3\",\n    ],\n)\n\ndataset = load_dataset(\"trl-lib/Capybara\", split=\"train\")\n\ntrainer = SFTTrainer(\n    model=model,\n    tokenizer=tokenizer,\n    train_dataset=dataset,\n    args=SFTConfig(\n        output_dir=\"./output\",\n        push_to_hub=True,\n        hub_model_id=\"username/my-model\",\n        per_device_train_batch_size=4,\n        gradient_accumulation_steps=4,\n        num_train_epochs=1,\n        learning_rate=2e-4,\n        report_to=\"trackio\",\n    ),\n)\n\ntrainer.train()\ntrainer.push_to_hub()\n```\n\n| Model Size   | Recommended GPU | Approx Cost/hr |\n| ------------ | --------------- | -------------- |\n| <1B params   | `t4-small`      | \\~$0.40        |\n| 1-3B params  | `t4-medium`     | \\~$0.60        |\n| 3-7B params  | `a10g-small`    | \\~$1.00        |\n| 7-13B params | `a10g-large`    | \\~$3.00        |\n\nFor a full overview of Hugging Face Spaces pricing, check out the guide [here](https://huggingface.co/docs/hub/en/spaces-overview#hardware-resources).\n\n## Tips for Working with Coding Agents\n\n- Be specific about the model and dataset to use, and include Hub IDs (for example, `Qwen/Qwen2.5-0.5B` and `trl-lib/Capybara`). Agents will search for and validate those combinations.\n- Mention Unsloth explicitly if you want it used. Otherwise, the agent will choose a framework based on the model and budget.\n- Ask for cost estimates before launching large jobs.\n- Request Trackio monitoring for real-time loss curves.\n- Check job status by asking the agent to inspect logs after submission.\n\n## Resources\n\n- [Hugging Face Skills Repository](https://github.com/huggingface/skills)\n- [Free credits for Unsloth Jobs Explorers](https://huggingface.co/unsloth-jobs)\n- [Unsloth Tutorial on Hugging Face Jobs](https://unsloth.ai/docs/basics/inference-and-deployment/deploying-with-hugging-face-jobs)\n- [Example Unsloth Jobs scripts](https://huggingface.co/datasets/unsloth/jobs)\n",
  "dateCreated": "2026-10-04T12:50:30.804479567+00:00",
  "date_created": "2026-02-20T00:00:00+00:00",
  "date_modified": "2026-02-20T00:00:00+00:00",
  "date_published": "2026-02-20T00:00:00+00:00",
  "description": "This blog post covers how to use Unsloth and Hugging Face Jobs for fast LLM fine-tuning (specifically LiquidAI/LFM2.5-1.2B-Instruct ) through coding agents like Claude Code and Codex. Unsloth provides ~2x faster training and ~60% less VRAM…",
  "external_url": "https://huggingface.co/blog/unsloth-jobs",
  "git": {
    "commit": "ebb0941c5c06a2ab2377342d607535262a3e969e",
    "path": "items/huggingface-co/2026/02/2026-02-20-train-ai-models-with-unsloth-and-hugging-face-jobs-for-free.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/ebb0941c5c06a2ab2377342d607535262a3e969e/items/huggingface-co/2026/02/2026-02-20-train-ai-models-with-unsloth-and-hugging-face-jobs-for-free.md"
  },
  "id": "urn:aggr:item:4d3e7522800795a9e5fbfeb5692258a88c614c3d",
  "isBasedOn": {
    "@id": "https://huggingface.co/blog/unsloth-jobs"
  },
  "mainEntity": {
    "@id": "https://huggingface.co/blog/unsloth-jobs",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-02-20-train-ai-models-with-unsloth-and-hugging-face-jobs-for-free/#webpage"
    },
    "dateModified": "2026-02-20T00:00:00+00:00",
    "datePublished": "2026-02-20T00:00:00+00:00",
    "headline": "Train AI models with Unsloth and Hugging Face Jobs for FREE",
    "timeRequired": "PT4M",
    "url": "https://huggingface.co/blog/unsloth-jobs",
    "wordCount": 847
  },
  "name": "Archived snapshot: Train AI models with Unsloth and Hugging Face Jobs for FREE",
  "preview": null,
  "reading_minutes": 4,
  "replicated_at": null,
  "source": "huggingface-co",
  "source_name": "Hugging Face - Blog",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-10-04T12:50:30.804479567+00:00",
  "title": "Train AI models with Unsloth and Hugging Face Jobs for FREE",
  "url": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-02-20-train-ai-models-with-unsloth-and-hugging-face-jobs-for-free/",
  "word_count": 847
}