Skip to main content

โšก SpotWarp: Zero-Downtime Spot GPU Failover Guard & Auto-Resumer

PyPI Version License: MIT Security: Audited

SpotWarp is a lightweight, 100% local Python daemon that protects your AI inference & PyTorch model training workloads on cheap Spot GPUs (Vast.ai + RunPod cross-cloud) by converting unstable, interruptible instances into highly reliable, auto-resuming, stateful infrastructure.

Save up to 70% on GPU compute bills without worrying about sudden evictions or data loss โ€” and when your primary cloud is temporarily out of capacity, SpotWarp bridges you to a second cloud automatically, then brings you back the moment the cheaper option reopens.


๐Ÿ†š Spot GPU Eviction: Standard vs. SpotWarp

Feature Standard Spot Instance With SpotWarp (v3.2)
Eviction Consequence Workload dies, checkpoints are deleted, money is wasted. Zero Data Loss. Local daemon migrates work instantly.
Recovery Process Manual console log-in, search for a new GPU, manual setup. 100% Autopilot. Parallel candidate racing rents & verifies a replacement in under a minute.
If your cloud is out of stock Failover fails outright โ€” nothing to migrate to. Cross-Cloud Bridge. Automatically rents on RunPod as a fallback, spot pricing first, on-demand if spot isn't offered.
Paying bridge-cloud rates forever N/A Auto-Failback. Watches for your original cloud's cheaper capacity to return and migrates you back automatically โ€” the bridge cloud is never a permanent home.
Workload Continuation Restart training from epoch 0. Auto-Resume. Script continues running via nohup over SSH.
Security Risk Requires placing S3/GitHub keys on unstable rented hosts. Zero Key Leakage. All API keys remain on your local machine.

๐Ÿ’Ž Core Commercial Features

  • ๐Ÿ’ธ CFO-Approved GPU Savings: Safely exploit cheap Spot pricing on Vast.ai. SpotWarp gives you the reliability of a Dedicated On-Demand GPU for the price of a Spot instance.
  • ๐Ÿ Parallel Candidate Racing: On eviction, SpotWarp rents several replacement candidates concurrently instead of trying them one at a time โ€” a single slow or dead host no longer adds minutes to your downtime. Typical failover: well under a minute.
  • ๐ŸŒ Cross-Cloud Fallback (Vast.ai โ‡„ RunPod): If your primary cloud has zero matching candidates at the moment of eviction, SpotWarp automatically bridges to RunPod โ€” spot pricing first, retrying on-demand if RunPod has no spot capacity for that GPU model โ€” so your workload stays protected instead of failing outright.
  • โ†ฉ๏ธ Automatic Cost-Optimizing Failback: A bridge-cloud replacement is never left running indefinitely at the higher rate. SpotWarp keeps checking your original cloud in the background and migrates the workload back the instant a cheaper matching candidate reappears โ€” verified end-to-end on a single live instance: rented on Vast.ai, evicted, bridged to RunPod, then automatically migrated back to Vast.ai once capacity returned.
  • ๐Ÿ”„ Stateful Workload Migration: Runs high-speed rsync/scp incremental backups in the background of your local client machine. When eviction strikes, it restores your workspace files to the replacement container before verification.
  • โœ… Real Connectivity Verification: Replacement hosts are confirmed reachable via an actual SSH handshake before they're trusted โ€” not a proxy signal like a Jupyter API ping that can report false negatives on a perfectly healthy host.
  • ๐Ÿ”’ Zero-Trust Security (100% Local): Your cloud provider API keys (VAST_API_KEY, RUNPOD_API_KEY) stay on your local PC. Rented containers never see your cloud credentials.
  • ๐Ÿ“ฆ Zero-Configuration: No need to install daemons, cron jobs, or synchronization tools inside the remote container.
  • โšก Training Auto-Resumer: Automatically restarts your training scripts (--resume-cmd) in the background of the new container, pointing directly to your restored training checkpoints.

๐Ÿš€ Quick Start in 2 Minutes

1. Installation (Local PC)

Install the official package via Pip:

pip install spotwarp

2. Export API Keys & Set Up Local Environment

Set your Vast.ai API key on your local machine. Add a RunPod API key too if you want the cross-cloud bridge (optional, but recommended โ€” it's what keeps a bad-inventory day on Vast.ai from becoming downtime):

# On Linux/macOS
export VAST_API_KEY="your_vast_api_key"
export RUNPOD_API_KEY="your_runpod_api_key"   # optional, enables cross-cloud fallback + auto-failback

# On Windows (PowerShell)
$env:VAST_API_KEY="your_vast_api_key"
$env:RUNPOD_API_KEY="your_runpod_api_key"

3. Start the Guard (With Auto-Sync & Training Resume)

Run the guard daemon on your local PC. Point it to your license key and define how your training should resume:

spotwarp start --license-key YOUR_SPOTWARP_KEY --resume-cmd "python /workspace/train.py --resume"

โš™๏ธ How It Works (The Warping Cycle)

[Rented GPU Host]                     [Local PC (Client)]                    [New GPU Host]
  (Active Workload)
         โ”‚                                     โ”‚                                    โ”‚
         โ”‚ โ”€โ”€โ”€ (Sync: rsync/scp delta) โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚ (Cached Workspace)                 โ”‚
         โ”‚                                     โ”‚                                    โ”‚
    [๐Ÿšจ Evicted!]                              โ”‚                                    โ”‚
         โŒ โ”€โ”€โ”€ (Detected within 5s) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚                                    โ”‚
                                               โ”‚ โ”€โ”€โ”€ (Race 4 candidates) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚
                                               โ”‚      cheapest of the ready pool wins โ”‚
                                               โ”‚ โ”€โ”€โ”€ (Restore Workspace) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> โ”‚
                                               โ”‚ โ”€โ”€โ”€ (Nohup Resume Command) โ”€โ”€โ”€โ”€โ”€โ”€> [Run Workload]
                                                                                      (Continuing!)

  If Vast.ai has zero candidates:
                                               โ”‚ โ”€โ”€โ”€ (Bridge to RunPod) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€> [Temp Replacement]
                                               โ”‚ โ‹ฏ keeps watching Vast.ai in the background โ‹ฏ
                                               โ”‚ โ”€โ”€โ”€ (Vast.ai capacity returns) โ”€โ”€> [Migrate back, cheaper]
  1. Eviction Detection: SpotWarp polls the cloud API every 5 seconds. If eviction is detected, it triggers failover immediately.
  2. Parallel Candidate Racing: SpotWarp rents up to 4 matching-GPU candidates concurrently and picks the cheapest one that proves SSH-reachable, instead of trying offers one at a time.
  3. Cross-Cloud Bridge (if needed): If no Vast.ai candidate exists at that moment, SpotWarp automatically rents on RunPod instead โ€” spot pricing first, on-demand as a second attempt โ€” so the workload is never left completely unprotected.
  4. Delta Sync Restoration: SpotWarp transfers the cached workspace folder to the new container and confirms it's reachable over a real SSH connection.
  5. Nohup Handover: SpotWarp connects via SSH to trigger the --resume-cmd in the background.
  6. Auto-Failback: If step 3 was needed, SpotWarp keeps quietly re-checking Vast.ai for that GPU model. The moment a candidate reappears, it migrates the workload back automatically and releases the bridge-cloud host โ€” no manual intervention, no forgotten expensive instance left running.

๐Ÿ“„ License & Security Audits

SpotWarp is distributed under the MIT License. The code executes 100% locally in user space on your local computer, ensuring full transparency and compliance.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotwarp-3.2.0.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spotwarp-3.2.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file spotwarp-3.2.0.tar.gz.

File metadata

  • Download URL: spotwarp-3.2.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.13

File hashes

Hashes for spotwarp-3.2.0.tar.gz
Algorithm Hash digest
SHA256 46c2db9c6d1510b648cd23891650a0f16da945e9a4ec76e84e665f02252b952c
MD5 5c3114c7c560815b6f5392c663151852
BLAKE2b-256 710b32e33a7f2b29f078de577a950b7fb89137160af23a2f26ecba98f2fd9f85

See more details on using hashes here.

File details

Details for the file spotwarp-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: spotwarp-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.13

File hashes

Hashes for spotwarp-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a940efd842be81e846c79e6de46649a3e06da428a23f580a4c6bb1e54e089d7e
MD5 f98870e7376c2d44439a947de8cc30cd
BLAKE2b-256 1e5700a2dbe97898f63c7d61f19504021d66611c6bfa518381f265f017695961

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page