vastai-sdk-patterns

Installation
SKILL.md

Owned Vast.ai Python SDK Lifecycles

Overview

Use the highest-level client that preserves the required control. Keep resource identity and cleanup ownership explicit, normalize provider response variants at one boundary, and never hide a billable instance behind an unbounded retry.

Prerequisites

  • Chosen high-level, synchronous, asynchronous, or Serverless client surface
  • Typed internal model for offers, instances, terminal states, and provider errors
  • Idempotency, timeout, test-double, and cleanup design

Instructions

Step 1: Select one client boundary

Use VastAI for broad CLI-equivalent operations, SyncClient for typed synchronous instance control, AsyncClient inside an async context, or Serverless for endpoint inference.

Step 2: Normalize responses once

Installs
3
GitHub Stars
2.8K
First Seen
Mar 4, 2026