> 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

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 LLM-Fine-Tuning über Coding-Agents wie [Claude Code](/docs/de/grundlagen/claude-code.md). Unsloth bietet etwa 2x schnelleres Training und etwa 60 % weniger VRAM-Nutzung im Vergleich zu Standardmethoden.

### Sie benötigen

* Ein [Hugging Face](https://huggingface.co) Konto (erforderlich für HF Jobs)
* Einen 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.

### Die Skill installieren

#### Claude Code

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

1. Fügen Sie den Marketplace hinzu:

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

2. Durchsuchen Sie verfügbare Skills im **Discover** 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 Plugins-Dokumenten](https://code.claude.com/docs/en/discover-plugins) und den [Skills-Dokumenten](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.

**Installieren Sie einzelne Skills 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-Dokumente](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" %}

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

{% endcode %}

Der Agent wird ein Trainingsskript auf Grundlage eines [Beispiels im Skill](https://github.com/huggingface/skills/blob/main/skills/hugging-face-model-trainer/scripts/unsloth_sft_example.py)erstellen, das Training an HF Jobs übermitteln und einen Monitoring-Link über Trackio bereitstellen.

### Verwendung von Hugging Face Jobs

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

1. Erzeugt ein UV-Skript mit Inline-Abhängigkeiten
2. Übermittelt es über die `hf` CLI
3. Meldet die Job-ID und die Monitoring-URL
4. Das trainierte Modell wird in Ihr Hugging-Face-Hub-Repository gepusht

#### 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 | Geschätzte Kosten/Stunde |
| --------------- | -------------- | ------------------------ |
| <1B Parameter   | `t4-small`     | \~$0.40                  |
| 1–3B Parameter  | `t4-medium`    | \~$0.60                  |
| 3–7B Parameter  | `a10g-small`   | \~$1.00                  |
| 7–13B Parameter | `a10g-large`   | \~$3.00                  |

Für einen vollständigen Überblick über die Preisgestaltung von Hugging Face Spaces sehen Sie sich den Leitfaden an [hier](https://huggingface.co/docs/hub/en/spaces-overview#hardware-resources).

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

* Seien Sie spezifisch bezüglich des zu verwendenden Modells und Datensatzes und geben Sie Hub-IDs an (z. B. `Qwen/Qwen2.5-0.5B`, `trl-lib/Capybara`). Agents suchen nach diesen Kombinationen und validieren sie.
* Erwähnen Sie Unsloth ausdrücklich, wenn Sie möchten, dass es verwendet wird. Andernfalls entscheidet der Agent den Framework basierend auf Modell und Budget.
* Bitten Sie vor dem Start großer Jobs um Kostenschätzungen
* Fordern Sie Trackio-Monitoring für Loss-Kurven in Echtzeit an
* Überprüfen Sie den Jobstatus, indem Sie den Agenten nach der Übermittlung die Logs prüfen lassen

### 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
