Task YAML
Complete reference for SkyPilot-compatible Task YAML.
The Mithril CLI uses the SkyPilot YAML task spec for defining and launching runs.
Because the spec is SkyPilot-compatible, existing SkyPilot tasks run without modification when targeting Mithril infrastructure.
To run on Mithril, specify:
resources:
infra: mithrilMithril extends the spec with a limit price declared in task config that caps what you’ll pay per hour for each instance. Clusters launch only when capacity is available at or below that price, and often run at lower cost.
config:
mithril:
limit_price: 32.0 # max $/hour/instanceIf you’ve launched jobs with SkyPilot, the structure below will be familiar.
Spec structure
A task spec packages everything required to run your code on remote GPUs:
Compute
Environment setup
Code sync
Storage mounts
Execution commands
Minimal example:
Execution lifecycle
Tasks execute in a fixed order:
Subsequent runs:
Skip provisioning if the cluster exists
Skip setup
Re-sync code
Re-run commands
This creates a tight iteration loop for testing changes.
Top-level fields
name
string
No
-n, --name
Task name (auto-generated if omitted)
resources
object
Yes
See resources
Compute requirements
run
string
Yes
Inline command arg
Main commands to execute
setup
string
No
—
Setup commands (run once per cluster)
workdir
string
No
--workdir
Local directory to sync
file_mounts
object
No
—
Remote storage mounts
volumes
object
No
—
Mithril volumes to mount
envs
object
No
-e KEY=VALUE
Environment variables
num_nodes
int
No
--num-nodes
Number of nodes (default: 1)
config
object
No
--config KEY=VALUE
Provider-specific config
Core SkyPilot fields
The following fields come directly from the SkyPilot spec.
resources
Fields
infra
string
--infra
Infrastructure (mithril, mithril/region)
accelerators
string
--gpus
GPU type:count (e.g., B200:8)
→ Infra — multi-cloud support, spot bids, reservations, and hosted Kubernetes
run
Main task commands. Runs every time the task is launched.
Multi-line:
setup
One-time setup commands. Runs once when cluster is provisioned.
workdir
Sync local directory to cluster.
Files are synced to ~/sky_workdir/ on the cluster.
file_mounts
Mount remote storage (S3, GCS, etc.).
→ File Mounts for details.
volumes
Mount Mithril persistent disks
envs
Environment variables available in setup and run.
num_nodes
Multi-node distributed training.
SkyPilot sets up distributed environment variables automatically.
config
Provider-specific configuration.
Default: $32.00/hour/instance if not specified.
→ Spot auction mechanics — how the spot auction, pricing, and preemption work
Complete example
Last updated