hugging-face-jobs
This skill should be used when users want to run any workload on Hugging Face Jobs infrastructure. Covers UV scripts, Docker-based jobs, hardware selection, cost estimation, authentication with tokens, scheduled jobs, and result persistence.
What this skill does
# Running Workloads on Hugging Face Jobs
## Overview
Run any workload on fully managed Hugging Face infrastructure. No local setup required — jobs run on cloud CPUs, GPUs, or TPUs and can persist results to the Hub.
**Common use cases:** Data Processing, Batch Inference, Experiments & Benchmarks, Model Training (see `model-trainer` skill for TRL-specific), Synthetic Data Generation, Development & Testing, Scheduled Jobs.
## When to Use This Skill
- Run Python workloads on cloud infrastructure
- Execute jobs without local GPU/TPU setup
- Process data at scale or run batch inference
- Schedule recurring tasks
- Persist results to the Hugging Face Hub
## Key Directives
1. **Always use `hf_jobs()` MCP tool** — `hf_jobs("uv", {...})` or `hf_jobs("run", {...})`. Pass script content as a string; do NOT save to local files unless asked.
2. **Always handle authentication** — Hub operations require `HF_TOKEN` via secrets. See `references/token_usage.md`.
3. **Provide job details after submission** — job ID, monitoring URL, estimated time.
4. **Set appropriate timeouts** — default 30 min may be insufficient.
## Prerequisites
- HF Account with [Pro](https://hf.co/pro), [Team](https://hf.co/enterprise), or [Enterprise](https://hf.co/enterprise) plan
- Authenticated: verify with `hf_whoami()`
- For Hub operations: `secrets={"HF_TOKEN": "$HF_TOKEN"}` (never hardcode tokens)
> Full token guide: `references/token_usage.md`
---
## Quick Start
### Approach 1: UV Scripts (Recommended)
UV scripts use PEP 723 inline dependencies for clean, self-contained workloads.
```python
hf_jobs("uv", {
"script": """
# /// script
# dependencies = ["transformers", "torch"]
# ///
from transformers import pipeline
result = pipeline("sentiment-analysis")("I love Hugging Face!")
print(result)
""",
"flavor": "cpu-basic",
"timeout": "30m"
})
```
**CLI:** `hf jobs uv run my_script.py --flavor cpu-basic --timeout 30m`
**Python API:** `run_uv_job("my_script.py", flavor="cpu-basic", timeout="30m")`
**Custom Docker image for UV:**
```python
hf_jobs("uv", {
"script": "inference.py",
"image": "vllm/vllm-openai:latest",
"flavor": "a10g-large"
})
```
**Python version:** add `"python": "3.11"` (default is 3.12).
**Extra dependencies at runtime:** add `"dependencies": ["transformers", "torch>=2.0"]`.
**⚠️ Script paths:** The `hf_jobs()` MCP tool requires **inline code** or a **URL** — local paths won't exist in the remote container. Read the file first:
```python
from pathlib import Path
script = Path("hf-jobs/scripts/foo.py").read_text()
hf_jobs("uv", {"script": script})
```
The `hf jobs uv run` CLI *does* support local paths (it uploads the script).
### Approach 2: Docker-Based Jobs
```python
hf_jobs("run", {
"image": "python:3.12",
"command": ["python", "-c", "print('Hello from HF Jobs!')"],
"flavor": "cpu-basic",
"timeout": "30m"
})
```
Use HF Spaces as images: `"image": "hf.co/spaces/lhoestq/duckdb"`.
### Finding UV Scripts on Hub
The `uv-scripts` organization provides ready-to-use scripts:
```python
dataset_search({"author": "uv-scripts", "sort": "downloads", "limit": 20})
```
---
## Hardware Selection
| Workload | Recommended Flavor | Notes |
|----------|-------------------|-------|
| Data processing, testing | `cpu-basic`, `cpu-upgrade` | Lightweight tasks |
| Small models (<1B) | `t4-small` | Quick tests |
| Medium models (1-7B) | `t4-medium`, `l4x1` | |
| Large models (7-13B) | `a10g-small`, `a10g-large` | Production inference |
| Very large models (13B+) | `a100-large` | |
| Multi-GPU | `l4x4`, `a10g-largex2`, `a10g-largex4` | Parallel workloads |
| TPU | `v5e-1x1`, `v5e-2x2`, `v5e-2x4` | JAX/Flax |
**All flavors:** CPU: `cpu-basic`, `cpu-upgrade` · GPU: `t4-small`, `t4-medium`, `l4x1`, `l4x4`, `a10g-small`, `a10g-large`, `a10g-largex2`, `a10g-largex4`, `a100-large` · TPU: `v5e-1x1`, `v5e-2x2`, `v5e-2x4`
Start small, scale up. See `references/hardware_guide.md` for detailed specs.
---
## Saving Results
**⚠️ Jobs are ephemeral — unsaved results are lost.** Push to Hub (recommended), external storage, or an API.
```python
# Push to Hub (include secrets={"HF_TOKEN": "$HF_TOKEN"} in job config)
model.push_to_hub("username/model-name", token=os.environ["HF_TOKEN"])
dataset.push_to_hub("username/dataset-name", token=os.environ["HF_TOKEN"])
```
> Full persistence guide: `references/hub_saving.md`
---
## Timeout Management
Default: **30 minutes**. Set via `"timeout": "2h"`.
Formats: integer (seconds), or string with suffix (`"5m"`, `"2h"`, `"1d"`).
| Scenario | Recommended | | Scenario | Recommended |
|----------|-------------|-|----------|-------------|
| Quick test | 10-30 min | | Batch inference | 2-4 h |
| Data processing | 1-2 h | | Long-running | 8-24 h |
Always add 20-30% buffer. On timeout, the job is killed immediately.
---
## Cost Estimation
`Total Cost = Hours × $/hour`. Start small — test on `cpu-basic` (~$0.10/h), scale to `a10g-large` (~$5/h) when needed.
Tips: Set appropriate timeouts, use checkpoints, don't over-provision hardware.
---
## Monitoring and Tracking
```python
hf_jobs("ps") # List jobs
hf_jobs("inspect", {"job_id": "..."}) # Status
hf_jobs("logs", {"job_id": "..."}) # Logs
hf_jobs("cancel", {"job_id": "..."}) # Cancel
```
**Python API:** `list_jobs()`, `inspect_job(job_id)`, `fetch_job_logs(job_id)`, `cancel_job(job_id)`.
**CLI:** `hf jobs ps`, `hf jobs logs <id>`, `hf jobs cancel <id>`.
Jobs URL: `https://huggingface.co/jobs/username/job-id`
Wait for user to request status checks — avoid polling repeatedly.
---
## Scheduled Jobs
```python
hf_jobs("scheduled uv", {
"script": "your_script.py",
"schedule": "@hourly", # or CRON: "0 9 * * 1"
"flavor": "cpu-basic"
})
```
**Presets:** `@annually`, `@monthly`, `@weekly`, `@daily`, `@hourly` — or any CRON expression.
**Manage:** `hf_jobs("scheduled ps")`, `scheduled inspect`, `scheduled suspend`, `scheduled resume`, `scheduled delete`.
**Python API:** `create_scheduled_uv_job()`, `list_scheduled_jobs()`, `suspend_scheduled_job()`, `resume_scheduled_job()`, `delete_scheduled_job()`.
---
## Webhooks
Trigger jobs automatically when Hub repositories change:
```python
from huggingface_hub import create_webhook
webhook = create_webhook(
job_id=job.id,
watched=[{"type": "user", "name": "your-username"}],
domains=["repo", "discussion"],
secret="your-secret"
)
```
The triggered job receives `WEBHOOK_PAYLOAD` as an environment variable. Use cases: auto-process new datasets, trigger inference on model updates, run tests on code changes.
---
## Common Workload Patterns
This skill ships ready-to-run scripts in `scripts/`. Prefer them over inventing new templates.
### Pattern 1: Dataset → Model Responses (vLLM) — `scripts/generate-responses.py`
Loads a Hub dataset, applies a chat template, generates responses with vLLM, pushes output. **Requires:** GPU + write token.
```python
from pathlib import Path
script = Path("hf-jobs/scripts/generate-responses.py").read_text()
hf_jobs("uv", {
"script": script,
"script_args": ["username/input", "username/output",
"--model-id", "Qwen/Qwen3-30B-A3B-Instruct-2507"],
"flavor": "a10g-large", "timeout": "4h",
"secrets": {"HF_TOKEN": "$HF_TOKEN"}
})
```
### Pattern 2: CoT Self-Instruct — `scripts/cot-self-instruct.py`
Generates synthetic prompts/answers via CoT Self-Instruct with optional filtering. **Requires:** GPU + write token.
```python
from pathlib import Path
script = Path("hf-jobs/scripts/cot-self-instruct.py").read_text()
hf_jobs("uv", {
"script": script,
"script_args": ["--seed-dataset", "davanstrien/s1k-reasoning",
"--output-dataset", "username/synthetic-math",
"--num-samples", "5000"],
"flavor": "l4x4", "timeout": "8h",
"secrets": {"HF_TOKEN": "$HF_TOKEN"}
})
```
### Pattern 3: Streaming Dataset Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.