Checkpointed, config-hashed campaign runs over a rented GPU spot fleet: restart-exact registry, event records, probe-or-bail admission, and leak-proof cloud brokers (Vast/RunPod/Modal).
Project description
run-farm
Status: alpha (0.1.x). The API will change without notice until 1.0.
Checkpointed, config-hashed campaign runs over a rented GPU spot fleet. You bring
an engine (any Callable[[RunConfig, RunContext], dict]) and a config; run-farm gives
you a restart-exact run registry, streamed event records, probe-or-bail admission on
flaky marketplace hosts, and leak-proof, teardown-verified cloud brokers for Vast,
RunPod, and Modal.
Why
Spot-fleet executors (SkyPilot, dstack) recover from preemption but assume reliable hosts and own no provenance. A 2026-06 literature sweep found nothing covering the full contract run-farm owns:
- Restart-exact, config-hashed runs. A result names the config hash that produced it; a preempted run resumes bit-identically from a full-state checkpoint, and re-submitting a finished run is a no-op. Idempotent skip makes spot preemption free.
- Probe-or-bail admission (P9). Hosts, networks, and devices lie -- the standing case study is a 0.996-reliability host with zero outbound bandwidth. run-farm measures a host before it runs work and bails on the ones that can't. Measured live: 58% of created instances never boot, and probe-or-bail fails them over ~9× faster than waiting out a timeout -- so P9 is a cost feature, not just a correctness one.
- Leak-proof cloud brokers (P10). A leaked GPU bills by the second. Every
Provider.rent()destroys its host on every exit and independently verifies it is gone, raising on a leak. Verified live: 0 leaks across 34 rentals, including through SIGTERM.
Install
pip install run-farm # base: jax + numpy only
pip install 'run-farm[modal]' # + the Modal serverless executor
pip install 'run-farm[s3]' # + the S3 object-store registry backend
The Vast broker is intentionally stdlib-only (the vastai SDK breaks against the live
API), so there is no vast extra.
Quickstart
from run_farm import (SimpleRunConfig, FileRunRegistry, JsonlEventSink,
LocalExecutor, ProbeAdmission, run_campaign)
from run_farm.testing import echo_run_fn # a physics-free RunFn
configs = [SimpleRunConfig(name="demo", params={"i": i}) for i in range(4)]
run_campaign(configs, echo_run_fn,
registry=FileRunRegistry("out"), sink=JsonlEventSink(),
admission=ProbeAdmission(require_gpu=False), executor=LocalExecutor())
Swap LocalExecutor for a ProviderExecutor over VastProvider, a FleetExecutor,
or a ModalExecutor -- the RunFn and records are unchanged. run_farm.testing ships
physics-free RunFns so you can smoke-test a real fleet end to end for pennies before
pointing an expensive engine at it.
Modules
| Module | What |
|---|---|
protocols |
the six contracts (RunConfig, RunRegistry, EventSink, Admission, Executor, Provider) |
config |
SimpleRunConfig + restart-exact checkpoint / run-directory helpers |
driver |
the physics-blind run_campaign / execute_config |
reference |
local-machine FileRunRegistry, JsonlEventSink, ProbeAdmission |
vast, runpod |
reference Provider adapters (leak-proof, teardown-verified) |
provider_exec, fleet |
rent-a-box executors, with per-host failover |
modal_exec |
serverless executor (needs [modal]) |
store |
shared object-store registry/sink for cross-cloud campaigns (needs [s3]) |
ledger |
RentalLedger -- append-only rental receipts (spend + outcomes) |
budget |
estimate() + CappedProvider (an enforced dollar cap) |
sweep |
legs() -- expand (arm × replicate × grid) into a campaign |
reap |
destroy orphaned instances (scoped, refuses unsafe sweeps) |
testing |
physics-free RunFns for engine-less smoke tests |
Development
pip install -e '.[test]'
pytest -q -n auto --cov=run_farm
Citing
See CITATION.cff.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file run_farm-0.1.0.tar.gz.
File metadata
- Download URL: run_farm-0.1.0.tar.gz
- Upload date:
- Size: 124.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27ea9b660a1b17205fca376a6f372336e2b7e759a384916ce3c528822cddcffd
|
|
| MD5 |
4e6e88e350e14e8f453b2363b2634611
|
|
| BLAKE2b-256 |
c1b7c5738cff6b9651b7df3126333dcb89699e370f62e1571d247c2cc88f4cba
|
Provenance
The following attestation bundles were made for run_farm-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on JimGalasyn/run-farm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
run_farm-0.1.0.tar.gz -
Subject digest:
27ea9b660a1b17205fca376a6f372336e2b7e759a384916ce3c528822cddcffd - Sigstore transparency entry: 2191901766
- Sigstore integration time:
-
Permalink:
JimGalasyn/run-farm@ee80fb7763fd2d0f9c080f095d681e67bbebdaeb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JimGalasyn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ee80fb7763fd2d0f9c080f095d681e67bbebdaeb -
Trigger Event:
release
-
Statement type:
File details
Details for the file run_farm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: run_farm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 90.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c386afcae10585d42ce53f4b5f686621ddfb25bef6c5a7193b5855c03e62357
|
|
| MD5 |
10c7eb32e2981ec6ee47e38d658a12a1
|
|
| BLAKE2b-256 |
6fd53302d7a5ca9fb34ff37581650e0ae8e895f50356bd1c5387cc32093c1262
|
Provenance
The following attestation bundles were made for run_farm-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on JimGalasyn/run-farm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
run_farm-0.1.0-py3-none-any.whl -
Subject digest:
7c386afcae10585d42ce53f4b5f686621ddfb25bef6c5a7193b5855c03e62357 - Sigstore transparency entry: 2191901781
- Sigstore integration time:
-
Permalink:
JimGalasyn/run-farm@ee80fb7763fd2d0f9c080f095d681e67bbebdaeb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/JimGalasyn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ee80fb7763fd2d0f9c080f095d681e67bbebdaeb -
Trigger Event:
release
-
Statement type: