> For the complete documentation index, see [llms.txt](https://unsloth.ai/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unsloth.ai/docs/de/grundlagen/inference-and-deployment/deploying-llms-with-hugging-face-jobs.md).

# LLMs mit Hugging Face Jobs bereitstellen

Hugging Face Jobs und Skills verwenden, um LFM mit Codex / Claude Code mit einem SKILL feinabzustimmen.

Dieser Leitfaden behandelt, wie man [Unsloth](https://github.com/unslothai/unsloth) und [Liquid LFM2.5](/docs/de/modelle/tutorials/lfm2.5.md) für schnelles Fine-Tuning von LLMs mit Coding-Agenten wie [Claude Code](/docs/de/grundlagen/claude-code.md). Unsloth bietet etwa 2x schnelleres Training und rund 60 % weniger VRAM-Nutzung im Vergleich zu Standardmethoden.

### Sie benötigen

* Ein [Hugging Face](https://huggingface.co) Konto (erforderlich für HF Jobs)
* Ein Hugging-Face-Token mit Schreibberechtigungen
* Einen Coding-Agenten (Open Code, Claude Code, Codex)
* Lesen Sie unseren [Claude Code](/docs/de/grundlagen/claude-code.md) Leitfaden zum Einrichten.

### Installation des Skills

#### Claude Code

Claude Code entdeckt Skills über sein [Plug-in-System](https://code.claude.com/docs/en/discover-plugins).

1. Fügen Sie den Marktplatz hinzu:

```bash
/plugin marketplace add huggingface/skills
```

2. Durchsuchen Sie verfügbare Skills im **Entdecken** Tab:

```bash
/plugin
```

3. Installieren Sie den Model-Trainer-Skill:

```bash
/plugin install hugging-face-model-trainer@huggingface-skills
```

Weitere Details finden Sie in den [Claude Code-Plugin-Dokumentation](https://code.claude.com/docs/en/discover-plugins) und den [Skills-Dokumentation](https://code.claude.com/docs/en/skills).

#### Codex

Codex entdeckt Skills über [`AGENTS.md`](https://developers.openai.com/codex/guides/agents-md) Dateien und [`.agents/skills/`](https://developers.openai.com/codex/skills) Verzeichnisse.

**Einzelne Skills installieren mit `$skill-installer`**

{% code overflow="wrap" %}

```bash
$skill-installer install https://github.com/huggingface/skills/tree/main/skills/hugging-face-model-trainer
```

{% endcode %}

Weitere Details finden Sie in den [Codex-Skills-Dokumentation](https://developers.openai.com/codex/skills) und den [AGENTS.md-Leitfaden](https://developers.openai.com/codex/guides/agents-md).

### Schnellstart

Sobald der Skill installiert ist, bitten Sie Ihren Coding-Agenten, ein Modell zu trainieren. Wir verwenden [Liquid LFM2.5](/docs/de/modelle/tutorials/lfm2.5.md)

{% code overflow="wrap" %}

```
Train LiquidAI/LFM2.5-1.2B-Instruct auf trl-lib/Capybara mit Unsloth auf HF Jobs
```

{% endcode %}

Der Agent generiert ein Trainingsskript basierend auf einem [Beispiel im Skill](https://github.com/huggingface/skills/blob/main/skills/hugging-face-model-trainer/scripts/unsloth_sft_example.py), sendet das Training an HF Jobs und stellt über Trackio einen Überwachungslink bereit.

### Hugging Face Jobs verwenden

Trainingsjobs werden ausgeführt auf [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs) — vollständig verwaltete Cloud-GPUs. Wenn Sie mit Google-Colab-Guthaben vertraut sind, bietet Hugging Face Jobs ebenfalls ein ähnliches Guthabensystem. Es ist ein Pay-as-you-go-Modell, oder Sie können Guthaben im Voraus erwerben. Der Agent:

1. Generiert ein UV-Skript mit eingebetteten Abhängigkeiten
2. Übermittelt es an HF Jobs über die `hf` CLI
3. Gibt die Job-ID und die Überwachungs-URL aus
4. Das trainierte Modell wird in Ihr Hugging Face Hub-Repository übertragen

#### Beispiel-Trainingsskript

Der Skill generiert Skripte wie dieses:

{% code expandable="true" %}

```py
# /// script
# dependencies = ["unsloth", "trl>=0.12.0", "datasets", "trackio"]
# ///

from unsloth import FastLanguageModel
from trl import SFTTrainer, SFTConfig
from datasets import load_dataset

model, tokenizer = FastLanguageModel.from_pretrained(
    "Qwen/Qwen2.5-0.5B",
    load_in_4bit=True,
    max_seq_length=2048,
)

model = FastLanguageModel.get_peft_model(
    model,
    r=16,
    lora_alpha=32,
    lora_dropout=0,
    target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
                    "gate_proj", "up_proj", "down_proj"],
)

dataset = load_dataset("trl-lib/Capybara", split="train")

trainer = SFTTrainer(
    model=model,
    tokenizer=tokenizer,
    train_dataset=dataset,
    args=SFTConfig(
        output_dir="./output",
        push_to_hub=True,
        hub_model_id="username/my-model",
        per_device_train_batch_size=4,
        gradient_accumulation_steps=4,
        num_train_epochs=1,
        learning_rate=2e-4,
        report_to="trackio",
    ),
)

trainer.train()
trainer.push_to_hub()
```

{% endcode %}

Die Kosten für das Training mit Hugging Face Jobs sind unten aufgeführt:

| Modellgröße                  | Empfohlene GPU | Ca. Kosten/Stunde |
| ---------------------------- | -------------- | ----------------- |
| weniger als 1 Mrd. Parameter | `t4-small`     | \~$0.40           |
| 1–3 Mrd. Parameter           | `t4-medium`    | \~$0.60           |
| 3–7 Mrd. Parameter           | `a10g-small`   | \~$1.00           |
| 7–13 Mrd. Parameter          | `a10g-large`   | \~$3.00           |

Einen vollständigen Überblick über die Preisgestaltung von Hugging Face Spaces finden Sie im Leitfaden [hier](https://huggingface.co/docs/hub/en/spaces-overview#hardware-resources).

### Tipps für die Arbeit mit Coding-Agenten

* Seien Sie konkret in Bezug auf das zu verwendende Modell und Dataset und fügen Sie Hub-IDs hinzu (z. B. `Qwen/Qwen2.5-0.5B`, `trl-lib/Capybara`). Agenten suchen nach diesen Kombinationen und validieren sie.
* Erwähnen Sie Unsloth ausdrücklich, wenn es verwendet werden soll. Andernfalls entscheidet der Agent das Framework anhand des Modells und des Budgets.
* Bitten Sie vor dem Start großer Jobs um Kostenschätzungen
* Fordern Sie Trackio-Überwachung für Loss-Kurven in Echtzeit an
* Prüfen Sie den Jobstatus, indem Sie den Agenten bitten, nach der Übermittlung die Logs zu prüfen

### Ressourcen

* [Hugging Face Skills-Repository](https://github.com/huggingface/skills)

{% embed url="<https://youtu.be/Gh5P4niIFNA>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://unsloth.ai/docs/de/grundlagen/inference-and-deployment/deploying-llms-with-hugging-face-jobs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
