hf jobs uv run reads launch config from UV scripts
Introduced 2026-09-17 · score 0.97
HOW TO USE IT
When a UV script needs a specific runtime or launch configuration, declare optional settings in its PEP 723 `[tool.hf-jobs]` table and run `hf jobs uv run <script>`. Script values act as defaults; CLI flags override them, while `env`, `secrets`, `labels`, and `volumes` merge entry by entry.
hf jobs uv run <script.py># /// script
# requires-python = ">=3.11"
# dependencies = ["vllm", "datasets"]
#
# [tool.hf-jobs]
# image = "vllm/vllm-openai:unlimited-ocr"
# flavor = "l4x1"
# python = "/usr/bin/python3"
# secrets = ["HF_TOKEN"]
# ///
hf jobs uv run <script.py>WHY THIS HELPS
Run a UV script as a Job with its runtime and launch settings declared in the script.
REQUIREMENTS AND LIMITATIONS
- Version: v1.32.0
- SCRIPT (required): Local UV script or URL to run.
- image: Docker image; use an image with `uv` installed.
- flavor: Hardware flavor for the job.
- python: Python interpreter for the run environment.
- timeout: Job timeout; documented examples accept seconds or time units such as `2h`.
- name: Job name, stored as the `name` label.
- namespace: Namespace under which the job runs.
- env: Environment variables; CLI `-e`/`--env` accepts `NAME=value`. Entries merge with CLI entries.
- secrets: Secret names; values are read from the local environment. An unset secret is an error. Entries merge with CLI entries.
- labels: Job metadata labels; docs allow label or `key=value` forms. Entries merge with CLI entries.
- volumes: Job volumes; entries merge with CLI entries.
- network_group: Join a network group; group names allow lowercase letters, digits, and dashes, up to 46 characters.
- network_aliases: Aliases for jobs in a network group; aliases allow lowercase letters, digits, and dashes, up to 34 characters, and must be unique per job.
- Prerequisite: Be authenticated with `hf auth login` using a token permitted to start and manage Jobs; Jobs require a positive credit balance.
- Typos and unknown keys are rejected with the list of valid options.
- Each run prints a config summary with script-sourced values marked and secrets redacted.
- The table is read by the CLI only; `run_uv_job()` and `create_scheduled_uv_job()` ignore it.
FIRST-PARTY EVIDENCE
- https://github.com/huggingface/huggingface_hub/releases/tag/v1.32.0
- https://huggingface.co/docs/hub/jobs-configuration
- https://huggingface.co/docs/huggingface_hub/package_reference/cli
Check the installed version and the source before using it. Entry JSON