Skip to main content

Skyrun

Run your projects on cloud compute.

CI Python License: MIT

Skyrun allows to smoothly execute your project on Modal CPU or GPU compute, streams live terminal output, and downloads saved files. Optional bidirectional sync brings selected changes back into your working project. Your scripts need no Modal imports or runner decorators.

The package exposes a CLI and Python API, with a provider interface for future backends. Modal is the first supported provider. Version 0.1.0 is prepared for release; use the repository installation until it is published to PyPI.

Quick start · Examples · Configuration · File sync · Python API & architecture · Publishing

Why Skyrun

  • Run anywhere philosophy. Run the same scripts locally or remotely using ordinary argv commands, sibling imports, and filesystem paths.
  • Flexible sourcing. Only the chosen project folder is scanned; .modalignore controls eligible files, just like .gitignore
  • Lazy and efficient file transfers. Immutable source files are reused by content hash. Artifact downloads stream to disk with atomic file replacement.
  • Remote [machine] is here experience. Live PTY output supports normal tqdm progress bars, carriage returns, Unicode, and cursor movement. Full logs remain available.
  • Graceful stops. Ctrl-C signals the workload process group, allows checkpoint cleanup, then commits and retrieves saved files. Repeated requests escalate.
  • Selective round trips. Explicitly chosen files or directories return to the working project with integrity checks and conflict detection.
  • Extensible infrastructure - run anywhere. Provider SDKs stay behind adapters. Core config, snapshots, examples, and dry runs work without cloud authentication.

Installation I

pip install 'skyrun[modal]'

Installation II (from source code)

Use Python 3.11+ and an authenticated Modal account. From this repository:

python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[modal]'
python -m modal setup  # only if this environment is not already authenticated
conda create -n skyrun python=3.12 -y
conda activate skyrun
pip install -e '.[modal]'
python -m modal setup  # only if this environment is not already authenticated

skyrun init /tmp/skyrun-hello --example hello cd /tmp/skyrun-hello skyrun --dry-run skyrun run


## Quick start

The hello example uses CPU and the Python standard library. Expect
`Hello from skyrun`, exit `0`, and `runs/<run-id>/outputs/hello.json`. Actual runs
allocate resources in your Modal account; initialization and dry runs are offline.

For an existing project, run `skyrun init` in its folder, configure its remote
requirements, inspect uploads, and invoke its normal command:

```bash
skyrun run --gpu T4 --timeout 1800 -- python train.py --epochs 5
# Select a folder explicitly using configuration stored elsewhere:
skyrun run --config /path/to/skyrun.toml --project-dir /path/to/project -- python train.py

Arguments after -- go directly to the subprocess. The command's working directory is the uploaded project root. The complete quick start explains installation, dependencies, saved files, and recovery.

Examples included with every installation

Example Create a runnable project Default compute What it shows
Hello skyrun init hello --example hello CPU Minimal command, live logs, saved JSON
Training skyrun init training --example training T4 PyTorch, tqdm, Ctrl-C checkpoint save
Inference skyrun init inference --example inference T4 Hardware report, pinned Qwen model, model cache

Then enter the created directory and run skyrun --dry-run followed by skyrun run. Examples include their configuration, ignore file, and any required remote dependencies. They are package resources, so users of a wheel get the same samples as repository users. See commands and expected outputs.

Configuration

Use skyrun.toml or [tool.skyrun] in pyproject.toml. Runtime resources belong under [run]; provider settings belong under [modal]. A typical configuration is:

provider = "modal"

[run]
app_name = "my-project"
gpu = "T4"
timeout_seconds = 1800
shutdown_grace_seconds = 60

[image]
python_version = "3.11"
requirements = "requirements-gpu.txt"
apt_packages = ["git"]

[sync]
project_dir = "src"
output_dirs = ["outputs", "checkpoints"]
local_dir = "runs"

[workload]
command = ["python", "train.py"]
terminal = true

Relative paths are based on the configuration directory; output paths and ignore rules are based on the project folder. Unspecified Volume names derive from the application name. Local environments and credentials are not copied. Configure workload variables in [environment] and private values through named Modal Secrets. See the configuration reference.

Optional bidirectional sync

Output directories always download into the run directory. To bring selected files back into your original working project, add an explicit selection:

[sync]
project_dir = "src"
output_dirs = ["outputs", "checkpoints"]
bidirectional = ["settings.json", "data/processed"]

Selected files upload at launch. New and modified selected files return after execution, including handled failures and stops. Local changes made during the run cause a conflict: local files stay intact and remote versions remain under runs/<run-id>/_sync/files/. Use --no-sync to defer application or recover with an explicit conflict policy:

skyrun download RUN_ID --sync --sync-conflict local
skyrun download RUN_ID --sync --sync-conflict remote

Sync runs at launch/completion boundaries. Deletions are reported, never propagated automatically. Selections are literal paths, obey .modalignore, and must not overlap output directories. See sync rules and resumable checkpoints.

Logs, interruption, and recovery

Each invocation creates runs/<run-id>/ with the submitted manifest, execution status, complete _runner/console.log, and configured output files. Model caches persist on a separate Volume. Source blobs use their own content-addressed Volume.

Press Ctrl-C once to request SIGINT and allow workload cleanup. A second press forces the workload to stop while the wrapper retrieves saved files. A third is an emergency cancellation. Your code must save its own checkpoint, for example from finally; the runner cannot serialize an arbitrary model automatically.

Normal exits preserve the command's exit code. Cancellation returns 130 and timeout returns 124. A timeout includes the configured cleanup allowance. Recover committed files without allocating a GPU:

skyrun download RUN_ID
skyrun download RUN_ID --output-dir /tmp/recovered

The client is synchronous. Losing its connection is not a graceful stop request; a hard kill or preemption may leave only previously committed files. The output stream supports terminal output and progress bars; it does not forward interactive stdin. See operations and exit codes.

Architecture

                              LOCAL MACHINE                                              MODAL CONTAINER
 ┌──────────────────────────────────────────────────────────────────┐        ┌────────────────────────────────────────┐
 │  CLI / SDK Entrypoint ($ skyrun --gpu A100 -- python train.py)   │        │   Remote Runner Engine                 │
 │  ─────────────────────────────────────────────────────────────   │        │   ───────────────────────────────────  │
 │  1. Parse Config (`pyproject.toml` or `skyrun.toml`)             │        │   1. Mount Artifact Volume             │
 │  2. Scan & Hash Source                                           │        │   2. Extract Source Bundle             │
 │  3. Pack In-Memory Zip/Tar Archive                               │        │   3. Set Up Process Group + PTY        │
 │  4. Invoke Remote Modal App                                      │ ────>  │   4. Execute Subprocess (eg.`train.py`)│
 │                                                                  │        │   5. Catch Signals / Harvest Artifacts │
 │  5. Stream Live Logs / Terminal Output (PTY)                     │ <────  │   6. Save to `/artifacts/<run_id>/`    │
 │  6. Download Artifacts to `runs/<run_id>/`                       │        │                                        │
 └──────────────────────────────────────────────────────────────────┘        └────────────────────────────────────────┘

Python API

from skyrun import download, run

result = run("skyrun.toml", gpu="L4", command=["python", "train.py"])
print(result.run_id, result.status, result.returncode, result.directory)
download(result.run_id, "skyrun.toml", output_dir="/tmp/recovered")

The provider contract supports third-party adapters through the skyrun.providers entry-point group. See architecture and extension points.

Development and releases

python -m pip install -e '.[modal,dev]'
python -m pytest
python -m ruff check .
python -m ruff format --check .
python -m build
python -m twine check --strict dist/*
python tools/check_dist.py

Offline tests exercise real subprocess lifecycle behavior, source policy, transport interruption, recovery, and sync conflicts. Live Modal tests require explicit opt-in. Read validation for the test boundaries and GPU release checks.

The publishing guide covers namespace ownership, building and checking distributions, clean-wheel example validation, TestPyPI rehearsal, Trusted Publishing, manual uploads, release tags, and post-release verification. The repository includes CI and separate TestPyPI/PyPI publish jobs.

Contributions follow CONTRIBUTING.md and the code of conduct. See AUTHORS.md, security reporting, and the changelog. Skyrun is licensed under MIT.

Metadata

Release files for skyrun 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skyrun 0.1.1
File Size Uploaded Provenance Actions
skyrun-0.1.1.tar.gz 71.5 kB With provenance Details for skyrun-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skyrun 0.1.1
File Interpreter ABI Platform Actions
skyrun-0.1.1-py3-none-any.whl Python 3 none any Details for skyrun-0.1.1-py3-none-any.whl

Total release size: 112.1 kB

Release files / skyrun-0.1.1.tar.gz

Download URL skyrun-0.1.1.tar.gz
Size 71.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3ec4ef466a9c023a8dce71478606e659b1b32e1549712fbb83e0e447ef6c8a8f
BLAKE2b-256 checksum
How to use checksums
e3e58e3f55a4ccbe1244c96401354ba1672aed050a6f923c77d3e6a106d10d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Release files / skyrun-0.1.1-py3-none-any.whl

Download URL skyrun-0.1.1-py3-none-any.whl
Size 40.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff29ef9145378a0ad346529d40a94ba63fcc9eadb3a5356db7d0e43584f30bfb
BLAKE2b-256 checksum
How to use checksums
435a2868579e7a01fa3d4383ce4395042ec490305b6f8c3339caedf183b0f2d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

Security for skyrun 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for skyrun-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page